Skip to content

Commit c439888

Browse files
MaskRaytru
authored andcommitted
[MCDwarf] Use emplace to avoid move assignment. NFC
(cherry picked from commit b0c4cd3)
1 parent ddb04d7 commit c439888

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/MC/MCDwarf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void MCDwarfLineTable::emit(MCStreamer *MCOS, MCDwarfLineTableParams Params) {
266266
// In a v5 non-split line table, put the strings in a separate section.
267267
Optional<MCDwarfLineStr> LineStr;
268268
if (context.getDwarfVersion() >= 5)
269-
LineStr = MCDwarfLineStr(context);
269+
LineStr.emplace(context);
270270

271271
// Switch to the section where the table will be emitted into.
272272
MCOS->switchSection(context.getObjectFileInfo()->getDwarfLineSection());

llvm/unittests/MC/DwarfLineTableHeaders.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class DwarfLineTableHeaders : public ::testing::Test {
120120
MCDwarfLineTableParams Params = Assembler.getDWARFLinetableParams();
121121
Optional<MCDwarfLineStr> LineStr(None);
122122
if (Ctx.getDwarfVersion() >= 5) {
123-
LineStr = MCDwarfLineStr(Ctx);
123+
LineStr.emplace(Ctx);
124124
Header.setRootFile("dir", "file", None, None);
125125
}
126126
MCSymbol *LineEndSym = Header.Emit(TheStreamer, Params, LineStr).second;

0 commit comments

Comments
 (0)