-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm][DebugInfo] Drop \01 mangling prefix when inserting linkage name into accelerator table #138852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Michael137
merged 3 commits into
llvm:main
from
Michael137:llvm/mangling-escape-in-index
May 12, 2025
Merged
[llvm][DebugInfo] Drop \01 mangling prefix when inserting linkage name into accelerator table #138852
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
; Tests the mangling escape prefix gets stripped from the linkage name. | ||
; | ||
; RUN: %llc_dwarf -accel-tables=Dwarf -dwarf-linkage-names=All -filetype=obj -o %t < %s | ||
; | ||
; RUN: llvm-dwarfdump -debug-info -debug-names %t | FileCheck %s | ||
; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s | ||
|
||
; CHECK: .debug_info contents: | ||
; CHECK: DW_AT_linkage_name ("bar") | ||
; CHECK: .debug_names contents: | ||
; CHECK: String: {{.*}} "bar" | ||
|
||
; VERIFY: No errors. | ||
|
||
; Input generated from the following C++ code using | ||
; clang -g -S -emit-llvm -target aarch64-apple-macos | ||
|
||
; void foo() asm("bar"); | ||
; void foo() {} | ||
; | ||
; void g() { foo(); } | ||
|
||
define void @"\01bar"() !dbg !9 { | ||
entry: | ||
ret void, !dbg !13 | ||
} | ||
|
||
define void @_Z1gv() !dbg !14 { | ||
entry: | ||
call void @"\01bar"(), !dbg !15 | ||
ret void, !dbg !16 | ||
} | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.module.flags = !{!2, !3, !4, !5, !6, !7} | ||
!llvm.ident = !{!8} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 21.0.0git", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/") | ||
!1 = !DIFile(filename: "asm.cpp", directory: "/tmp", checksumkind: CSK_MD5, checksum: "d053f9249cc5548d446ceb58411ad625") | ||
!2 = !{i32 7, !"Dwarf Version", i32 5} | ||
!3 = !{i32 2, !"Debug Info Version", i32 3} | ||
!4 = !{i32 1, !"wchar_size", i32 4} | ||
!5 = !{i32 8, !"PIC Level", i32 2} | ||
!6 = !{i32 7, !"uwtable", i32 1} | ||
!7 = !{i32 7, !"frame-pointer", i32 1} | ||
!8 = !{!"clang version 21.0.0git"} | ||
!9 = distinct !DISubprogram(name: "foo", linkageName: "\01bar", scope: !10, file: !10, line: 2, type: !11, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0) | ||
!10 = !DIFile(filename: "asm.cpp", directory: "/tmp", checksumkind: CSK_MD5, checksum: "d053f9249cc5548d446ceb58411ad625") | ||
!11 = !DISubroutineType(types: !12) | ||
!12 = !{null} | ||
!13 = !DILocation(line: 2, column: 13, scope: !9) | ||
!14 = distinct !DISubprogram(name: "g", linkageName: "_Z1gv", scope: !10, file: !10, line: 4, type: !11, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0) | ||
!15 = !DILocation(line: 4, column: 12, scope: !14) | ||
!16 = !DILocation(line: 4, column: 19, scope: !14) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Michael137 mostly asking for myself, but is there a reason we check for
""
instead of empty?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope no reason in particular. This is the way the code was prior to my changes, so wanted to keep the diff as small as possible