SampleProfile.cpp: Fix take #2. The issue was abuse of StringRef here.

llvm-svn: 203996
This commit is contained in:
NAKAMURA Takumi 2014-03-15 01:56:17 +00:00
parent 98de59157c
commit 6cf7e5d341
1 changed files with 4 additions and 2 deletions

View File

@ -972,8 +972,10 @@ unsigned SampleFunctionProfile::getFunctionLoc(Function &F) {
}
}
Twine Msg = "No debug information found in function " + F.getName();
F.getContext().diagnose(DiagnosticInfoSampleProfile(Msg));
StringRef FnName = F.getName();
Twine Msg = "No debug information found in function " + FnName;
DiagnosticInfoSampleProfile Diag(Msg);
F.getContext().diagnose(Diag);
return 0;
}