summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-16 00:08:41 +0000
committerChris Lattner <sabre@nondot.org>2009-09-16 00:08:41 +0000
commitdd5a9890344d52e0b93af4bbc4c0002d9dfc70d4 (patch)
treeb0ed6e6afb4806078ea0fae4b44490e12ad8e230 /llvm/lib/CodeGen/AsmPrinter
parent3045f9e57b917ea955e45c40855abf590c47bba5 (diff)
downloadbcm5719-llvm-dd5a9890344d52e0b93af4bbc4c0002d9dfc70d4.tar.gz
bcm5719-llvm-dd5a9890344d52e0b93af4bbc4c0002d9dfc70d4.zip
eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
it into all of its call sites and simplifying them. llvm-svn: 81962
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp12
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp3
3 files changed, 4 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 745696cc879..a457421b907 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 577f111ff60..750f3cb4a6a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 9efa1eadac7..abd2e6fe80d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/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";
}
OpenPOWER on IntegriCloud