From e8c885f261a47684ec144aed70013e3ac1653083 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 18 Sep 2007 09:10:16 +0000 Subject: [PATCH] Don't pass back a reference to a temporary. llvm-svn: 42086 --- llvm/include/llvm/CodeGen/AsmPrinter.h | 2 +- llvm/lib/CodeGen/AsmPrinter.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index 31fb0f43e2c3..4a312a79a282 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 7b579c4ea303..6622bcdee669 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/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());