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 @@ -50,8 +50,10 @@ class MCAsmBackend {
50
50
51
51
const llvm::endianness Endian;
52
52
53
- // / Fixup kind used for linker relaxation. Currently only used by RISC-V.
53
+ // / Fixup kind used for linker relaxation. Currently only used by RISC-V
54
+ // / and LoongArch.
54
55
const unsigned RelaxFixupKind;
56
+ bool allowLinkerRelaxation () const { return RelaxFixupKind != MaxFixupKind; }
55
57
56
58
// / Return true if this target might automatically pad instructions and thus
57
59
// / 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