Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit ba3fc12

Browse files
committed
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
1 parent 2345166 commit ba3fc12

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Transforms/Scalar/SampleProfile.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ bool SampleModuleProfile::loadText() {
454454
error_code EC = MemoryBuffer::getFile(Filename, Buffer);
455455
if (EC) {
456456
std::string Msg(EC.message());
457-
DiagnosticInfoSampleProfile Diag(Filename.data(), Msg);
458-
M.getContext().diagnose(Diag);
457+
M.getContext().diagnose(DiagnosticInfoSampleProfile(Filename.data(), Msg));
459458
return false;
460459
}
461460
line_iterator LineIt(*Buffer, '#');
@@ -973,9 +972,8 @@ unsigned SampleFunctionProfile::getFunctionLoc(Function &F) {
973972
}
974973
}
975974

976-
DiagnosticInfoSampleProfile Diag("No debug information found in function " +
977-
F.getName());
978-
F.getContext().diagnose(Diag);
975+
Twine Msg = "No debug information found in function " + F.getName();
976+
F.getContext().diagnose(DiagnosticInfoSampleProfile(Msg));
979977
return 0;
980978
}
981979

0 commit comments

Comments
 (0)