diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-04-10 00:12:49 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-04-10 00:12:49 +0000 |
commit | 992f846dc7d98f4135a0ccc852c95a36c1d9e0df (patch) | |
tree | 27ea90fa07bead56a79d88d907184eb286ed2620 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 40f4ee74fdc904dd469db8fd66eb07e33e06eb45 (diff) | |
download | bcm5719-llvm-992f846dc7d98f4135a0ccc852c95a36c1d9e0df.tar.gz bcm5719-llvm-992f846dc7d98f4135a0ccc852c95a36c1d9e0df.zip |
Pass in the std::string parameter instead of returning it by value.
llvm-svn: 68747
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index c9fd1ac60ac..d19e9afaf02 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -186,11 +186,8 @@ bool AsmPrinter::doFinalization(Module &M) { SwitchToDataSection(""); for (std::set<const GlobalValue*>::iterator i = ExtWeakSymbols.begin(), - e = ExtWeakSymbols.end(); i != e; ++i) { - const GlobalValue *GV = *i; - std::string Name = Mang->getValueName(GV); - O << TAI->getWeakRefDirective() << Name << '\n'; - } + e = ExtWeakSymbols.end(); i != e; ++i) + O << TAI->getWeakRefDirective() << Mang->getValueName(*i) << '\n'; } if (TAI->getSetDirective()) { @@ -236,14 +233,16 @@ bool AsmPrinter::doFinalization(Module &M) { return false; } -std::string -AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) const { +const std::string & +AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF, + std::string &Name) const { assert(MF && "No machine function?"); - std::string Name = MF->getFunction()->getName(); + Name = MF->getFunction()->getName(); if (Name.empty()) Name = Mang->getValueName(MF->getFunction()); - return Mang->makeNameProper(TAI->getEHGlobalPrefix() + + Name = Mang->makeNameProper(TAI->getEHGlobalPrefix() + Name + ".eh", TAI->getGlobalPrefix()); + return Name; } void AsmPrinter::SetupMachineFunction(MachineFunction &MF) { @@ -536,9 +535,8 @@ 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) const{ - std::string LinkName; - +const std::string &AsmPrinter::getGlobalLinkName(const GlobalVariable *GV, + std::string &LinkName) const { if (isa<Function>(GV)) { LinkName += TAI->getFunctionAddrPrefix(); LinkName += Mang->getValueName(GV); @@ -555,7 +553,8 @@ const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{ /// 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) { - O << getGlobalLinkName(GV); + std::string GLN; + O << getGlobalLinkName(GV, GLN); } |