aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-08-12 05:05:49 +0000
committerFangrui Song <i@maskray.me>2022-08-12 05:05:49 +0000
commitb0c4cd35df89479ec152c1f79e18d0264dd276cc (patch)
tree89f8f245e85c3250a4486cf55e3ebacfc4ce0595
parente190b7cc90ca5ee712ca3982bf476afa9e8acb3b (diff)
downloadllvm-b0c4cd35df89479ec152c1f79e18d0264dd276cc.zip
llvm-b0c4cd35df89479ec152c1f79e18d0264dd276cc.tar.gz
llvm-b0c4cd35df89479ec152c1f79e18d0264dd276cc.tar.bz2
[MCDwarf] Use emplace to avoid move assignment. NFC
-rw-r--r--llvm/lib/MC/MCDwarf.cpp2
-rw-r--r--llvm/unittests/MC/DwarfLineTableHeaders.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 4cbb998..91a636b 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -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());
diff --git a/llvm/unittests/MC/DwarfLineTableHeaders.cpp b/llvm/unittests/MC/DwarfLineTableHeaders.cpp
index 8ce6a03..5b40df41 100644
--- a/llvm/unittests/MC/DwarfLineTableHeaders.cpp
+++ b/llvm/unittests/MC/DwarfLineTableHeaders.cpp
@@ -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;