summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index 47250cccc4d..51e95a5887a 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -380,9 +380,9 @@ bool SampleProfileLoader::computeBlockWeights(Function &F) {
if (SampleProfileCoverage) {
unsigned Coverage = CoverageTracker.computeCoverage(Samples);
if (Coverage < SampleProfileCoverage) {
- const char *Filename = getDISubprogram(&F)->getFilename().str().c_str();
+ StringRef Filename = getDISubprogram(&F)->getFilename();
F.getContext().diagnose(DiagnosticInfoSampleProfile(
- Filename, getFunctionLoc(F),
+ Filename.str().c_str(), getFunctionLoc(F),
Twine(CoverageTracker.getNumUsedSamples(Samples)) + " of " +
Twine(Samples->getBodySamples().size()) +
" available profile records (" + Twine(Coverage) +
OpenPOWER on IntegriCloud