Skip to content

Commit 89909d8

Browse files
committed
AVRAsmBackend: Don't use the MCSubtargetInfo argument
The argument will be removed from `addReloc`. Use MCContext::getSubtargetInfo instead, to be consistent with other adjustRelativeBranch calls.
1 parent ccffa1d commit 89909d8

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ bool AVRAsmBackend::addReloc(MCAssembler &Asm, const MCFragment &F,
377377
if (IsResolved) {
378378
auto TargetVal = MCValue::get(Target.getAddSym(), Target.getSubSym(),
379379
FixedValue, Target.getSpecifier());
380-
if (forceRelocation(Asm, Fixup, TargetVal, STI))
380+
if (forceRelocation(Asm, F, Fixup, TargetVal))
381381
IsResolved = false;
382382
}
383383
if (!IsResolved)
@@ -515,9 +515,9 @@ bool AVRAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
515515
return true;
516516
}
517517

518-
bool AVRAsmBackend::forceRelocation(const MCAssembler &Asm,
519-
const MCFixup &Fixup, const MCValue &Target,
520-
const MCSubtargetInfo *STI) {
518+
bool AVRAsmBackend::forceRelocation(const MCAssembler &Asm, const MCFragment &F,
519+
const MCFixup &Fixup,
520+
const MCValue &Target) {
521521
switch ((unsigned)Fixup.getKind()) {
522522
default:
523523
return false;
@@ -532,7 +532,8 @@ bool AVRAsmBackend::forceRelocation(const MCAssembler &Asm,
532532
// Note that trying to actually link that relocation *would* fail, but the
533533
// hopes are that the module we're currently compiling won't be actually
534534
// linked to the final binary.
535-
return !adjust::adjustRelativeBranch(Size, Fixup, Offset, STI);
535+
return !adjust::adjustRelativeBranch(Size, Fixup, Offset,
536+
Asm.getContext().getSubtargetInfo());
536537
}
537538

538539
case AVR::fixup_call:

llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class AVRAsmBackend : public MCAsmBackend {
5252
bool writeNopData(raw_ostream &OS, uint64_t Count,
5353
const MCSubtargetInfo *STI) const override;
5454

55-
bool forceRelocation(const MCAssembler &Asm, const MCFixup &Fixup,
56-
const MCValue &Target, const MCSubtargetInfo *);
55+
bool forceRelocation(const MCAssembler &Asm, const MCFragment &F,
56+
const MCFixup &Fixup, const MCValue &Target);
5757

5858
private:
5959
Triple::OSType OSType;

0 commit comments

Comments
 (0)