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

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 27 11:20:56 PDT 2025


https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/133291

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.

>From 35937892be532c8bd5fda5b738141cab1b347f81 Mon Sep 17 00:00:00 2001
From: Eli Friedman <efriedma at quicinc.com>
Date: Thu, 27 Mar 2025 11:12:51 -0700
Subject: [PATCH] Revert "[MC] Explicitly mark MCSymbol for MO_ExternalSymbol
 (#108880)"

This reverts commit 3d0846bedcd18d546fd3733c93c2e144f2faab09.
---
 llvm/lib/Target/X86/X86MCInstLower.cpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

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:



More information about the llvm-commits mailing list