[llvm] r203996 - SampleProfile.cpp: Fix take #2. The issue was abuse of StringRef here.

NAKAMURA Takumi geek4civic at gmail.com
Fri Mar 14 18:56:17 PDT 2014


Author: chapuni
Date: Fri Mar 14 20:56:17 2014
New Revision: 203996

URL: http://llvm.org/viewvc/llvm-project?rev=203996&view=rev
Log:
SampleProfile.cpp: Fix take #2. The issue was abuse of StringRef here.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp?rev=203996&r1=203995&r2=203996&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp Fri Mar 14 20:56:17 2014
@@ -972,8 +972,10 @@ unsigned SampleFunctionProfile::getFunct
     }
   }
 
-  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;
 }
 





More information about the llvm-commits mailing list