SampleProfile.cpp: Quick fix to r203976 about abuse of Twine. The life of Twine was too short.

FIXME: DiagnosticInfoSampleProfile should not hold Twine&.
llvm-svn: 203990
This commit is contained in:
NAKAMURA Takumi 2014-03-15 00:10:12 +00:00
parent ea330fbe49
commit bfb172897e
1 changed files with 3 additions and 5 deletions

View File

@ -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;
}