[llvm] Revert "[MC] Explicitly mark MCSymbol for MO_ExternalSymbol" (PR #133291)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 27 11:21:34 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: Eli Friedman (efriedma-quic)

<details>
<summary>Changes</summary>

Reverts llvm/llvm-project#<!-- -->108880 .

The patch has no regression test, no description of why the fix is necessary, and the code is modifying MC datastructures in a way that's forbidden in the AsmPrinter.  And the author didn't respond to a post-commit review comment requesting a regression test.

Fixes #<!-- -->132055.

---
Full diff: https://github.com/llvm/llvm-project/pull/133291.diff


1 Files Affected:

- (modified) llvm/lib/Target/X86/X86MCInstLower.cpp (+1-5) 


``````````diff
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index 3bd012c13cf0d..3f6cd55618666 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -349,12 +349,8 @@ MCOperand X86MCInstLower::LowerMachineOperand(const MachineInstr *MI,
     return MCOperand::createImm(MO.getImm());
   case MachineOperand::MO_MachineBasicBlock:
   case MachineOperand::MO_GlobalAddress:
+  case MachineOperand::MO_ExternalSymbol:
     return LowerSymbolOperand(MO, GetSymbolFromOperand(MO));
-  case MachineOperand::MO_ExternalSymbol: {
-    MCSymbol *Sym = GetSymbolFromOperand(MO);
-    Sym->setExternal(true);
-    return LowerSymbolOperand(MO, Sym);
-  }
   case MachineOperand::MO_MCSymbol:
     return LowerSymbolOperand(MO, MO.getMCSymbol());
   case MachineOperand::MO_JumpTableIndex:

``````````

</details>


https://github.com/llvm/llvm-project/pull/133291


More information about the llvm-commits mailing list