diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-10-17 17:17:24 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-10-17 17:17:24 +0000 |
commit | d24b913a613b7f6be2c04716bbbe8e58e61f793e (patch) | |
tree | 0ab1560a2bdeefbc6b6fcbd0fef9e21844317b05 /llvm | |
parent | 56c9d2597e3eae920f1727ace1bfe3ffa5d57444 (diff) | |
download | bcm5719-llvm-d24b913a613b7f6be2c04716bbbe8e58e61f793e.tar.gz bcm5719-llvm-d24b913a613b7f6be2c04716bbbe8e58e61f793e.zip |
Clean up interface to getGlobalLinkName.
llvm-svn: 31001
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/CodeGen/AsmPrinter.h | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/DwarfWriter.cpp | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index 8f73ce7f6c8..68ca2d0e32a 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -103,8 +103,7 @@ namespace llvm { /// 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 void getGlobalLinkName(const GlobalVariable *GV, - std::string &LinkName); + virtual const std::string getGlobalLinkName(const GlobalVariable *GV) const; protected: /// doInitialization - Set up the AsmPrinter when we are working on a new diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index e9542fc6c13..90d77adfb3e 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -352,11 +352,12 @@ unsigned AsmPrinter::getPreferredAlignmentLog(const GlobalVariable *GV) const { /// 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. -void AsmPrinter::getGlobalLinkName(const GlobalVariable *GV, - std::string &LinkName) { +const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{ + std::string LinkName; // Default action is to use a global symbol. LinkName = TAI->getGlobalPrefix(); LinkName += GV->getName(); + return LinkName; } // EmitAlignment - Emit an alignment directive to the specified power of two. diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp index 1c52c5bf5d1..1d08d07a8a3 100644 --- a/llvm/lib/CodeGen/DwarfWriter.cpp +++ b/llvm/lib/CodeGen/DwarfWriter.cpp @@ -1634,8 +1634,7 @@ DIE *DwarfWriter::NewGlobalVariable(GlobalVariableDesc *GVD) { AddSourceLine(VariableDie, UnitDesc, GVD->getLine()); // Work up linkage name. - std::string LinkageName; - Asm->getGlobalLinkName(GV, LinkageName); + const std::string LinkageName = Asm->getGlobalLinkName(GV); // Add address. DIEBlock *Block = new DIEBlock(); |