Skip to content

Commit 64b2fb7

Browse files
committed
[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
1 parent 8908903 commit 64b2fb7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3551,6 +3551,7 @@ void CGDebugInfo::collectFunctionDeclProps(GlobalDecl GD, llvm::DIFile *Unit,
35513551
if (LinkageName == Name || (!CGM.getCodeGenOpts().EmitGcovArcs &&
35523552
!CGM.getCodeGenOpts().EmitGcovNotes &&
35533553
!CGM.getCodeGenOpts().DebugInfoForProfiling &&
3554+
!CGM.getCodeGenOpts().PseudoProbeForProfiling &&
35543555
DebugKind <= codegenoptions::DebugLineTablesOnly))
35553556
LinkageName = StringRef();
35563557

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This test checks if a symbol gets mangled dwarf names with -fpseudo-probe-for-profiling option.
2+
// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -debug-info-kind=line-tables-only -o - < %s | FileCheck %s --check-prefix=PLAIN
3+
// 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
4+
5+
int foo() {
6+
return 0;
7+
}
8+
9+
// PLAIN: define dso_local i32 @_Z3foov()
10+
// PLAIN: distinct !DISubprogram(name: "foo", scope:
11+
// MANGLE: define dso_local i32 @_Z3foov()
12+
// MANGLE: distinct !DISubprogram(name: "foo", linkageName: "_Z3foov"

0 commit comments

Comments
 (0)