aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-06-21 21:51:16 -0700
committerFangrui Song <i@maskray.me>2024-06-21 21:51:16 -0700
commit9486c35ecac59a451aaa923f47087e834f478dfb (patch)
tree4afebcb387a79dc2598737f2ab7cbd444d07c250 /llvm/lib
parentc5f5238a4aa385d4ae4ec1b509bd50e0a43b81ae (diff)
downloadllvm-9486c35ecac59a451aaa923f47087e834f478dfb.zip
llvm-9486c35ecac59a451aaa923f47087e834f478dfb.tar.gz
llvm-9486c35ecac59a451aaa923f47087e834f478dfb.tar.bz2
[ARM] Simplify ElfMappingSymbolInfo. NFC
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
index afd7dcc..72d739c 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -487,7 +487,7 @@ public:
LastEMSInfo = std::move(LastMappingSymbol->second);
return;
}
- LastEMSInfo.reset(new ElfMappingSymbolInfo(SMLoc(), nullptr, 0));
+ LastEMSInfo.reset(new ElfMappingSymbolInfo);
}
/// This function is the one used to emit instruction data into the ELF
@@ -555,7 +555,7 @@ public:
if (!LastEMSInfo->hasInfo())
return;
ElfMappingSymbolInfo *EMS = LastEMSInfo.get();
- EmitMappingSymbol("$d", EMS->Loc, EMS->F, EMS->Offset);
+ EmitMappingSymbol("$d", SMLoc(), EMS->F, EMS->Offset);
EMS->resetInfo();
}
@@ -625,17 +625,14 @@ private:
};
struct ElfMappingSymbolInfo {
- explicit ElfMappingSymbolInfo(SMLoc Loc, MCFragment *F, uint64_t O)
- : Loc(Loc), F(F), Offset(O), State(EMS_None) {}
void resetInfo() {
F = nullptr;
Offset = 0;
}
bool hasInfo() { return F != nullptr; }
- SMLoc Loc;
- MCFragment *F;
- uint64_t Offset;
- ElfMappingSymbol State;
+ MCFragment *F = nullptr;
+ uint64_t Offset = 0;
+ ElfMappingSymbol State = EMS_None;
};
void emitDataMappingSymbol() {
@@ -648,7 +645,6 @@ private:
auto *DF = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
if (!DF)
return;
- EMS->Loc = SMLoc();
EMS->F = getCurrentFragment();
EMS->Offset = DF->getContents().size();
LastEMSInfo->State = EMS_Data;