File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,10 @@ class MCAsmBackend {
53
53
54
54
const llvm::endianness Endian;
55
55
56
- // / Fixup kind used for linker relaxation. Currently only used by RISC-V.
56
+ // / Fixup kind used for linker relaxation. Currently only used by RISC-V
57
+ // / and LoongArch.
57
58
const unsigned RelaxFixupKind;
59
+ bool allowLinkerRelaxation () const { return RelaxFixupKind != MaxFixupKind; }
58
60
59
61
// / Return true if this target might automatically pad instructions and thus
60
62
// / need to emit padding enable/disable directives around sensative code.
Original file line number Diff line number Diff line change @@ -627,8 +627,7 @@ static void AttemptToFoldSymbolOffsetDifference(
627
627
// .size/.fill), disable the fast path.
628
628
bool Layout = Asm->hasLayout ();
629
629
if (Layout && (InSet || !SecA.hasInstructions () ||
630
- !(Asm->getContext ().getTargetTriple ().isRISCV () ||
631
- Asm->getContext ().getTargetTriple ().isLoongArch ()))) {
630
+ !Asm->getBackend ().allowLinkerRelaxation ())) {
632
631
// If both symbols are in the same fragment, return the difference of their
633
632
// offsets. canGetFragmentOffset(FA) may be false.
634
633
if (FA == FB && !SA.isVariable () && !SB.isVariable ()) {
You can’t perform that action at this time.
0 commit comments