summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2019-07-19 01:10:28 +0000
committerBill Wendling <isanbard@gmail.com>2019-07-19 01:10:28 +0000
commitccbffefccaff42b0d094c9ef0f49fc3e8c8456ea (patch)
treee9ce303fe2a9e03c8fef146f356c7bc21d4420bc /llvm/lib
parentd3607756dda65ce4f705462e48ed73a4afdd073a (diff)
downloadbcm5719-llvm-ccbffefccaff42b0d094c9ef0f49fc3e8c8456ea.tar.gz
bcm5719-llvm-ccbffefccaff42b0d094c9ef0f49fc3e8c8456ea.zip
Use the MachineBasicBlock symbol for a callbr target
Summary: Inline asm doesn't use labels when compiled as an object file. Therefore, we shouldn't create one for the (potential) callbr destination. Instead, use the symbol for the MachineBasicBlock. Reviewers: nickdesaulniers, craig.topper Reviewed By: nickdesaulniers Subscribers: xbolva00, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64888 llvm-svn: 366523
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
index 7721e996aca..59d3b7c8e55 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
@@ -430,8 +430,13 @@ static void EmitGCCInlineAsmStr(const char *AsmStr, const MachineInstr *MI,
if (Modifier[0] == 'l') { // Labels are target independent.
if (MI->getOperand(OpNo).isBlockAddress()) {
const BlockAddress *BA = MI->getOperand(OpNo).getBlockAddress();
- MCSymbol *Sym = AP->GetBlockAddressSymbol(BA);
- Sym->print(OS, AP->MAI);
+ const BasicBlock *BB = BA->getBasicBlock();
+ const MachineFunction *MF = MI->getParent()->getParent();
+ for (const MachineBasicBlock &MBB : *MF)
+ if (BB == MBB.getBasicBlock()) {
+ MBB.getSymbol()->print(OS, AP->MAI);
+ break;
+ }
} else if (MI->getOperand(OpNo).isMBB()) {
const MCSymbol *Sym = MI->getOperand(OpNo).getMBB()->getSymbol();
Sym->print(OS, AP->MAI);
OpenPOWER on IntegriCloud