File tree 4 files changed +14
-15
lines changed
4 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,11 @@ class MCAsmBackend {
88
88
// / Get information on a fixup kind.
89
89
virtual MCFixupKindInfo getFixupKindInfo (MCFixupKind Kind) const ;
90
90
91
- // Hook to check if a relocation is needed. The default implementation tests
92
- // whether the MCValue has a relocation specifier.
91
+ // Hook used by the default `addReloc` to check if a relocation is needed.
93
92
virtual bool shouldForceRelocation (const MCAssembler &, const MCFixup &,
94
- const MCValue &, const MCSubtargetInfo *);
93
+ const MCValue &, const MCSubtargetInfo *) {
94
+ return false ;
95
+ }
95
96
96
97
// / Hook to check if extra nop bytes must be inserted for alignment directive.
97
98
// / For some targets this may be necessary in order to support linker
Original file line number Diff line number Diff line change @@ -109,12 +109,6 @@ MCFixupKindInfo MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
109
109
return Builtins[Kind - FK_NONE];
110
110
}
111
111
112
- bool MCAsmBackend::shouldForceRelocation (const MCAssembler &, const MCFixup &,
113
- const MCValue &Target,
114
- const MCSubtargetInfo *) {
115
- return Target.getSpecifier ();
116
- }
117
-
118
112
bool MCAsmBackend::fixupNeedsRelaxationAdvanced (const MCAssembler &,
119
113
const MCFixup &Fixup,
120
114
const MCValue &, uint64_t Value,
Original file line number Diff line number Diff line change @@ -200,12 +200,6 @@ namespace {
200
200
return Info;
201
201
}
202
202
203
- bool shouldForceRelocation (const MCAssembler &, const MCFixup &,
204
- const MCValue &,
205
- const MCSubtargetInfo *) override {
206
- return false ;
207
- }
208
-
209
203
void relaxInstruction (MCInst &Inst,
210
204
const MCSubtargetInfo &STI) const override {
211
205
// FIXME.
Original file line number Diff line number Diff line change 17
17
#include " llvm/MC/MCInst.h"
18
18
#include " llvm/MC/MCObjectWriter.h"
19
19
#include " llvm/MC/MCSubtargetInfo.h"
20
+ #include " llvm/MC/MCValue.h"
20
21
21
22
using namespace llvm ;
22
23
@@ -112,6 +113,8 @@ class SystemZMCAsmBackend : public MCAsmBackend {
112
113
// Override MCAsmBackend
113
114
std::optional<MCFixupKind> getFixupKind (StringRef Name) const override ;
114
115
MCFixupKindInfo getFixupKindInfo (MCFixupKind Kind) const override ;
116
+ bool shouldForceRelocation (const MCAssembler &, const MCFixup &,
117
+ const MCValue &, const MCSubtargetInfo *) override ;
115
118
void applyFixup (const MCAssembler &Asm, const MCFixup &Fixup,
116
119
const MCValue &Target, MutableArrayRef<char > Data,
117
120
uint64_t Value, bool IsResolved,
@@ -152,6 +155,13 @@ MCFixupKindInfo SystemZMCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
152
155
return SystemZ::MCFixupKindInfos[Kind - FirstTargetFixupKind];
153
156
}
154
157
158
+ bool SystemZMCAsmBackend::shouldForceRelocation (const MCAssembler &,
159
+ const MCFixup &,
160
+ const MCValue &Target,
161
+ const MCSubtargetInfo *) {
162
+ return Target.getSpecifier ();
163
+ }
164
+
155
165
void SystemZMCAsmBackend::applyFixup (const MCAssembler &Asm,
156
166
const MCFixup &Fixup,
157
167
const MCValue &Target,
You can’t perform that action at this time.
0 commit comments