diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-03-15 00:10:12 +0000 |
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-03-15 00:10:12 +0000 |
| commit | bfb172897ed0ae246babb62dd93f030e1dee5558 (patch) | |
| tree | 3e667492a91f858082862f84f2fa914aabd94cb6 /llvm/lib | |
| parent | ea330fbe491f8b2df520bf8e1d0601f4a06ff69b (diff) | |
| download | bcm5719-llvm-bfb172897ed0ae246babb62dd93f030e1dee5558.tar.gz bcm5719-llvm-bfb172897ed0ae246babb62dd93f030e1dee5558.zip | |
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
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SampleProfile.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/SampleProfile.cpp b/llvm/lib/Transforms/Scalar/SampleProfile.cpp index f1d6ba0f228..ba8d223c854 100644 --- a/llvm/lib/Transforms/Scalar/SampleProfile.cpp +++ b/llvm/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; } |

