From: Bill Wendling Date: Tue, 18 Sep 2007 09:10:16 +0000 (+0000) Subject: Don't pass back a reference to a temporary. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;ds=sidebyside;h=ce613280f987584df15ada06c5cf4809b203da46;p=oota-llvm.git Don't pass back a reference to a temporary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42086 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 31fb0f43e2c..4a312a79a28 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -115,7 +115,7 @@ namespace llvm { /// getCurrentFunctionEHName - Called to return (and cache) the /// CurrentFnEHName. /// - const std::string &getCurrentFunctionEHName(const MachineFunction *MF); + std::string getCurrentFunctionEHName(const MachineFunction *MF); protected: /// doInitialization - Set up the AsmPrinter when we are working on a new diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 7b579c4ea30..6622bcdee66 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -160,8 +160,7 @@ bool AsmPrinter::doFinalization(Module &M) { return false; } -const std::string & -AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) { +std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) { assert(MF && "No machine function?"); return Mang->makeNameProper(MF->getFunction()->getName() + ".eh", TAI->getGlobalPrefix());