Skip to content

Commit 9486c35

Browse files
committed
[ARM] Simplify ElfMappingSymbolInfo. NFC
1 parent c5f5238 commit 9486c35

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ class ARMELFStreamer : public MCELFStreamer {
487487
LastEMSInfo = std::move(LastMappingSymbol->second);
488488
return;
489489
}
490-
LastEMSInfo.reset(new ElfMappingSymbolInfo(SMLoc(), nullptr, 0));
490+
LastEMSInfo.reset(new ElfMappingSymbolInfo);
491491
}
492492

493493
/// This function is the one used to emit instruction data into the ELF
@@ -555,7 +555,7 @@ class ARMELFStreamer : public MCELFStreamer {
555555
if (!LastEMSInfo->hasInfo())
556556
return;
557557
ElfMappingSymbolInfo *EMS = LastEMSInfo.get();
558-
EmitMappingSymbol("$d", EMS->Loc, EMS->F, EMS->Offset);
558+
EmitMappingSymbol("$d", SMLoc(), EMS->F, EMS->Offset);
559559
EMS->resetInfo();
560560
}
561561

@@ -625,17 +625,14 @@ class ARMELFStreamer : public MCELFStreamer {
625625
};
626626

627627
struct ElfMappingSymbolInfo {
628-
explicit ElfMappingSymbolInfo(SMLoc Loc, MCFragment *F, uint64_t O)
629-
: Loc(Loc), F(F), Offset(O), State(EMS_None) {}
630628
void resetInfo() {
631629
F = nullptr;
632630
Offset = 0;
633631
}
634632
bool hasInfo() { return F != nullptr; }
635-
SMLoc Loc;
636-
MCFragment *F;
637-
uint64_t Offset;
638-
ElfMappingSymbol State;
633+
MCFragment *F = nullptr;
634+
uint64_t Offset = 0;
635+
ElfMappingSymbol State = EMS_None;
639636
};
640637

641638
void emitDataMappingSymbol() {
@@ -648,7 +645,6 @@ class ARMELFStreamer : public MCELFStreamer {
648645
auto *DF = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
649646
if (!DF)
650647
return;
651-
EMS->Loc = SMLoc();
652648
EMS->F = getCurrentFragment();
653649
EMS->Offset = DF->getContents().size();
654650
LastEMSInfo->State = EMS_Data;

0 commit comments

Comments
 (0)