[llvm] r203990 - SampleProfile.cpp: Quick fix to r203976 about abuse of Twine. The life of Twine was too short.
NAKAMURA Takumi
geek4civic at gmail.com
Fri Mar 14 17:10:12 PDT 2014
Author: chapuni
Date: Fri Mar 14 19:10:12 2014
New Revision: 203990
URL: http://llvm.org/viewvc/llvm-project?rev=203990&view=rev
Log:
SampleProfile.cpp: Quick fix to r203976 about abuse of Twine. The life of Twine was too short.
FIXME: DiagnosticInfoSampleProfile should not hold Twine&.
Modified:
llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp?rev=203990&r1=203989&r2=203990&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp Fri Mar 14 19:10:12 2014
@@ -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::getFunct
}
}
- 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;
}
More information about the llvm-commits
mailing list