[MCDwarf] Use emplace to avoid move assignment. NFC

This commit is contained in:
Fangrui Song 2022-08-12 05:05:49 +00:00
parent e190b7cc90
commit b0c4cd35df
2 changed files with 2 additions and 2 deletions

View File

@ -266,7 +266,7 @@ void MCDwarfLineTable::emit(MCStreamer *MCOS, MCDwarfLineTableParams Params) {
// In a v5 non-split line table, put the strings in a separate section.
Optional<MCDwarfLineStr> LineStr;
if (context.getDwarfVersion() >= 5)
LineStr = MCDwarfLineStr(context);
LineStr.emplace(context);
// Switch to the section where the table will be emitted into.
MCOS->switchSection(context.getObjectFileInfo()->getDwarfLineSection());

View File

@ -120,7 +120,7 @@ public:
MCDwarfLineTableParams Params = Assembler.getDWARFLinetableParams();
Optional<MCDwarfLineStr> LineStr(None);
if (Ctx.getDwarfVersion() >= 5) {
LineStr = MCDwarfLineStr(Ctx);
LineStr.emplace(Ctx);
Header.setRootFile("dir", "file", None, None);
}
MCSymbol *LineEndSym = Header.Emit(TheStreamer, Params, LineStr).second;