Don't pass back a reference to a temporary.
authorBill Wendling <isanbard@gmail.com>
Tue, 18 Sep 2007 09:10:16 +0000 (09:10 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 18 Sep 2007 09:10:16 +0000 (09:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42086 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter.cpp

index 31fb0f43e2c36be08e4693ba616d4f60c427b5c9..4a312a79a282271ca08cab775a59c60724956ebc 100644 (file)
@@ -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
index 7b579c4ea303af7b39f29588e12d74699665ad53..6622bcdee669e8ef605777b770713ce7b32e6633 100644 (file)
@@ -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());