]> granicus.if.org Git - llvm/commitdiff
[OptDiag] Remove non-printable chars from function name
authorAdam Nemet <anemet@apple.com>
Thu, 10 Nov 2016 17:47:03 +0000 (17:47 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 10 Nov 2016 17:47:03 +0000 (17:47 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286482 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/OptimizationDiagnosticInfo.cpp
test/Transforms/Inline/optimization-remarks-yaml.ll

index 0a5ef1b9b237dbc486279ab06c6c842fb4d3ed06..da1173b283ff5688d0f5e901bbd4760d27f62148 100644 (file)
@@ -80,7 +80,8 @@ template <> struct MappingTraits<DiagnosticInfoOptimizationBase *> {
 
     // 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);
index cfdd3e657a9fd6b8b1a44411a63f13a99b374a74..532e443e2170bd7fda17898ecdd17e2be0fbcef0 100644 (file)
@@ -49,7 +49,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 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