8000 Merge pull request #842 from adrian-prantl/59756060-5.2 · swiftlang/llvm-project@88fa80e · GitHub
[go: up one dir, main page]

Skip to content

Commit 88fa80e

Browse files
Merge pull request #842 from adrian-prantl/59756060-5.2
Visit previously unreachable nodes in the debug info metadata verifier.
2 parents 3e0c2c8 + c462a6a commit 88fa80e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,7 @@ void Verifier::visitFunction(const Function &F) {
23702370
AssertDI(SP->describes(&F),
23712371
"!dbg attachment points at wrong subprogram for function", N, &F,
23722372
&I, DL, Scope, SP);
2373+
visitMDNode(*SP);
23732374
};
23742375
for (auto &BB : F)
23752376
for (auto &I : BB) {

llvm/test/Verifier/llvm.loop.cu.ll

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; RUN: llvm-as -disable-output < %s -o /dev/null 2>&1 | FileCheck %s
2+
3+
define void @f() #0 !dbg !6 {
4+
br label %1, !dbg !9, !llvm.loop !10
5+
ret void
6+
}
7+
8+
!llvm.dbg.cu = !{!0}
9+
!llvm.module.flags = !{!2, !3, !4}
10+
11+
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
12+
!1 = !DIFile(filename: "f.c", directory: "./")
13+
!2 = !{i32 2, !"Dwarf Version", i32 4}
14+
!3 = !{i32 2, !"Debug Info Version", i32 3}
15+
!4 = !{i32 7, !"PIC Level", i32 2}
16+
!6 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
17+
!7 = !DISubroutineType(types: !8)
18+
!8 = !{}
19+
!9 = !DILocation(line: 18, column: 2, scope: !6)
20+
!10 = distinct !{!10, !11}
21+
!11 = !DILocation(line: 18, column: 2, scope: !12)
22+
!12 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !13)
23+
24+
; CHECK: warning: ignoring invalid debug info
25+
; This CU isn't listed in llvm.dbg.cu
26+
!13 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)

0 commit comments

Comments
 (0)
0