-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[DebugInfo][RemoveDIs] Find types hidden in DbgRecords #106547
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7a084b4
[DebugInfo][RemoveDIs] Find types hidden in DbgRecords
jmorse 1e5a2cd
claaannngggg fooorrmmaatttt
jmorse 515ab3a
Switch to dyn_cast, get Address too
jmorse 791ce77
Add a #dbg_assign to be enumerated
jmorse 90055ba
clang-format again
jmorse 4eaf585
Allow for empty dbg_assign addresses being null
jmorse e2a3fe4
clang-format
jmorse a887cb7
Allow for DIArgLists in the address field of #dbg_assigns
jmorse 0a358b1
The proverbial clang-format
jmorse 792f9b9
Don't access address field on non-dbg-assigns
jmorse 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
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,51 @@ | ||
; RUN: opt --passes=verify %s -o - -S | FileCheck %s | ||
|
||
;; Test that the type definitions are discovered when serialising to LLVM-IR, | ||
;; even if they're only present inside a DbgRecord, and thus not normally | ||
;; visible. | ||
|
||
; CHECK: %union.anon = type { %struct.a } | ||
; CHECK: %struct.a = type { i32 } | ||
; CHECK: %union.anon2 = type { %struct.a2 } | ||
; CHECK: %struct.a2 = type { i32 } | ||
|
||
; ModuleID = 'bbi-98372.ll' | ||
source_filename = "bbi-98372.ll" | ||
|
||
%union.anon = type { %struct.a } | ||
%struct.a = type { i32 } | ||
%union.anon2 = type { %struct.a2 } | ||
%struct.a2 = type { i32 } | ||
|
||
@d = global [1 x { i16, i16 }] [{ i16, i16 } { i16 0, i16 undef }], align 1 | ||
@e = global [1 x { i16, i16 }] [{ i16, i16 } { i16 0, i16 undef }], align 1 | ||
|
||
define void @f() { | ||
entry: | ||
#dbg_value(ptr getelementptr inbounds ([1 x %union.anon], ptr @d, i32 0, i32 3), !7, !DIExpression(), !14) | ||
#dbg_assign(ptr null, !7, !DIExpression(), !16, ptr getelementptr inbounds ([1 x %union.anon2], ptr @e, i32 0, i32 3), !17, !14) | ||
ret void, !dbg !15 | ||
} | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.module.flags = !{!2, !3, !4, !5} | ||
!llvm.ident = !{!6} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) | ||
!1 = !DIFile(filename: "foo.c", directory: "/bar") | ||
!2 = !{i32 7, !"Dwarf Version", i32 4} | ||
!3 = !{i32 2, !"Debug Info Version", i32 3} | ||
!4 = !{i32 1, !"wchar_size", i32 1} | ||
!5 = !{i32 7, !"frame-pointer", i32 2} | ||
!6 = !{!"clang"} | ||
!7 = !DILocalVariable(name: "f", scope: !8, file: !1, line: 8, type: !12) | ||
!8 = distinct !DISubprogram(name: "e", scope: !1, file: !1, line: 8, type: !9, scopeLine: 8, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11) | ||
!9 = !DISubroutineType(types: !10) | ||
!10 = !{null} | ||
!11 = !{!7} | ||
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 16) | ||
!13 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) | ||
!14 = !DILocation(line: 0, scope: !8) | ||
!15 = !DILocation(line: 8, column: 28, scope: !8) | ||
!16 = distinct !DIAssignID() | ||
!17 = !DIExpression() |
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.
possibly worth adding dbg_assign and dbg_declare for completeness? (dbg_assign more important here imo, given the extra fields)