From: NAKAMURA Takumi Date: Sat, 15 Mar 2014 00:10:12 +0000 (+0000) Subject: SampleProfile.cpp: Quick fix to r203976 about abuse of Twine. The life of Twine was... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba3fc12d80fac34f165d89a0bc977f1665c85a3b;p=oota-llvm.git SampleProfile.cpp: Quick fix to r203976 about abuse of Twine. The life of Twine was too short. FIXME: DiagnosticInfoSampleProfile should not hold Twine&. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203990 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/SampleProfile.cpp b/lib/Transforms/Scalar/SampleProfile.cpp index f1d6ba0f228..ba8d223c854 100644 --- a/lib/Transforms/Scalar/SampleProfile.cpp +++ b/lib/Transforms/Scalar/SampleProfile.cpp @@ -454,8 +454,7 @@ bool SampleModuleProfile::loadText() { error_code EC = MemoryBuffer::getFile(Filename, Buffer); if (EC) { std::string Msg(EC.message()); - DiagnosticInfoSampleProfile Diag(Filename.data(), Msg); - M.getContext().diagnose(Diag); + M.getContext().diagnose(DiagnosticInfoSampleProfile(Filename.data(), Msg)); return false; } line_iterator LineIt(*Buffer, '#'); @@ -973,9 +972,8 @@ unsigned SampleFunctionProfile::getFunctionLoc(Function &F) { } } - DiagnosticInfoSampleProfile Diag("No debug information found in function " + - F.getName()); - F.getContext().diagnose(Diag); + Twine Msg = "No debug information found in function " + F.getName(); + F.getContext().diagnose(DiagnosticInfoSampleProfile(Msg)); return 0; }