From f8a50d283f9c5a26cc9b4cb17d93d6a2944edcea Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 10 Nov 2016 17:47:03 +0000 Subject: [PATCH] [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. llvm-svn: 286482 --- lib/Analysis/OptimizationDiagnosticInfo.cpp | 3 ++- test/Transforms/Inline/optimization-remarks-yaml.ll | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/OptimizationDiagnosticInfo.cpp b/lib/Analysis/OptimizationDiagnosticInfo.cpp index 0a5ef1b9b23..da1173b283f 100644 --- a/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ b/lib/Analysis/OptimizationDiagnosticInfo.cpp @@ -80,7 +80,8 @@ template <> struct MappingTraits { // 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); diff --git a/test/Transforms/Inline/optimization-remarks-yaml.ll b/test/Transforms/Inline/optimization-remarks-yaml.ll index cfdd3e657a9..532e443e217 100644 --- a/test/Transforms/Inline/optimization-remarks-yaml.ll +++ b/test/Transforms/Inline/optimization-remarks-yaml.ll @@ -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