-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MC] Explicitly mark MCSymbol for MO_ExternalSymbol #108880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MC] Explicitly mark MCSymbol for MO_ExternalSymbol #108880
Conversation
@llvm/pr-subscribers-lld-macho @llvm/pr-subscribers-backend-x86 Author: weiwei chen (weiweichen) Changes
Full diff: https://github.com/llvm/llvm-project/pull/108880.diff 1 Files Affected:
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index 77ddd2366e629e..949711f35aa584 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -350,8 +350,11 @@ 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:
|
…eic/mark-x86-externalsymbol-mcsymbol-external
…eic/mark-x86-externalsymbol-mcsymbol-external
…eic/mark-x86-externalsymbol-mcsymbol-external
@@ -350,8 +350,11 @@ 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: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean for MO_GlobalAddress and MO_MachineBasicBlock to also hit this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
welp, no, 🤦♀️, thanks for pointing this out!
…eic/mark-x86-externalsymbol-mcsymbol-external
…eic/mark-x86-externalsymbol-mcsymbol-external
Wouldn't this change require a test? |
)" This reverts commit 3d0846b.
This reverts commit 3d0846b.
…l" (#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. Fixes #132055.
…3291) Reverts llvm#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. Fixes llvm#132055. (cherry picked from commit cd6e959)
…l" (#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. Fixes #132055. (cherry picked from commit cd6e959)
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. Fixes #132055. patch.cherry: true patch.metadata.original_sha: cd6e959 patch.platforms: chromiumos patch.version_range.from: 550362 patch.version_range.until: 570122 Change-Id: I998708a3260843e5c306edc18251835d2e2d5ce3
MCSymbol
forMO_ExternalSymbol
to be external when created.