diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-25 21:17:10 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-25 21:17:10 +0000 |
| commit | 00d188f37986e2d06913c93f2646845871290233 (patch) | |
| tree | 5c00f853806c9fc93083844e3081f491cc5ea7ce /llvm | |
| parent | 19bd0398962e93f6df51f40ab1a88892f73a7b4a (diff) | |
| download | bcm5719-llvm-00d188f37986e2d06913c93f2646845871290233.tar.gz bcm5719-llvm-00d188f37986e2d06913c93f2646845871290233.zip | |
handle the _set_ symbol with an MCSymbol.
llvm-svn: 94449
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/CodeGen/AsmPrinter.h | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 17 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 3 |
3 files changed, 17 insertions, 7 deletions
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index 48cf86b53c4..fabb07731e7 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -324,6 +324,10 @@ namespace llvm { /// GetJTISymbol - Return the symbol for the specified jump table entry. MCSymbol *GetJTISymbol(unsigned JTID, bool isLinkerPrivate = false) const; + /// GetJTSetSymbol - Return the symbol for the specified jump table .set + /// FIXME: privatize to AsmPrinter. + MCSymbol *GetJTSetSymbol(unsigned UID, unsigned MBBID) const; + /// GetBlockAddressSymbol - Return the MCSymbol used to satisfy BlockAddress /// uses of the specified basic block. MCSymbol *GetBlockAddressSymbol(const BlockAddress *BA, diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 7a44a016560..a0048e17dbf 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -557,8 +557,7 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI, // If we're emitting non-PIC code, then emit the entries as direct // references to the target basic blocks. if (MAI->getSetDirective()) { - O << MAI->getPrivateGlobalPrefix() << getFunctionNumber() - << '_' << uid << "_set_" << MBB->getNumber(); + O << *GetJTSetSymbol(uid, MBB->getNumber()); } else { O << *GetMBBSymbol(MBB->getNumber()); // If the arch uses custom Jump Table directives, don't calc relative to @@ -1379,6 +1378,15 @@ MCSymbol *AsmPrinter::GetJTISymbol(unsigned JTID, bool isLinkerPrivate) const { return OutContext.GetOrCreateSymbol(Name.str()); } +/// GetJTSetSymbol - Return the symbol for the specified jump table .set +/// FIXME: privatize to AsmPrinter. +MCSymbol *AsmPrinter::GetJTSetSymbol(unsigned UID, unsigned MBBID) const { + SmallString<60> Name; + raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() + << getFunctionNumber() << '_' << UID << "_set_" << MBBID; + return OutContext.GetOrCreateSymbol(Name.str()); +} + /// GetGlobalValueSymbol - Return the MCSymbol for the specified global /// value. MCSymbol *AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const { @@ -1526,9 +1534,8 @@ void AsmPrinter::printPICJumpTableSetLabel(unsigned uid, return; O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix() - << getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',' - << *GetMBBSymbol(MBB->getNumber()) - << '-' << *GetJTISymbol(uid) << '\n'; + << *GetJTSetSymbol(uid, MBB->getNumber()) << ',' + << *GetMBBSymbol(MBB->getNumber()) << '-' << *GetJTISymbol(uid) << '\n'; } void AsmPrinter::printVisibility(MCSymbol *Sym, unsigned Visibility) const { diff --git a/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index 7fc6eba170c..adae407385e 100644 --- a/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -494,8 +494,7 @@ void X86AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI, O << JTEntryDirective << ' '; if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStubPIC()) { - O << MAI->getPrivateGlobalPrefix() << getFunctionNumber() - << '_' << uid << "_set_" << MBB->getNumber(); + O << *GetJTSetSymbol(uid, MBB->getNumber()); } else if (Subtarget->isPICStyleGOT()) O << *GetMBBSymbol(MBB->getNumber()) << "@GOTOFF"; else // mdynamic-no-pic |

