Skip to content

Commit 2235e20

Browse files
committed
MCAsmBackend: Remove redundant relaxInstruction overrides
1 parent 51f4e2c commit 2235e20

File tree

5 files changed

+5
-25
lines changed

5 files changed

+5
-25
lines changed

llvm/include/llvm/MC/MCAsmBackend.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ class LLVM_ABI MCAsmBackend {
174174
/// instruction.
175175
/// \param STI the subtarget information for the associated instruction.
176176
virtual void relaxInstruction(MCInst &Inst,
177-
const MCSubtargetInfo &STI) const {};
177+
const MCSubtargetInfo &STI) const {
178+
llvm_unreachable(
179+
"Needed if fixupNeedsRelaxation/fixupNeedsRelaxationAdvanced may "
180+
"return true");
181+
}
178182

179183
// Defined by linker relaxation targets.
180184
virtual bool relaxDwarfLineAddr(MCDwarfLineAddrFragment &DF,

llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ class AArch64AsmBackend : public MCAsmBackend {
8484

8585
bool fixupNeedsRelaxation(const MCFixup &Fixup,
8686
uint64_t Value) const override;
87-
void relaxInstruction(MCInst &Inst,
88-
const MCSubtargetInfo &STI) const override;
8987
bool writeNopData(raw_ostream &OS, uint64_t Count,
9088
const MCSubtargetInfo *STI) const override;
9189

@@ -509,11 +507,6 @@ bool AArch64AsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
509507
return int64_t(Value) != int64_t(int8_t(Value));
510508
}
511509

512-
void AArch64AsmBackend::relaxInstruction(MCInst &Inst,
513-
const MCSubtargetInfo &STI) const {
514-
llvm_unreachable("AArch64AsmBackend::relaxInstruction() unimplemented");
515-
}
516-
517510
bool AArch64AsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
518511
const MCSubtargetInfo *STI) const {
519512
// If the count is not 4-byte aligned, we must be writing data into the text

llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ class PPCAsmBackend : public MCAsmBackend {
128128
}
129129
}
130130

131-
void relaxInstruction(MCInst &Inst,
132-
const MCSubtargetInfo &STI) const override {
133-
// FIXME.
134-
llvm_unreachable("relaxInstruction() unimplemented");
135-
}
136-
137131
bool writeNopData(raw_ostream &OS, uint64_t Count,
138132
const MCSubtargetInfo *STI) const override {
139133
uint64_t NumNops = Count / 4;

llvm/lib/Target/VE/MCTargetDesc/VEAsmBackend.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ class VEAsmBackend : public MCAsmBackend {
123123
return false;
124124
}
125125

126-
void relaxInstruction(MCInst &Inst,
127-
const MCSubtargetInfo &STI) const override {
128-
// Aurora VE doesn't support relaxInstruction yet.
129-
llvm_unreachable("relaxInstruction() should not be called");
130-
}
131-
132126
bool writeNopData(raw_ostream &OS, uint64_t Count,
133127
const MCSubtargetInfo *STI) const override {
134128
if ((Count % 8) != 0)

llvm/lib/Target/Xtensa/MCTargetDesc/XtensaAsmBackend.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class XtensaAsmBackend : public MCAsmBackend {
4141
bool IsResolved) override;
4242
bool mayNeedRelaxation(const MCInst &Inst,
4343
const MCSubtargetInfo &STI) const override;
44-
void relaxInstruction(MCInst &Inst,
45-
const MCSubtargetInfo &STI) const override;
4644
bool writeNopData(raw_ostream &OS, uint64_t Count,
4745
const MCSubtargetInfo *STI) const override;
4846

@@ -185,9 +183,6 @@ bool XtensaAsmBackend::mayNeedRelaxation(const MCInst &Inst,
185183
return false;
186184
}
187185

188-
void XtensaAsmBackend::relaxInstruction(MCInst &Inst,
189-
const MCSubtargetInfo &STI) const {}
190-
191186
bool XtensaAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
192187
const MCSubtargetInfo *STI) const {
193188
uint64_t NumNops24b = Count / 3;

0 commit comments

Comments
 (0)