[llvm] r286482 - [OptDiag] Remove non-printable chars from function name

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 09:47:04 PST 2016


Author: anemet
Date: Thu Nov 10 11:47:03 2016
New Revision: 286482

URL: http://llvm.org/viewvc/llvm-project?rev=286482&view=rev
Log:
[OptDiag] Remove non-printable chars from function name

The r283656 did this in the remark arguments.  We also need to do this
in the main function attribute as that is written to YAML as well.

Modified:
    llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp
    llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll

Modified: llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp?rev=286482&r1=286481&r2=286482&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/OptimizationDiagnosticInfo.cpp Thu Nov 10 11:47:03 2016
@@ -80,7 +80,8 @@ template <> struct MappingTraits<Diagnos
 
     // These are read-only for now.
     DebugLoc DL = OptDiag->getDebugLoc();
-    StringRef FN = OptDiag->getFunction().getName();
+    StringRef FN = GlobalValue::getRealLinkageName(
+        OptDiag->getFunction().getName());
 
     StringRef PassName(OptDiag->PassName);
     io.mapRequired("Pass", PassName);

Modified: llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll?rev=286482&r1=286481&r2=286482&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll (original)
+++ llvm/trunk/test/Transforms/Inline/optimization-remarks-yaml.ll Thu Nov 10 11:47:03 2016
@@ -49,7 +49,7 @@ target datalayout = "e-m:o-i64:64-f80:12
 target triple = "x86_64-apple-macosx10.11.0"
 
 ; Function Attrs: nounwind ssp uwtable
-define i32 @baz() !dbg !7 !prof !14 {
+define i32 @"\01baz"() !dbg !7 !prof !14 {
 entry:
   %call = call i32 (...) @foo(), !dbg !9
   %call1 = call i32 (...) @"\01bar"(), !dbg !10




More information about the llvm-commits mailing list