diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-16 00:08:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-16 00:08:41 +0000 |
commit | 334fd1f259b3e8aaf83cf0d40f74af5b209770e6 (patch) | |
tree | 41139ea036200a44e0739afc58707eba3414bbbd | |
parent | 58665d47aea69875c433fb039c8f10106abc1cee (diff) |
eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
it into all of its call sites and simplifying them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81962 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 6 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 12 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 3 |
4 files changed, 4 insertions, 21 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index decbea7319..8404841b5a 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -159,12 +159,6 @@ namespace llvm { /// bool isVerbose() const { return VerboseAsm; } - /// getGlobalLinkName - Returns the asm/link name of of the specified - /// global variable. Should be overridden by each target asm printer to - /// generate the appropriate value. - virtual const std::string &getGlobalLinkName(const GlobalVariable *GV, - std::string &LinkName) const; - /// EmitExternalGlobal - Emit the external reference to a global variable. /// Should be overridden if an indirect reference should be used. virtual void EmitExternalGlobal(const GlobalVariable *GV); diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 745696cc87..a457421b90 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -509,20 +509,10 @@ void AsmPrinter::EmitXXStructorList(Constant *List) { } } -/// getGlobalLinkName - Returns the asm/link name of of the specified -/// global variable. Should be overridden by each target asm printer to -/// generate the appropriate value. -const std::string &AsmPrinter::getGlobalLinkName(const GlobalVariable *GV, - std::string &LinkName) const { - LinkName += Mang->getMangledName(GV); - return LinkName; -} - /// EmitExternalGlobal - Emit the external reference to a global variable. /// Should be overridden if an indirect reference should be used. void AsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) { - std::string GLN; - O << getGlobalLinkName(GV, GLN); + O << Mang->getMangledName(GV); } diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 577f111ff6..750f3cb4a6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -23,6 +23,7 @@ #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Mangler.h" #include "llvm/Support/Timer.h" #include "llvm/Support/Debug.h" #include "llvm/System/Path.h" @@ -1501,9 +1502,8 @@ void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) { // Add address. DIEBlock *Block = new DIEBlock(); AddUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr); - std::string GLN; AddObjectLabel(Block, 0, dwarf::DW_FORM_udata, - Asm->getGlobalLinkName(DI_GV.getGlobal(), GLN)); + Asm->Mang->getMangledName(DI_GV.getGlobal())); AddBlock(VariableDie, dwarf::DW_AT_location, 0, Block); // Add to map. diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 9efa1eadac..abd2e6fe80 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -872,8 +872,7 @@ void DwarfException::EmitExceptionTable() { PrintRelDirective(); if (GV) { - std::string GLN; - O << Asm->getGlobalLinkName(GV, GLN); + O << Asm->Mang->getMangledName(GV); } else { O << "0x0"; } |