Skip to content

Commit 32fc1b7

Browse files
committed
Remove IsPCRel parameter
Information can be retrieved from `Fixup`.
1 parent 1f9bfbb commit 32fc1b7

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

llvm/include/llvm/MC/MCGOFFObjectWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class MCGOFFObjectTargetWriter : public MCObjectTargetWriter {
3535

3636
~MCGOFFObjectTargetWriter() override = default;
3737

38-
virtual unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
39-
bool IsPCRel) const = 0;
38+
virtual unsigned getRelocType(const MCValue &Target,
39+
const MCFixup &Fixup) const = 0;
4040

4141
Triple::ObjectFormatType getFormat() const override { return Triple::GOFF; }
4242

llvm/lib/MC/GOFFObjectWriter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,8 @@ void GOFFObjectWriter::recordRelocation(const MCFragment &F,
751751
const uint32_t Length = FKI.TargetSize / 8;
752752
assert(FKI.TargetSize % 8 == 0 && "Target Size not multiple of 8");
753753
const uint64_t FixupOffset = Asm->getFragmentOffset(F) + Fixup.getOffset();
754-
bool IsPCRel = Fixup.isPCRel();
755754

756-
unsigned RelocType = TargetObjectWriter->getRelocType(Target, Fixup, IsPCRel);
755+
unsigned RelocType = TargetObjectWriter->getRelocType(Target, Fixup);
757756

758757
const MCSectionGOFF *PSection = static_cast<MCSectionGOFF *>(F.getParent());
759758
const auto &A = *static_cast<const MCSymbolGOFF *>(Target.getAddSym());

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGOFFObjectWriter.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@ class SystemZGOFFObjectWriter : public MCGOFFObjectTargetWriter {
1818
public:
1919
SystemZGOFFObjectWriter();
2020

21-
unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
22-
bool IsPCRel) const override;
21+
unsigned getRelocType(const MCValue &Target,
22+
const MCFixup &Fixup) const override;
2323
};
2424
} // end anonymous namespace
2525

2626
SystemZGOFFObjectWriter::SystemZGOFFObjectWriter()
2727
: MCGOFFObjectTargetWriter() {}
2828

2929
unsigned SystemZGOFFObjectWriter::getRelocType(const MCValue &Target,
30-
const MCFixup &Fixup,
31-
bool IsPCRel) const {
30+
const MCFixup &Fixup) const {
3231
switch (Target.getSpecifier()) {
33-
case SystemZ::S_PLT: // TODO This doen't make sense.
32+
case SystemZ::S_PLT: // TODO This doen't make sense.
3433
return Reloc_Type_RelImm;
3534
case SystemZ::S_RCon:
3635
return Reloc_Type_RCon;
@@ -39,7 +38,7 @@ unsigned SystemZGOFFObjectWriter::getRelocType(const MCValue &Target,
3938
case SystemZ::S_QCon:
4039
return Reloc_Type_QCon;
4140
case SystemZ::S_None:
42-
if (IsPCRel)
41+
if (Fixup.isPCRel())
4342
return Reloc_Type_RelImm;
4443
return Reloc_Type_ACon;
4544
}

0 commit comments

Comments
 (0)