Skip to content

Commit 40da58a

Browse files
committed
[MC] Default MCAsmBackend::mayNeedRelaxation() to false
1 parent 594dec2 commit 40da58a

File tree

11 files changed

+3
-58
lines changed

11 files changed

+3
-58
lines changed

llvm/include/llvm/MC/MCAsmBackend.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ class MCAsmBackend {
144144
/// \param STI - The MCSubtargetInfo in effect when the instruction was
145145
/// encoded.
146146
virtual bool mayNeedRelaxation(const MCInst &Inst,
147-
const MCSubtargetInfo &STI) const = 0;
147+
const MCSubtargetInfo &STI) const {
148+
return false;
149+
}
148150

149151
/// Target specific predicate for whether a given fixup requires the
150152
/// associated instruction to be relaxed.

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

-7
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ class AArch64AsmBackend : public MCAsmBackend {
8888
uint64_t Value, bool IsResolved,
8989
const MCSubtargetInfo *STI) const override;
9090

91-
bool mayNeedRelaxation(const MCInst &Inst,
92-
const MCSubtargetInfo &STI) const override;
9391
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
9492
const MCRelaxableFragment *DF,
9593
const MCAsmLayout &Layout) const override;
@@ -463,11 +461,6 @@ void AArch64AsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
463461
}
464462
}
465463

466-
bool AArch64AsmBackend::mayNeedRelaxation(const MCInst &Inst,
467-
const MCSubtargetInfo &STI) const {
468-
return false;
469-
}
470-
471464
bool AArch64AsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
472465
uint64_t Value,
473466
const MCRelaxableFragment *DF,

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

-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ class AVRAsmBackend : public MCAsmBackend {
4848
return AVR::NumTargetFixupKinds;
4949
}
5050

51-
bool mayNeedRelaxation(const MCInst &Inst,
52-
const MCSubtargetInfo &STI) const override {
53-
return false;
54-
}
55-
5651
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
5752
const MCRelaxableFragment *DF,
5853
const MCAsmLayout &Layout) const override {

llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ class BPFAsmBackend : public MCAsmBackend {
4343

4444
unsigned getNumFixupKinds() const override { return 1; }
4545

46-
bool mayNeedRelaxation(const MCInst &Inst,
47-
const MCSubtargetInfo &STI) const override {
48-
return false;
49-
}
50-
5146
bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
5247
};
5348

llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ class LanaiAsmBackend : public MCAsmBackend {
6969
return Lanai::NumTargetFixupKinds;
7070
}
7171

72-
bool mayNeedRelaxation(const MCInst & /*Inst*/,
73-
const MCSubtargetInfo &STI) const override {
74-
return false;
75-
}
76-
7772
bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
7873
};
7974

llvm/lib/Target/MSP430/MCTargetDesc/MSP430AsmBackend.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ class MSP430AsmBackend : public MCAsmBackend {
9090
return Infos[Kind - FirstTargetFixupKind];
9191
}
9292

93-
bool mayNeedRelaxation(const MCInst &Inst,
94-
const MCSubtargetInfo &STI) const override {
95-
return false;
96-
}
97-
9893
bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
9994
};
10095

llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h

-9
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ class MipsAsmBackend : public MCAsmBackend {
5353
/// @name Target Relaxation Interfaces
5454
/// @{
5555

56-
/// MayNeedRelaxation - Check whether the given instruction may need
57-
/// relaxation.
58-
///
59-
/// \param Inst - The instruction to test.
60-
bool mayNeedRelaxation(const MCInst &Inst,
61-
const MCSubtargetInfo &STI) const override {
62-
return false;
63-
}
64-
6556
/// fixupNeedsRelaxation - Target specific predicate for whether a given
6657
/// fixup requires the associated instruction to be relaxed.
6758
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,

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

-6
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ class PPCAsmBackend : public MCAsmBackend {
182182
}
183183
}
184184

185-
bool mayNeedRelaxation(const MCInst &Inst,
186-
const MCSubtargetInfo &STI) const override {
187-
// FIXME.
188-
return false;
189-
}
190-
191185
bool fixupNeedsRelaxation(const MCFixup &Fixup,
192186
uint64_t Value,
193187
const MCRelaxableFragment *DF,

llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,6 @@ namespace {
255255
}
256256
}
257257

258-
bool mayNeedRelaxation(const MCInst &Inst,
259-
const MCSubtargetInfo &STI) const override {
260-
// FIXME.
261-
return false;
262-
}
263-
264258
/// fixupNeedsRelaxation - Target specific predicate for whether a given
265259
/// fixup requires the associated instruction to be relaxed.
266260
bool fixupNeedsRelaxation(const MCFixup &Fixup,

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

-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ class SystemZMCAsmBackend : public MCAsmBackend {
5454
const MCValue &Target, MutableArrayRef<char> Data,
5555
uint64_t Value, bool IsResolved,
5656
const MCSubtargetInfo *STI) const override;
57-
bool mayNeedRelaxation(const MCInst &Inst,
58-
const MCSubtargetInfo &STI) const override {
59-
return false;
60-
}
6157
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
6258
const MCRelaxableFragment *Fragment,
6359
const MCAsmLayout &Layout) const override {

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ class WebAssemblyAsmBackend final : public MCAsmBackend {
5959
return false;
6060
}
6161

62-
bool mayNeedRelaxation(const MCInst &Inst,
63-
const MCSubtargetInfo &STI) const override {
64-
return false;
65-
}
66-
6762
bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
6863
};
6964

0 commit comments

Comments
 (0)