diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-04 19:25:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-04 19:25:43 +0000 |
commit | a179b5236173e24eadc53adc97ca53610aff1680 (patch) | |
tree | 4a1eb825a10b7fb77f6e3e51f27faa7fa25a531a /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 9efd11893808814b4a6ba7a4379ab890425a9ac9 (diff) | |
download | bcm5719-llvm-a179b5236173e24eadc53adc97ca53610aff1680.tar.gz bcm5719-llvm-a179b5236173e24eadc53adc97ca53610aff1680.zip |
move gettemplabel and getdwlabel to AsmPrinter and rename
them for consistency.
llvm-svn: 100345
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 62207f2fcd4..5c63cf28821 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -962,9 +962,7 @@ void AsmPrinter::EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, } // Otherwise, emit with .set (aka assignment). - MCSymbol *SetLabel = - OutContext.GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + - "set" + Twine(SetCounter++)); + MCSymbol *SetLabel = GetTempSymbol("set", SetCounter++); OutStreamer.EmitAssignment(SetLabel, Diff); OutStreamer.EmitSymbolValue(SetLabel, Size, 0/*AddrSpace*/); } @@ -1345,6 +1343,29 @@ void AsmPrinter::printOffset(int64_t Offset, raw_ostream &OS) const { OS << Offset; } +//===----------------------------------------------------------------------===// +// Symbol Lowering Routines. +//===----------------------------------------------------------------------===// + +/// GetTempSymbol - Return the MCSymbol corresponding to the assembler +/// temporary label with the specified stem and unique ID. +MCSymbol *AsmPrinter::GetTempSymbol(StringRef Name, unsigned ID) const { + // FIXME: REMOVE this. However, there is stuff in EH that passes counters in + // here that can be zero. + + //assert(ID && "Should use GetTempSymbol if no ID"); + if (ID == 0) return GetTempSymbol(Name); + return OutContext.GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix())+ + Name + Twine(ID)); +} + +/// GetTempSymbol - Return an assembler temporary label with the specified +/// stem. +MCSymbol *AsmPrinter::GetTempSymbol(StringRef Name) const { + return OutContext.GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix())+ + Name); +} + MCSymbol *AsmPrinter::GetBlockAddressSymbol(const BlockAddress *BA) const { return MMI->getAddrLabelSymbol(BA->getBasicBlock()); |