summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-17 18:57:19 +0000
committerChris Lattner <sabre@nondot.org>2010-02-17 18:57:19 +0000
commitbdceca6f49abd51c08516508522c51de47ec5df3 (patch)
tree06e8aef9109504a49b88afe7de0e7f5b953d12f6 /llvm/lib
parent1fa9c2cce4382d9a54634ca05e7c6b1f590c5413 (diff)
downloadbcm5719-llvm-bdceca6f49abd51c08516508522c51de47ec5df3.tar.gz
bcm5719-llvm-bdceca6f49abd51c08516508522c51de47ec5df3.zip
"Fix and issue in SparcAsmPrinter where multiple identical .LLGETPCHn symbols could be emitted in the same file (it was uniqued by block number, but not by function number). " Patch by Nathan Keynes!
llvm-svn: 96495
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
index ecb8b0084f0..d6b45be293c 100644
--- a/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
+++ b/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
@@ -143,18 +143,19 @@ bool SparcAsmPrinter::printGetPCX(const MachineInstr *MI, unsigned opNum) {
break;
}
+ unsigned mfNum = MI->getParent()->getParent()->getFunctionNumber();
unsigned bbNum = MI->getParent()->getNumber();
- O << '\n' << ".LLGETPCH" << bbNum << ":\n";
- O << "\tcall\t.LLGETPC" << bbNum << '\n' ;
+ O << '\n' << ".LLGETPCH" << mfNum << '_' << bbNum << ":\n";
+ O << "\tcall\t.LLGETPC" << mfNum << '_' << bbNum << '\n' ;
O << "\t sethi\t"
- << "%hi(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPCH" << bbNum << ")), "
+ << "%hi(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPCH" << mfNum << '_' << bbNum << ")), "
<< operand << '\n' ;
- O << ".LLGETPC" << bbNum << ":\n" ;
+ O << ".LLGETPC" << mfNum << '_' << bbNum << ":\n" ;
O << "\tor\t" << operand
- << ", %lo(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPCH" << bbNum << ")), "
+ << ", %lo(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPCH" << mfNum << '_' << bbNum << ")), "
<< operand << '\n';
O << "\tadd\t" << operand << ", %o7, " << operand << '\n';
OpenPOWER on IntegriCloud