Author: Hongtao Yu Date: 2021-06-09T10:46:03-07:00 New Revision: 64b2fb7967a749b83f59656f0cd2f4d00501efaa
URL: https://github.com/llvm/llvm-project/commit/64b2fb7967a749b83f59656f0cd2f4d00501efaa DIFF: https://github.com/llvm/llvm-project/commit/64b2fb7967a749b83f59656f0cd2f4d00501efaa.diff LOG: [CSSPGO] Emit mangled dwarf names for line tables debug option under -fpseudo-probe-for-profiling Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D103909 Added: clang/test/CodeGen/debug-info-pseudo-probe.cpp Modified: clang/lib/CodeGen/CGDebugInfo.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 1367ef46d85d..080d494a2830 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -3551,6 +3551,7 @@ void CGDebugInfo::collectFunctionDeclProps(GlobalDecl GD, llvm::DIFile *Unit, if (LinkageName == Name || (!CGM.getCodeGenOpts().EmitGcovArcs && !CGM.getCodeGenOpts().EmitGcovNotes && !CGM.getCodeGenOpts().DebugInfoForProfiling && + !CGM.getCodeGenOpts().PseudoProbeForProfiling && DebugKind <= codegenoptions::DebugLineTablesOnly)) LinkageName = StringRef(); diff --git a/clang/test/CodeGen/debug-info-pseudo-probe.cpp b/clang/test/CodeGen/debug-info-pseudo-probe.cpp new file mode 100644 index 000000000000..78a684cd1f39 --- /dev/null +++ b/clang/test/CodeGen/debug-info-pseudo-probe.cpp @@ -0,0 +1,12 @@ +// This test checks if a symbol gets mangled dwarf names with -fpseudo-probe-for-profiling option. +// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -debug-info-kind=line-tables-only -o - < %s | FileCheck %s --check-prefix=PLAIN +// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -debug-info-kind=line-tables-only -fpseudo-probe-for-profiling -o - < %s | FileCheck %s --check-prefix=MANGLE + +int foo() { + return 0; +} + +// PLAIN: define dso_local i32 @_Z3foov() +// PLAIN: distinct !DISubprogram(name: "foo", scope: +// MANGLE: define dso_local i32 @_Z3foov() +// MANGLE: distinct !DISubprogram(name: "foo", linkageName: "_Z3foov" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits