[DebugInfo] Verify DISubprogram has a type (#194556)

Require DISubprogram metadata to carry a non-null type in the verifier.

LangRef specifies that the `type:` field of `DISubprogram` points to a
`DISubroutineType`. This patch diagnoses malformed debug info where the
field is omitted or resolves to null, while preserving the existing wrong-type
diagnostic for non-DISubroutineType operands.

Update hand-written LLVM IR tests to use valid DISubprogram metadata
where they are not intentionally testing malformed debug info. These tests now 
use minimal DISubroutineType metadata so the new verifier check does not mask 
their original coverage.

Fixes #186557
This commit is contained in:
Jiang Ning 2026-05-04 18:32:19 +08:00 committed by GitHub
parent 15383dcdb4
commit 81518d06ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
114 changed files with 667 additions and 357 deletions

View file

@ -30,7 +30,9 @@ entry:
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
!1 = !DIFile(filename: "test.c", directory: "")
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, unit: !0)
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !14, unit: !0)
!9 = !{i32 2, !"Dwarf Version", i32 4}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !DILocation(line: 2, column: 20, scope: !4)
!14 = !DISubroutineType(types: !15)
!15 = !{null}

View file

@ -1657,8 +1657,9 @@ void Verifier::visitDISubprogram(const DISubprogram &N) {
CheckDI(isa<DIFile>(F), "invalid file", &N, F);
else
CheckDI(N.getLine() == 0, "line specified with no file", &N, N.getLine());
if (auto *T = N.getRawType())
CheckDI(isa<DISubroutineType>(T), "invalid subroutine type", &N, T);
auto *T = N.getRawType();
CheckDI(T, "DISubprogram requires a non-null type", &N);
CheckDI(isa<DISubroutineType>(T), "invalid subroutine type", &N, T);
CheckDI(isType(N.getRawContainingType()), "invalid containing type", &N,
N.getRawContainingType());
if (auto *Params = N.getRawTemplateParams())

View file

@ -26,9 +26,11 @@ exit:
!llvm.module.flags = !{!5, !6, !7}
!0 = !DIFile(filename: "negative_step.c", directory: "/")
!1 = distinct !DISubprogram(name: "negative_step", scope: !0, file: !0, unit: !4)
!1 = distinct !DISubprogram(name: "negative_step", scope: !0, file: !0, type: !8, unit: !4)
!2 = !DILocation(line: 5, column: 2, scope: !1)
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !0, producer: "clang")
!5 = !{i32 1, !"Debug Info Version", i32 3}
!6 = !{i32 2, !"Dwarf Version", i32 2}
!7 = !{i32 1, !"PIC Level", i32 2}
!8 = !DISubroutineType(types: !9)
!9 = !{null}

View file

@ -16,39 +16,43 @@
; CHECK-NEXT: !3 = !DICompositeType(tag: DW_TAG_structure_type, name: "has-uuid",{{.*}}, identifier: "uuid")
; CHECK-NEXT: !4 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !3, file: !1
; CHECK-NEXT: !5 = !DIDerivedType(tag: DW_TAG_member, name: "field2", scope: !3, file: !1
; CHECK-NEXT: !6 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !1
; CHECK-NEXT: !7 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !3, file: !1
; CHECK-NEXT: !6 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !1, type: !7, spFlags: 0)
; CHECK-NEXT: !7 = !DISubroutineType(types: !8)
; CHECK-NEXT: !8 = !{null}
; CHECK-NEXT: !9 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !3, file: !1, type: !7, spFlags: 0)
!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "has-uuid", file: !1, line: 2, size: 64, align: 32, identifier: "uuid")
!4 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !3, file: !1, line: 4, baseType: !0, size: 32, align: 32, offset: 32)
!5 = !DIDerivedType(tag: DW_TAG_member, name: "field2", scope: !3, file: !1, line: 4, baseType: !0, size: 32, align: 32, offset: 32)
!6 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !1, isDefinition: false)
!7 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !3, file: !1, isDefinition: false)
!6 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !1, isDefinition: false, type: !18)
!7 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !3, file: !1, isDefinition: false, type: !18)
!18 = !DISubroutineType(types: !19)
!19 = !{null}
; Define an un-identified type with fields and functions.
; CHECK-NEXT: !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "no-uuid", file: !1
; CHECK-NEXT: !9 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !8, file: !1
; CHECK-NEXT: !10 = !DIDerivedType(tag: DW_TAG_member, name: "field2", scope: !8, file: !1
; CHECK-NEXT: !11 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !8, file: !1
; CHECK-NEXT: !12 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !8, file: !1
; CHECK-NEXT: !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "no-uuid", file: !1
; CHECK-NEXT: !11 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !10, file: !1
; CHECK-NEXT: !12 = !DIDerivedType(tag: DW_TAG_member, name: "field2", scope: !10, file: !1
; CHECK-NEXT: !13 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !10, file: !1, type: !7, spFlags: 0)
; CHECK-NEXT: !14 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !10, file: !1, type: !7, spFlags: 0)
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "no-uuid", file: !1, line: 2, size: 64, align: 32)
!9 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !8, file: !1, line: 4, baseType: !0, size: 32, align: 32, offset: 32)
!10 = !DIDerivedType(tag: DW_TAG_member, name: "field2", scope: !8, file: !1, line: 4, baseType: !0, size: 32, align: 32, offset: 32)
!11 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !8, file: !1, isDefinition: false)
!12 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !8, file: !1, isDefinition: false)
!11 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !8, file: !1, isDefinition: false, type: !18)
!12 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !8, file: !1, isDefinition: false, type: !18)
; Add duplicate fields and members of "no-uuid" in a different file. These
; should stick around, since "no-uuid" does not have an "identifier:" field.
; CHECK-NEXT: !13 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !8, file: !2,
; CHECK-NEXT: !14 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !8, file: !2,
; CHECK-NEXT: !15 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !10, file: !2,
; CHECK-NEXT: !16 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !10, file: !2, type: !7, spFlags: 0)
!13 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !8, file: !2, line: 4, baseType: !0, size: 32, align: 32, offset: 32)
!14 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !8, file: !2, isDefinition: false)
!14 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !8, file: !2, isDefinition: false, type: !18)
; Add duplicate fields and members of "has-uuid" in a different file. These
; should be merged.
!15 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !3, file: !2, line: 4, baseType: !0, size: 32, align: 32, offset: 32)
!16 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !2, isDefinition: false)
!16 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !2, isDefinition: false, type: !18)
; CHECK-NEXT: !15 = !{!4, !6}
; CHECK-NEXT: !17 = !{!4, !6}
; CHECK-NOT: !DIDerivedType
; CHECK-NOT: !DISubprogram
!17 = !{!15, !16}

View file

@ -1,28 +1,34 @@
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
; CHECK: !named = !{!0, !3, !4, !5, !5}
; CHECK: !named = !{!0, !5, !6, !7, !7}
!named = !{!0, !3, !4, !5, !6}
!llvm.module.flags = !{!7}
!llvm.dbg.cu = !{!1}
; CHECK: !0 = distinct !DISubprogram({{.*}})
!0 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !1)
; CHECK: !0 = distinct !DISubprogram({{.*}}, type: !1{{.*}})
!0 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !1, type: !8)
!8 = !DISubroutineType(types: !9)
!9 = !{null}
!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !2,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2)
!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
; CHECK: !3 = !DICompositeType({{.*}})
; CHECK: !1 = !DISubroutineType(types: !2)
; CHECK: !2 = !{null}
; CHECK: !3 = distinct !DICompileUnit
; CHECK: !4 = !DIFile
; CHECK: !5 = !DICompositeType({{.*}})
!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 32, align: 32)
; CHECK-NEXT: !4 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, entity: !1, file: !2, line: 7)
; CHECK-NEXT: !6 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, entity: !3, file: !4, line: 7)
!4 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0,
entity: !1, file: !2, line: 7)
; CHECK-NEXT: !5 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
; CHECK-NEXT: !7 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
!5 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0)
!6 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "", scope: !0, entity: null,
line: 0)

View file

@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
; CHECK: !named = !{!0, !1, !2, !3, !4, !4, !5, !6, !7, !7, !8}
; CHECK: !named = !{!0, !1, !2, !5, !6, !6, !7, !8, !9, !9, !10}
!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10}
!llvm.module.flags = !{!11}
@ -12,21 +12,23 @@
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2)
!1 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
!2 = distinct !DISubprogram(name: "foo", scope: !1, unit: !0)
!2 = distinct !DISubprogram(name: "foo", scope: !1, unit: !0, type: !12)
!12 = !DISubroutineType(types: !13)
!13 = !{null}
; CHECK: !3 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35)
; CHECK: !5 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35)
!3 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35)
; CHECK: !4 = !DILexicalBlock(scope: !2)
; CHECK: !6 = !DILexicalBlock(scope: !2)
!4 = !DILexicalBlock(scope: !2)
!5 = !DILexicalBlock(scope: !2, file: null, line: 0, column: 0)
; CHECK: !5 = !DILexicalBlockFile(scope: !3, file: !1, discriminator: 0)
; CHECK: !6 = !DILexicalBlockFile(scope: !3, file: !1, discriminator: 1)
; CHECK: !7 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 0)
; CHECK: !8 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 1)
!6 = !DILexicalBlockFile(scope: !3, file: !1, discriminator: 0)
!7 = !DILexicalBlockFile(scope: !3, file: !1, discriminator: 1)
; CHECK: !7 = !DILexicalBlockFile(scope: !3, discriminator: 7)
; CHECK: !9 = !DILexicalBlockFile(scope: !5, discriminator: 7)
!8 = !DILexicalBlockFile(scope: !3, discriminator: 7)
!9 = !DILexicalBlockFile(scope: !3, file: null, discriminator: 7)
!10 = distinct !{}

View file

@ -1,20 +1,22 @@
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
; CHECK: !named = !{!0, !3}
; CHECK: !named = !{!0, !5}
!named = !{!0, !3}
!llvm.module.flags = !{!4}
!llvm.dbg.cu = !{!1}
!0 = distinct !DISubprogram(unit: !1)
!0 = distinct !DISubprogram(unit: !1, type: !5)
!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !2,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2)
!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
; CHECK: !3 = !DILocalVariable(name: "foo", arg: 65535, scope: !0)
; CHECK: !5 = !DILocalVariable(name: "foo", arg: 65535, scope: !0)
!3 = !DILocalVariable(name: "foo", arg: 65535, scope: !0)
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !DISubroutineType(types: !6)
!6 = !{null}

View file

@ -3,13 +3,13 @@
@foo = global i32 0
; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
; CHECK: !named = !{!0, !3, !4, !5, !6, !7, !8, !9, !10, !11}
!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9}
!llvm.module.flags = !{!10}
!llvm.dbg.cu = !{!1}
!0 = distinct !DISubprogram(unit: !1)
!0 = distinct !DISubprogram(unit: !1, type: !11)
!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !2,
isOptimized: true, flags: "-O2",
@ -18,18 +18,20 @@
!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!4 = !DILocation(scope: !0)
; CHECK: !5 = !DILocalVariable(name: "foo", arg: 3, scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial, align: 32)
; CHECK: !6 = !DILocalVariable(name: "foo", scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)
; CHECK: !7 = !DILocalVariable(name: "foo", arg: 3, scope: !0, file: !4, line: 7, type: !5, flags: DIFlagArtificial, align: 32)
; CHECK: !8 = !DILocalVariable(name: "foo", scope: !0, file: !4, line: 7, type: !5, flags: DIFlagArtificial)
!5 = !DILocalVariable(name: "foo", arg: 3,
scope: !0, file: !2, line: 7, type: !3,
flags: DIFlagArtificial, align: 32)
!6 = !DILocalVariable(name: "foo", scope: !0,
file: !2, line: 7, type: !3, flags: DIFlagArtificial)
; CHECK: !7 = !DILocalVariable(arg: 1, scope: !0)
; CHECK: !8 = !DILocalVariable(scope: !0)
; CHECK: !9 = !DILocalVariable(arg: 1, scope: !0)
; CHECK: !10 = !DILocalVariable(scope: !0)
!7 = !DILocalVariable(scope: !0, arg: 1)
!8 = !DILocalVariable(scope: !0)
!9 = distinct !{}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = !DISubroutineType(types: !12)
!12 = !{null}

View file

@ -1,40 +1,44 @@
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
; CHECK: !named = !{!0, !2, !3, !3, !4, !4, !5, !5, !6, !7, !8}
; CHECK: !named = !{!0, !4, !5, !5, !6, !6, !7, !7, !8, !9, !10}
!named = !{!0, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11}
!llvm.module.flags = !{!12}
!llvm.dbg.cu = !{!1}
; CHECK: !0 = distinct !DISubprogram(
!0 = distinct !DISubprogram(unit: !1)
; CHECK: !1 = distinct !DICompileUnit
; CHECK: !0 = distinct !DISubprogram(scope: null, type: !1, spFlags: DISPFlagDefinition, unit: !3)
!0 = distinct !DISubprogram(unit: !1, type: !13)
; CHECK: !1 = !DISubroutineType(types: !2)
; CHECK: !2 = !{null}
; CHECK: !3 = distinct !DICompileUnit
!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !2,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2)
; CHECK: !2 = !DIFile
; CHECK: !4 = !DIFile
!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
; CHECK-NEXT: !3 = !DILocation(line: 3, column: 7, scope: !0)
; CHECK: !5 = !DILocation(line: 3, column: 7, scope: !0)
!3 = !DILocation(line: 3, column: 7, scope: !0)
!4 = !DILocation(scope: !0, column: 7, line: 3)
; CHECK-NEXT: !4 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !3)
; CHECK: !6 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !5)
!5 = !DILocation(scope: !0, inlinedAt: !3, column: 7, line: 3)
!6 = !DILocation(column: 7, line: 3, scope: !0, inlinedAt: !3)
; CHECK-NEXT: !5 = !DILocation(line: 0, scope: !0)
; CHECK: !7 = !DILocation(line: 0, scope: !0)
!7 = !DILocation(scope: !0)
!8 = !DILocation(scope: !0, column: 0, line: 0)
; CHECK-NEXT: !6 = !DILocation(line: 4294967295, column: 65535, scope: !0)
; CHECK: !8 = !DILocation(line: 4294967295, column: 65535, scope: !0)
!9 = !DILocation(line: 4294967295, column: 65535, scope: !0)
!10 = !DILocation(scope: !0, column: 0, line: 0, isImplicitCode: true)
!11 = !DILocation(scope: !0, column: 0, line: 1, isImplicitCode: false)
; CHECK-NEXT: !7 = !DILocation(line: 0, scope: !0, isImplicitCode: true)
; CHECK-NEXT: !8 = !DILocation(line: 1, scope: !0)
; CHECK: !9 = !DILocation(line: 0, scope: !0, isImplicitCode: true)
; CHECK: !10 = !DILocation(line: 1, scope: !0)
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !DISubroutineType(types: !14)
!14 = !{null}

View file

@ -17,16 +17,16 @@ define void @_Z3foov() !dbg !9 {
!5 = distinct !{}
!6 = distinct !{}
; CHECK: !7 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !8)
!7 = distinct !DISubprogram(unit: !8)
; CHECK: !7 = distinct !DISubprogram(scope: null, type: !3, spFlags: DISPFlagDefinition, unit: !8)
!7 = distinct !DISubprogram(unit: !8, type: !3)
!8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !2,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2)
; CHECK: !9 = distinct !DISubprogram(scope: null, spFlags: 0)
!9 = distinct !DISubprogram(isDefinition: false)
; CHECK: !9 = distinct !DISubprogram(scope: null, type: !3, spFlags: 0)
!9 = distinct !DISubprogram(isDefinition: false, type: !3)
; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, scopeLine: 8, containingType: !4, virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !8, templateParams: !5, declaration: !9, retainedNodes: !6)
!10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,

View file

@ -47,10 +47,12 @@ define void @test_attachment_name() {
; CHECK: [[M1]] = distinct !DISubprogram
; CHECK: [[M4]] = distinct !{}
!8 = !{null}
!9 = !DISubroutineType(types: !8)
!llvm.module.flags = !{!7}
!llvm.dbg.cu = !{!5}
!0 = !DILocation(line: 662302, column: 26, scope: !1)
!1 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !5)
!1 = distinct !DISubprogram(name: "foo", isDefinition: true, type: !9, unit: !5)
!2 = distinct !{}
!3 = distinct !{}
!4 = distinct !{}

View file

@ -1,9 +1,11 @@
; Bitcode compiled with 3.7_rc2. 3.7 had redundant (but mandatory) tag fields
; on DILocalVariable.
; Bitcode originally compiled with 3.7_rc2. 3.7 had redundant (but
; mandatory) tag fields on DILocalVariable.
;
; RUN: llvm-dis < %s.bc -o - | llvm-as | llvm-dis | FileCheck %s
; CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "foo",{{.*}} retainedNodes: ![[VARS:[0-9]+]]
; CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "foo",{{.*}} type: ![[TYPE:[0-9]+]],{{.*}} retainedNodes: ![[VARS:[0-9]+]]
; CHECK: ![[TYPE]] = !DISubroutineType(types: ![[ARGS:[0-9]+]])
; CHECK: ![[ARGS]] = !{null}
; CHECK: ![[VARS]] = !{![[PARAM:[0-9]+]], ![[AUTO:[0-9]+]]}
; CHECK: ![[PARAM]] = !DILocalVariable(name: "param", arg: 1, scope: ![[SP]])
; CHECK: ![[AUTO]] = !DILocalVariable(name: "auto", scope: ![[SP]])
@ -13,10 +15,12 @@
!llvm.module.flags = !{!6}
!llvm.dbg.cu = !{!4}
!0 = distinct !DISubprogram(name: "foo", scope: null, isLocal: false, isDefinition: true, isOptimized: false, retainedNodes: !1)
!0 = distinct !DISubprogram(name: "foo", scope: null, type: !7, isLocal: false, isDefinition: true, isOptimized: false, unit: !4, retainedNodes: !1)
!1 = !{!2, !3}
!2 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "param", arg: 1, scope: !0)
!3 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "auto", scope: !0)
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5, subprograms: !{!0})
!2 = !DILocalVariable(name: "param", arg: 1, scope: !0)
!3 = !DILocalVariable(name: "auto", scope: !0)
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5)
!5 = !DIFile(filename: "source.c", directory: "/dir")
!6 = !{i32 1, !"Debug Info Version", i32 3}
!7 = !DISubroutineType(types: !8)
!8 = !{null}

View file

@ -1,14 +1,17 @@
; RUN: llvm-dis < %s.bc | FileCheck %s
; Check that subprogram definitions are correctly upgraded to 'distinct'.
; Bitcode compiled with llvm-as version 3.7.
; Check that subprogram definitions are encoded as 'distinct'.
define void @f() !dbg !3 { ret void }
!llvm.module.flags = !{!4}
!llvm.dbg.cu = !{!0}
!0 = distinct !DICompileUnit(language: 12, file: !1, subprograms: !{!3})
!0 = distinct !DICompileUnit(language: 12, file: !1)
!1 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
; CHECK: = distinct !DISubprogram({{.*}} DISPFlagDefinition
!3 = !DISubprogram(name: "foo", isDefinition: true)
; CHECK: = distinct !DISubprogram({{.*}} type: ![[TYPE:[0-9]+]],{{.*}} DISPFlagDefinition
; CHECK: ![[TYPE]] = !DISubroutineType(types: ![[ARGS:[0-9]+]])
; CHECK: ![[ARGS]] = !{null}
!3 = distinct !DISubprogram(name: "foo", type: !5, isDefinition: true, unit: !0)
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !DISubroutineType(types: !6)
!6 = !{null}

View file

@ -18,14 +18,14 @@ define void @_Z3foov() !dbg !9 {
!5 = distinct !{}
!6 = distinct !{}
; CHECK: !7 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !8)
!7 = distinct !DISubprogram(unit: !8)
; CHECK: !7 = distinct !DISubprogram(scope: null, type: !3, spFlags: DISPFlagDefinition, unit: !8)
!7 = distinct !DISubprogram(type: !3, unit: !8)
!8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !2, isOptimized: true, flags: "-O2")
; CHECK: !9 = distinct !DISubprogram(scope: null, spFlags: 0)
!9 = distinct !DISubprogram(isDefinition: false)
; CHECK: !9 = distinct !DISubprogram(scope: null, type: !3, spFlags: 0)
!9 = distinct !DISubprogram(type: !3, isDefinition: false)
; CHECK: !10 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized,
!10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,

View file

@ -31,6 +31,8 @@ entry:
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !DIFile(filename: "f", directory: "/d"))
!2 = distinct !DISubprogram(name: "foo", unit: !1)
!2 = distinct !DISubprogram(name: "foo", type: !5, unit: !1)
!3 = !DILocation(line: 1, scope: !2)
!4 = !DILocation(line: 2, scope: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{null}

View file

@ -1,5 +1,4 @@
; RUN: llvm-dis < %s.bc | FileCheck %s
; RUN: verify-uselistorder %s.bc
; Establish a stable order.
!named = !{!0, !1, !2, !3, !4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16}

View file

@ -145,10 +145,10 @@ attributes #0 = { noinline }
!2 = !{i32 7, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)
!4 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, type: !10, unit: !0)
!5 = !DILocation(line: 0, scope: !4)
!6 = !DILocalVariable(scope: !7)
!7 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)
!7 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, type: !10, unit: !0)
!8 = !DILocation(line: 0, scope: !7, inlinedAt: !5)
!9 = distinct !DISubprogram(scope: null, file: !1, line: 1, type: !10, unit: !0)
!10 = !DISubroutineType(types: !{})

View file

@ -60,12 +60,14 @@ else:
ret i32 %res.2, !dbg !6
}
!llvm.dbg.cu = !{!0}
!7 = !{null}
!8 = !DISubroutineType(types: !7)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
!1 = !DIFile(filename: "arm64-instruction-mix-remarks.ll", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
!3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, scopeLine: 5, type: !8, unit: !0)
!4 = distinct !DILocation(line: 10, column: 10, scope: !3)
!5 = distinct !DILocation(line: 20, column: 20, scope: !3)
!6 = distinct !DILocation(line: 30, column: 30, scope: !3)

View file

@ -123,5 +123,7 @@ define void @empty_func() nounwind ssp !dbg !3 !prof !4 {
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
!1 = !DIFile(filename: "arm64-summary-remarks.ll", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, scopeLine: 5, type: !5, unit: !0)
!4 = !{!"function_entry_count", i64 33}
!5 = !DISubroutineType(types: !6)
!6 = !{null}

View file

@ -7,9 +7,11 @@ define void @empty_func() nounwind ssp !dbg !3 {
}
!llvm.dbg.cu = !{!0}
!4 = !{null}
!5 = !DISubroutineType(types: !4)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
!1 = !DIFile(filename: "arm64-summary-remarks.ll", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, scopeLine: 5, type: !5, unit: !0)

View file

@ -15,13 +15,15 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
attributes #0 = { nounwind readnone speculatable }
!llvm.dbg.cu = !{!0}
!8 = !{null}
!9 = !DISubroutineType(types: !8)
!llvm.module.flags = !{!2, !3}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly)
!1 = !DIFile(filename: "fast-isel-dbg.ll", directory: "/")
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "func", scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)
!4 = distinct !DISubprogram(name: "func", scope: null, isLocal: false, isDefinition: true, isOptimized: false, type: !9, unit: !0)
!5 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 17, type: !6)
!6 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
!7 = !DILocation(line: 17, scope: !4)

View file

@ -48,6 +48,8 @@ cleanup: ; preds = %_ZNK4llvm3opt7ArgLi
%2 = phi i1 [ %call13, %cleanup ], [ %Default, %_ZNK4llvm3opt7ArgList17getLastArgNoClaimIJNS0_12OptSpecifierES3_EEEPNS0_3ArgEDpT_.exit ], [ %Default, %_ZNK4llvm3opt7ArgList17getLastArgNoClaimIJNS0_12OptSpecifierES3_EEEPNS0_3ArgEDpT_.exit.thread ]
ret i1 %2, !dbg !9480
}
!9531 = !{null}
!9532 = !DISubroutineType(types: !9531)
!llvm.module.flags = !{!2, !6}
!llvm.dbg.cu = !{!7}
!2 = !{i32 2, !"Debug Info Version", i32 3}
@ -55,12 +57,12 @@ cleanup: ; preds = %_ZNK4llvm3opt7ArgLi
!7 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !8, emissionKind: FullDebug, sdk: "MacOSX15.3.sdk")
!8 = !DIFile(filename: "/Users/shubhamrastogi/Development/llvm-project-instr-ref/llvm-project/llvm/lib/Option/ArgList.cpp", directory: "/Users/shubhamrastogi/Development/llvm-project-instr-ref/llvm-project/build-instr-ref-stage2", checksumkind: CSK_MD5, checksum: "a3198e8ace679c7b1581a26b5583c658")
!3116 = distinct !DICompositeType(tag: DW_TAG_class_type, size: 32)
!9383 = distinct !DISubprogram(unit: !7, flags: DIFlagArtificial | DIFlagObjectPointer)
!9383 = distinct !DISubprogram(type: !9532, unit: !7, flags: DIFlagArtificial | DIFlagObjectPointer)
!9391 = distinct !DILexicalBlock(scope: !9383, line: 80, column: 12)
!9393 = !DILocation(scope: !9391)
!9440 = distinct !DILexicalBlock(scope: !9441, line: 269, column: 5)
!9441 = distinct !DILexicalBlock(scope: !9442, line: 269, column: 5)
!9442 = distinct !DISubprogram(unit: !7, retainedNodes: !9450)
!9442 = distinct !DISubprogram(type: !9532, unit: !7, retainedNodes: !9450)
!9450 = !{}
!9452 = !DILocalVariable(scope: !9442, type: !3116)
!9478 = distinct !DILocation(scope: !9391)

View file

@ -389,10 +389,12 @@ define void @v_trunc_i1024_to_i512(ptr addrspace(1) %src, ptr addrspace(1) %dst)
}
!llvm.dbg.cu = !{!0}
!5 = !{null}
!6 = !DISubroutineType(types: !5)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
!1 = !DIFile(filename: ".", directory: ".")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "trunc", scope: !1, file: !1, line: 1, unit: !0)
!3 = distinct !DISubprogram(name: "trunc", scope: !1, file: !1, line: 1, type: !6, unit: !0)
!4 = !DILocation(line: 1, scope: !3)

View file

@ -69,4 +69,6 @@ declare i32 @printf(ptr addrspace(4), ...)
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !DILocation(line: 1, column: 42, scope: !5)
!5 = distinct !DISubprogram(name: "arst", scope: null, file: !1, line: 1, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0)
!5 = distinct !DISubprogram(name: "arst", scope: null, file: !1, line: 1, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, type: !6)
!6 = !DISubroutineType(types: !7)
!7 = !{null}

View file

@ -165,15 +165,17 @@
!3 = !{}
!4 = !{i32 0, i32 256}
!5 = !DILocalVariable(name: "bar", scope: !6, file: !1, line: 102, type: !7)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 81, isLocal: false, isDefinition: true, scopeLine: 86, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 81, isLocal: false, isDefinition: true, scopeLine: 86, flags: DIFlagPrototyped, isOptimized: true, type: !10, unit: !0)
!7 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
!8 = !DILocation(line: 102, column: 8, scope: !6)
!9 = !{null}
!10 = !DISubroutineType(types: !9)
...
---
# CHECK: name: sched_dbg_value_crash
# CHECK: DBG_VALUE %99, $noreg, !5, !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef), debug-location !8
# CHECK: DBG_VALUE %99, $noreg, !5, !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef), debug-location !10
name: sched_dbg_value_crash
alignment: 1

View file

@ -21,4 +21,6 @@ attributes #1 = { nounwind }
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !DILocation(line: 1, column: 42, scope: !5)
!5 = distinct !DISubprogram(name: "rsq_legacy_f32", scope: null, file: !1, line: 1, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0)
!5 = distinct !DISubprogram(name: "rsq_legacy_f32", scope: null, file: !1, line: 1, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, type: !6)
!6 = !DISubroutineType(types: !7)
!7 = !{null}

View file

@ -36,12 +36,14 @@
!2 = !{}
!3 = !{i32 1, !"Debug Info Version", i32 3}
!4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !8)
!5 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)
!5 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, type: !12, unit: !0)
!6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!7 = !DILocation(line: 0, scope: !5)
!8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 2048, align: 8, elements: !9)
!9 = !{!10}
!10 = !DISubrange(count: 256)
!11 = !{null}
!12 = !DISubroutineType(types: !11)
...
---
name: foo
@ -53,7 +55,7 @@ frameInfo:
# CHECK: - { id: 0, name: y.i, type: default, offset: 0, size: 256, alignment: 16,
# CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true,
# CHECK-NEXT: debug-info-variable: '!4', debug-info-expression: '!DIExpression()',
# CHECK-NEXT: debug-info-location: '!10' }
# CHECK-NEXT: debug-info-location: '!12' }
stack:
- { id: 0, name: y.i, offset: 0, size: 256, alignment: 16,
debug-info-variable: '!4', debug-info-expression: '!DIExpression()',

View file

@ -45,12 +45,14 @@ declare void @foo()
declare i32 @setjmp(ptr) #0
!llvm.dbg.cu = !{!2}
!9 = !{null}
!10 = !DISubroutineType(types: !9)
!llvm.module.flags = !{!0}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !DIFile(filename: "lower-em-sjlj.c", directory: "test")
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
!3 = distinct !DISubprogram(name: "setjmp_debug_info0", unit:!2, file: !1, line: 1)
!3 = distinct !DISubprogram(name: "setjmp_debug_info0", type: !10, unit:!2, file: !1, line: 1)
!4 = !DILocation(line:2, scope: !3)
!5 = !DILocation(line:3, scope: !3)
!6 = !DILocation(line:4, scope: !3)

View file

@ -106,5 +106,6 @@ define i32 @dummy2(i32 %x, i32 %y, i32 %z) !dbg !4 {
!1 = !DIFile(filename: "test_dir/test_file", directory: "test_dir")
!2 = !{i32 7, !"Dwarf Version", i32 5}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "dummy1", scope: !1, unit: !0)
!4 = distinct !DISubprogram(name: "dummy1", scope: !1, unit: !0, type: !5)
!5 = !DISubroutineType(types: !6)
!6 = !{null}

View file

@ -54,13 +54,15 @@ define dso_local i32 @test(i32 noundef %0) #0 !dbg !10 {
}
!llvm.dbg.cu = !{!0}
!11 = !{null}
!12 = !DISubroutineType(types: !11)
!llvm.module.flags = !{!2, !3}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
!1 = !DIFile(filename: "/path/to/dir/test_filename", directory: "/path/to/dir")
!2 = !{i32 7, !"Dwarf Version", i32 5}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!10 = distinct !DISubprogram(name: "test", scope: !1, unit: !0)
!10 = distinct !DISubprogram(name: "test", scope: !1, type: !12, unit: !0)
;; Check that the split section is created when using the correct module name, or no module name.
;

View file

@ -95,6 +95,8 @@ define dso_local i32 @test5(i32 noundef %0) #0 {
}
!llvm.dbg.cu = !{!0, !1, !2, !3}
!14 = !{null}
!15 = !DISubroutineType(types: !14)
!llvm.module.flags = !{!8, !9}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !4)
@ -107,10 +109,10 @@ define dso_local i32 @test5(i32 noundef %0) #0 {
!7 = !DIFile(filename: "/test_dirname4/test_filename4", directory: "/test_dirname4")
!8 = !{i32 7, !"Dwarf Version", i32 5}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = distinct !DISubprogram(name: "test1", scope: !4, unit: !0)
!11 = distinct !DISubprogram(name: "test2", scope: !5, unit: !1)
!12 = distinct !DISubprogram(name: "test3", scope: !6, unit: !2)
!13 = distinct !DISubprogram(name: "test4", scope: !7, unit: !3)
!10 = distinct !DISubprogram(name: "test1", scope: !4, type: !15, unit: !0)
!11 = distinct !DISubprogram(name: "test2", scope: !5, type: !15, unit: !1)
!12 = distinct !DISubprogram(name: "test3", scope: !6, type: !15, unit: !2)
!13 = distinct !DISubprogram(name: "test4", scope: !7, type: !15, unit: !3)
;; Check that the split section is created when using the correct module name, or no module name.
;

View file

@ -15,7 +15,7 @@ entry:
; CHECK: id: 0
; CHECK: debug-info-variable: '!3'
; CHECK: debug-info-expression: '!DIExpression()'
; CHECK: debug-info-location: '!5'
; CHECK: debug-info-location: '!7'
unreachable
}
@ -28,5 +28,7 @@ attributes #0 = { nounwind readnone speculatable }
!1 = !DIFile(filename: "file.cpp", directory: "/dir")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !DILocalVariable(name: "dstRect", scope: !4)
!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !0, file: !1, line: 42, unit: !0)
!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !0, file: !1, line: 42, unit: !0, type: !6)
!5 = !DILocation(line: 42, column: 85, scope: !4)
!6 = !DISubroutineType(types: !7)
!7 = !{null}

View file

@ -38,7 +38,7 @@ define void @foo() {
; NORMAL-NEXT: {{ $}}
; NORMAL-NEXT: [[MOVUPSrm:%[0-9]+]]:vr128 = MOVUPSrm %stack.1.i, 1, $noreg, 40, $noreg :: (load (s128) from %ir.i4, align 8)
; NORMAL-NEXT: MOVUPSmr $noreg, 1, $noreg, 0, $noreg, killed [[MOVUPSrm]] :: (store (s128) into `ptr null`, align 8)
; NORMAL-NEXT: DBG_VALUE_LIST !3, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 40, DW_OP_stack_value), %stack.1.i, %stack.1.i, debug-location !8
; NORMAL-NEXT: DBG_VALUE_LIST !3, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 40, DW_OP_stack_value), %stack.1.i, %stack.1.i, debug-location !10
; NORMAL-NEXT: [[MOVUPSrm1:%[0-9]+]]:vr128 = MOVUPSrm %stack.1.i, 1, $noreg, 40, $noreg :: (load (s128) from %ir.i6, align 8)
; NORMAL-NEXT: MOVUPSmr $noreg, 1, $noreg, 0, $noreg, killed [[MOVUPSrm1]] :: (store (s128) into `ptr null`, align 8)
; NORMAL-NEXT: {{ $}}
@ -78,7 +78,7 @@ define void @foo() {
; INSTRREF-NEXT: {{ $}}
; INSTRREF-NEXT: [[MOVUPSrm:%[0-9]+]]:vr128 = MOVUPSrm %stack.1.i, 1, $noreg, 40, $noreg :: (load (s128) from %ir.i4, align 8)
; INSTRREF-NEXT: MOVUPSmr $noreg, 1, $noreg, 0, $noreg, killed [[MOVUPSrm]] :: (store (s128) into `ptr null`, align 8)
; INSTRREF-NEXT: DBG_VALUE_LIST !3, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 40, DW_OP_stack_value), %stack.1.i, %stack.1.i, debug-location !8
; INSTRREF-NEXT: DBG_VALUE_LIST !3, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_plus_uconst, 40, DW_OP_stack_value), %stack.1.i, %stack.1.i, debug-location !10
; INSTRREF-NEXT: [[MOVUPSrm1:%[0-9]+]]:vr128 = MOVUPSrm %stack.1.i, 1, $noreg, 40, $noreg :: (load (s128) from %ir.i6, align 8)
; INSTRREF-NEXT: MOVUPSmr $noreg, 1, $noreg, 0, $noreg, killed [[MOVUPSrm1]] :: (store (s128) into `ptr null`, align 8)
; INSTRREF-NEXT: {{ $}}
@ -131,6 +131,8 @@ declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!10 = !{null}
!11 = !DISubroutineType(types: !10)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
@ -138,7 +140,7 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{!"function_entry_count", i64 2423}
!4 = !DILocalVariable(name: "r", scope: !5, file: !6, line: 93)
!5 = distinct !DISubprogram(name: "c", scope: !7, file: !6, line: 92, spFlags: DISPFlagDefinition, unit: !0)
!5 = distinct !DISubprogram(name: "c", scope: !7, file: !6, line: 92, spFlags: DISPFlagDefinition, type: !11, unit: !0)
!6 = !DIFile(filename: "a", directory: "/proc/self/cwd")
!7 = !DINamespace(name: "u", scope: !8)
!8 = !DINamespace(name: "s", scope: null)

View file

@ -534,6 +534,8 @@ declare void @llvm.lifetime.end.p0(ptr nocapture)
declare void @free(ptr nocapture)
!29 = !{null}
!30 = !DISubroutineType(types: !29)
!llvm.module.flags = !{!0, !26, !27}
!0 = !{i32 1, !"ProfileSummary", !1}
!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
@ -558,7 +560,7 @@ declare void @free(ptr nocapture)
!20 = !{}
!21 = !DIFile(filename: "test.c", directory: "/test")
!22 = distinct !DICompileUnit(language: DW_LANG_C99, file: !21, producer: "clang version 15.0.0", isOptimized: true, emissionKind: FullDebug, globals: !25, splitDebugInlining: false, nameTableKind: None)
!23 = distinct !DISubprogram(name: "test", scope: !21, file: !21, line: 1, unit: !22)
!23 = distinct !DISubprogram(name: "test", scope: !21, file: !21, line: 1, type: !30, unit: !22)
!24 = !DILocalVariable(name: "x", scope: !23)
!25 = !{}
!26 = !{i32 2, !"Dwarf Version", i32 4}

View file

@ -31,12 +31,14 @@ bb5:
}
!llvm.dbg.cu = !{!0}
!7 = !{null}
!8 = !DISubroutineType(types: !7)
!llvm.module.flags = !{!2, !3}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
!1 = !DIFile(filename: "foo.c", directory: "b/")
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, type: !8, unit: !0)
!5 = distinct !DILexicalBlock(scope: !4, file: !1, line: 1, column: 1)
!6 = !DILocation(line: 2, column: 2, scope: !5)

View file

@ -17,10 +17,12 @@ define void @test(ptr %p, ptr %q) !dbg !4 {
}
!llvm.dbg.cu = !{!0}
!9 = !{null}
!10 = !DISubroutineType(types: !9)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, emissionKind: LineTablesOnly)
!1 = !DIFile(filename: "t.c", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "test", file: !1, line: 1, spFlags: DISPFlagDefinition, unit: !0)
!4 = distinct !DISubprogram(name: "test", file: !1, line: 1, spFlags: DISPFlagDefinition, type: !10, unit: !0)
!7 = !DILocation(line: 2, scope: !4)
!8 = !DILocation(line: 3, scope: !4)

View file

@ -1,13 +1,13 @@
# RUN: llc %s -start-after=arm-mve-vpt-opts -stop-after=arm-prera-ldst-opt -o - | FileCheck %s
# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !14
# CHECK-NEXT: DBG_VALUE 0, $noreg, !10, !DIExpression(), debug-location !14
# CHECK-NEXT: DBG_VALUE 1, $noreg, !10, !DIExpression(), debug-location !14
# CHECK-NEXT: DBG_VALUE_LIST !10, !DIExpression(), $noreg, $noreg, debug-location !14
# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !10, !DIExpression(), debug-location !14
# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !14 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !14 :: (load (s32) from %ir.btc_user_copy)
# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !14 :: (load (s32) from %ir.btc_user_copy_context, align 8)
# CHECK-NEXT: DBG_VALUE %2, $noreg, !10, !DIExpression(), debug-location !14
# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !16
# CHECK-NEXT: DBG_VALUE 0, $noreg, !12, !DIExpression(), debug-location !16
# CHECK-NEXT: DBG_VALUE 1, $noreg, !12, !DIExpression(), debug-location !16
# CHECK-NEXT: DBG_VALUE_LIST !12, !DIExpression(), $noreg, $noreg, debug-location !16
# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !12, !DIExpression(), debug-location !16
# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !16 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !16 :: (load (s32) from %ir.btc_user_copy)
# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !16 :: (load (s32) from %ir.btc_user_copy_context, align 8)
# CHECK-NEXT: DBG_VALUE %2, $noreg, !12, !DIExpression(), debug-location !16
# CHECK-NEXT: %7:rgpr = t2ANDrr %6, %0, 14 /* CC::al */, $noreg, def $cpsr
# CHECK-NEXT: %8:rgpr = t2ANDrr %6, %0, 14 /* CC::al */, $noreg, def $cpsr
# CHECK-NEXT: %9:rgpr = t2ANDrr %6, %0, 14 /* CC::al */, $noreg, def $cpsr
@ -30,7 +30,7 @@
!llvm.dbg.cu = !{!32}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(type: !11, isDefinition: true)
!2 = distinct !DISubprogram(unit: !32, retainedNodes: !38)
!2 = distinct !DISubprogram(type: !97, unit: !32, retainedNodes: !38)
!3 = !DIFile(filename: "backtrace.pp.c", directory: "/Users/shubham/Development/Delta")
!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !12)
!12 = distinct !DICompositeType(tag: DW_TAG_member, offset: 32)
@ -43,6 +43,8 @@
!88 = !{i32 2, !"Debug Info Version", i32 3}
!93 = !{i32 7, !"frame-pointer", i32 1}
!95 = !DILocation(line: 5, column: 10, scope: !2)
!96 = !{null}
!97 = !DISubroutineType(types: !96)
name: backtrace_user
registers:
- {id: 0, class: rgpr, }

View file

@ -1,15 +1,15 @@
# RUN: llc %s -start-after=arm-mve-vpt-opts -stop-after=arm-prera-ldst-opt -o - | FileCheck %s
# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !14
# CHECK-NEXT: DBG_VALUE 0, $noreg, !10, !DIExpression(), debug-location !14
# CHECK-NEXT: DBG_VALUE 1, $noreg, !10, !DIExpression(), debug-location !14
# CHECK-NEXT: DBG_VALUE_LIST !10, !DIExpression(), $noreg, $noreg, debug-location !14
# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !14 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
# CHECK-NEXT: DBG_VALUE_LIST !10, !DIExpression(), $noreg, $noreg, debug-location !14
# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !14 :: (load (s32) from %ir.btc_user_copy)
# CHECK-NEXT: DBG_VALUE_LIST !10, !DIExpression(), %6, %0, debug-location !14
# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !14 :: (load (s32) from %ir.btc_user_copy_context, align 8)
# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !16
# CHECK-NEXT: DBG_VALUE 0, $noreg, !12, !DIExpression(), debug-location !16
# CHECK-NEXT: DBG_VALUE 1, $noreg, !12, !DIExpression(), debug-location !16
# CHECK-NEXT: DBG_VALUE_LIST !12, !DIExpression(), $noreg, $noreg, debug-location !16
# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !16 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
# CHECK-NEXT: DBG_VALUE_LIST !12, !DIExpression(), $noreg, $noreg, debug-location !16
# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !16 :: (load (s32) from %ir.btc_user_copy)
# CHECK-NEXT: DBG_VALUE_LIST !12, !DIExpression(), %6, %0, debug-location !16
# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !16 :: (load (s32) from %ir.btc_user_copy_context, align 8)
# CHECK-NEXT: %7:rgpr = t2ANDrr %6, %0, 14 /* CC::al */, $noreg, def $cpsr
# CHECK-NEXT: DBG_VALUE %2, $noreg, !10, !DIExpression(), debug-location !14
# CHECK-NEXT: DBG_VALUE %2, $noreg, !12, !DIExpression(), debug-location !16
--- |
target triple = "thumbv7k-apple-watchos8.0.0"
%struct.backtrace_control = type {}
@ -25,7 +25,7 @@
!llvm.dbg.cu = !{!32}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(type: !11, isDefinition: true)
!2 = distinct !DISubprogram(unit: !32, retainedNodes: !38)
!2 = distinct !DISubprogram(type: !97, unit: !32, retainedNodes: !38)
!3 = !DIFile(filename: "backtrace.pp.c", directory: "/Users/shubham/Development/Delta")
!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !12)
!12 = distinct !DICompositeType(tag: DW_TAG_member, offset: 32)
@ -38,6 +38,8 @@
!88 = !{i32 2, !"Debug Info Version", i32 3}
!93 = !{i32 7, !"frame-pointer", i32 1}
!95 = !DILocation(line: 5, column: 10, scope: !2)
!96 = !{null}
!97 = !DISubroutineType(types: !96)
name: backtrace_user
registers:
- {id: 0, class: rgpr, }

View file

@ -28,7 +28,7 @@
!llvm.dbg.cu = !{!32}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(type: !11, isDefinition: true)
!2 = distinct !DISubprogram(unit: !32, retainedNodes: !38)
!2 = distinct !DISubprogram(type: !97, unit: !32, retainedNodes: !38)
!3 = !DIFile(filename: "backtrace.pp.c", directory: "/Users/shubham/Development/Delta")
!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !12)
!12 = distinct !DICompositeType(tag: DW_TAG_member, offset: 32)
@ -44,6 +44,8 @@
!88 = !{i32 2, !"Debug Info Version", i32 3}
!93 = !{i32 7, !"frame-pointer", i32 1}
!95 = !DILocation(line: 5, column: 10, scope: !2)
!96 = !{null}
!97 = !DISubroutineType(types: !96)
name: backtrace_user
registers:
- {id: 0, class: rgpr, }

View file

@ -1,14 +1,14 @@
# RUN: llc %s -start-after=arm-mve-vpt-opts -stop-after=arm-prera-ldst-opt -o - | FileCheck %s
# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !15
# CHECK-NEXT: DBG_VALUE 0, $noreg, !10, !DIExpression(), debug-location !15
# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !10, !DIExpression(), debug-location !15
# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !10, !DIExpression(), debug-location !15
# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !15 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !15 :: (load (s32) from %ir.btc_user_copy)
# CHECK-NEXT: DBG_VALUE %6, $noreg, !10, !DIExpression(), debug-location !15
# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !15 :: (load (s32) from %ir.btc_user_copy_context, align 8)
# CHECK: %5:rgpr = t2MOVCCr %3, killed %4, 0 /* CC::eq */, $cpsr, debug-location !17
# CHECK-NEXT: DBG_VALUE 0, $noreg, !12, !DIExpression(), debug-location !17
# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !12, !DIExpression(), debug-location !17
# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !12, !DIExpression(), debug-location !17
# CHECK-NEXT: %0:rgpr = t2LDRi12 %5, 0, 14 /* CC::al */, $noreg, debug-location !17 :: (load (s32) from %ir..backtrace_user.ctl_default, align 8)
# CHECK-NEXT: %6:rgpr = t2LDRi12 %5, 4, 14 /* CC::al */, $noreg, debug-location !17 :: (load (s32) from %ir.btc_user_copy)
# CHECK-NEXT: DBG_VALUE %6, $noreg, !12, !DIExpression(), debug-location !17
# CHECK-NEXT: %2:gpr = t2LDRi12 %5, 8, 14 /* CC::al */, $noreg, debug-location !17 :: (load (s32) from %ir.btc_user_copy_context, align 8)
# CHECK-NEXT: %7:rgpr = t2ANDrr %6, %0, 14 /* CC::al */, $noreg, def $cpsr
# CHECK-NEXT: DBG_VALUE %2, $noreg, !10, !DIExpression(), debug-location !15
# CHECK-NEXT: DBG_VALUE %2, $noreg, !12, !DIExpression(), debug-location !17
--- |
target triple = "thumbv7k-apple-watchos8.0.0"
%struct.backtrace_control = type {}
@ -25,7 +25,7 @@
!llvm.dbg.cu = !{!32}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(type: !11, isDefinition: true)
!2 = distinct !DISubprogram(unit: !32, retainedNodes: !38)
!2 = distinct !DISubprogram(type: !97, unit: !32, retainedNodes: !38)
!3 = !DIFile(filename: "backtrace.pp.c", directory: "/Users/shubham/Development/Delta")
!8 = !DIDerivedType(tag: DW_TAG_typedef, baseType: !11, size: 32)
!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !12)
@ -40,6 +40,8 @@
!88 = !{i32 2, !"Debug Info Version", i32 3}
!93 = !{i32 7, !"frame-pointer", i32 1}
!95 = !DILocation(line: 5, column: 10, scope: !2)
!96 = !{null}
!97 = !DISubroutineType(types: !96)
name: backtrace_user
registers:
- {id: 0, class: rgpr, }

View file

@ -8,13 +8,15 @@ entry:
ret void
}
!llvm.dbg.cu = !{!2}
!7 = !{null}
!8 = !DISubroutineType(types: !7)
!llvm.module.flags = !{!5}
!2 = distinct !DICompileUnit(language: DW_LANG_Mips_Assembler, producer: "clang version 3.3 ", isOptimized: false, emissionKind: FullDebug, file: !4, enums: !3, retainedTypes: !3, globals: !3, imports: !3)
!3 = !{}
!0 = !DILocation(line: 662302, column: 26, scope: !1)
!1 = !DILocalVariable(name: "foo", scope: !6)
!4 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
!6 = distinct !DISubprogram(unit: !2)
!6 = distinct !DISubprogram(type: !8, unit: !2)
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
!5 = !{i32 1, !"Debug Info Version", i32 3}

View file

@ -85,13 +85,15 @@ declare i32 @lookup(...)
; CHECK: ![[MAPVAR]] = !DILocalVariable(name: "floogie",
; CHECK: ![[UNKNOWN2]] = !DILocation(line: 0
!28 = !{null}
!29 = !DISubroutineType(types: !28)
!llvm.module.flags = !{!4}
!llvm.dbg.cu = !{!2}
!1 = !DILocalVariable(name: "bees", scope: !5, type: null)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "beards", isOptimized: true, runtimeVersion: 4, emissionKind: FullDebug)
!3 = !DIFile(filename: "bees.cpp", directory: "")
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = distinct !DISubprogram(name: "nope", scope: !3, file: !3, line: 1, unit: !2)
!5 = distinct !DISubprogram(name: "nope", scope: !3, file: !3, line: 1, type: !29, unit: !2)
!6 = !DILocation(line: 1, scope: !5)
!7 = !DILocalVariable(name: "flannel", scope: !5, type: null)
!8 = !DILocation(line: 2, scope: !5)
@ -101,9 +103,9 @@ declare i32 @lookup(...)
!12 = !DILocation(line: 6, scope: !5)
!13 = !DILocation(line: 7, scope: !5)
!14 = !DILocation(line: 8, scope: !5)
!15 = distinct !DISubprogram(name: "wat", scope: !2, file: !3, line: 10, unit: !2)
!15 = distinct !DISubprogram(name: "wat", scope: !2, file: !3, line: 10, type: !29, unit: !2)
!16 = !DILocation(line: 9, scope: !15, inlinedAt: !14)
!20 = distinct !DISubprogram(name: "thin", scope: !3, file: !3, line: 20, unit: !2)
!20 = distinct !DISubprogram(name: "thin", scope: !3, file: !3, line: 20, type: !29, unit: !2)
!21 = !DILocalVariable(name: "floogie", scope: !20, type: null)
!22 = !DILocation(line: 21, scope: !20)
!23 = !DILocation(line: 22, scope: !20)

View file

@ -19,6 +19,8 @@ entry:
}
!llvm.dbg.cu = !{!0}
!18 = !{null}
!19 = !DISubroutineType(types: !18)
!llvm.module.flags = !{!2, !3, !4, !5}
!llvm.ident = !{!6}
@ -29,14 +31,14 @@ entry:
!4 = !{i32 1, !"wchar_size", i32 4}
!5 = !{i32 8, !"PIC Level", i32 2}
!6 = !{!"clang version 21.0.0git"}
!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !8)
!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, type: !19, unit: !0, retainedNodes: !8)
!8 = !{!9, !15}
!9 = !DILocalVariable(name: "v", scope: !7, file: !1, line: 8, type: !10)
!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "T", scope: !7, file: !1, line: 2, size: 32, flags: DIFlagTypePassByValue, elements: !11)
!11 = !{!12, !14}
!12 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !10, file: !1, line: 3, baseType: !13, size: 32)
!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!14 = !DISubprogram(name: "bar", scope: !10, file: !1, line: 5, scopeLine: 5, flags: DIFlagPrototyped | DIFlagStaticMember, spFlags: DISPFlagLocalToUnit)
!14 = !DISubprogram(name: "bar", scope: !10, file: !1, line: 5, type: !19, scopeLine: 5, flags: DIFlagPrototyped | DIFlagStaticMember, spFlags: DISPFlagLocalToUnit)
!15 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !7, entity: !16, file: !1, line: 7)
!16 = distinct !DISubprogram(name: "imported", scope: !17, file: !1, line: 3, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
!16 = distinct !DISubprogram(name: "imported", scope: !17, file: !1, line: 3, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, type: !19, unit: !0)
!17 = !DINamespace(name: "ns", scope: null)

View file

@ -3,16 +3,18 @@
; Make sure we emit this diagnostic only once (which means we don't visit the
; same DISubprogram twice.
; CHECK: subprogram definitions must have a compile unit
; CHECK-NEXT: !3 = distinct !DISubprogram(name: "patatino", scope: null, spFlags: DISPFlagDefinition)
; CHECK-NEXT: !3 = distinct !DISubprogram(name: "patatino", scope: null, type: !4, spFlags: DISPFlagDefinition)
; CHECK-NOT: subprogram definitions must have a compile unit
; CHECK-NOT: !3 = distinct !DISubprogram(name: "patatino", scope: null, spFlags: DISPFlagDefinition)
; CHECK-NOT: !3 = distinct !DISubprogram(name: "patatino", scope: null, type: !4, spFlags: DISPFlagDefinition)
; CHECK: warning: ignoring invalid debug info
define void @tinkywinky() !dbg !3 { ret void }
!llvm.module.flags = !{!4}
!llvm.module.flags = !{!6}
!llvm.dbg.cu = !{!0}
!0 = distinct !DICompileUnit(language: 12, file: !1)
!1 = !DIFile(filename: "/home/davide", directory: "/home/davide")
!3 = distinct !DISubprogram(name: "patatino", isDefinition: true)
!4 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "patatino", isDefinition: true, type: !4)
!4 = !DISubroutineType(types: !5)
!5 = !{null}
!6 = !{i32 2, !"Debug Info Version", i32 3}

View file

@ -179,7 +179,7 @@ entry:
!0 = !{i32 7, !"Dwarf Version", i32 5}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = !DILocalVariable(name: "x", scope: !3, type: !6)
!3 = distinct !DISubprogram(name: "test", unit: !4)
!3 = distinct !DISubprogram(name: "test", unit: !4, type: !13)
!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !5, emissionKind: FullDebug)
!5 = !DIFile(filename: "dbg-bit-piece.cpp", directory: "")
!6 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
@ -192,7 +192,7 @@ entry:
;.
; CHECK: [[META2]] = !DILocalVariable(name: "x", scope: [[META3:![0-9]+]], type: [[META6:![0-9]+]])
; CHECK: [[META3]] = distinct !DISubprogram(name: "test", scope: null, spFlags: DISPFlagDefinition, unit: [[META4:![0-9]+]])
; CHECK: [[META3]] = distinct !DISubprogram(name: "test", scope: null, type: [[TYPE:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META4:![0-9]+]])
; CHECK: [[META4]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META5:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
; CHECK: [[META5]] = !DIFile(filename: "dbg-bit-piece.cpp", directory: "")
; CHECK: [[META6]] = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
@ -203,3 +203,5 @@ entry:
; CHECK: [[META11]] = !DILocalVariable(name: "x", scope: [[META3]], type: [[META12:![0-9]+]])
; CHECK: [[META12]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
;.
!13 = !DISubroutineType(types: !14)
!14 = !{null}

View file

@ -5,14 +5,16 @@
!0 = distinct !DICompileUnit(language: 0, file: !1)
!1 = !DIFile(filename: "-", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!20 = !{null}
!21 = !DISubroutineType(types: !20)
; CHECK: invalid file
define void @invalid_file() !dbg !3 { ret void }
!3 = distinct !DISubprogram(file: !0)
!3 = distinct !DISubprogram(type: !21, file: !0)
; CHECK: line specified with no file
define void @line_specified_with_no_file() !dbg !4 { ret void }
!4 = distinct !DISubprogram(line: 1)
!4 = distinct !DISubprogram(type: !21, line: 1)
; CHECK: invalid subroutine type
define void @invalid_subroutine_type() !dbg !5 { ret void }
@ -20,60 +22,60 @@ define void @invalid_subroutine_type() !dbg !5 { ret void }
; CHECK: invalid containing type
define void @invalid_containing_type() !dbg !6 { ret void }
!6 = distinct !DISubprogram(containingType: !0)
!6 = distinct !DISubprogram(type: !21, containingType: !0)
; CHECK: invalid template params
define void @invalid_template_params() !dbg !7 { ret void }
!7 = distinct !DISubprogram(templateParams: !0)
!7 = distinct !DISubprogram(type: !21, templateParams: !0)
; CHECK: invalid template parameter
define void @invalid_template_parameter() !dbg !8 { ret void }
!8 = distinct !DISubprogram(templateParams: !{!0})
!8 = distinct !DISubprogram(type: !21, templateParams: !{!0})
; CHECK: invalid subprogram declaration
define void @invalid_subprogram_declaration() !dbg !9 { ret void }
!9 = distinct !DISubprogram(declaration: !0)
!9 = distinct !DISubprogram(type: !21, declaration: !0)
; CHECK: invalid retained nodes list
define void @invalid_retained_nodes_list() !dbg !10 { ret void }
!10 = distinct !DISubprogram(retainedNodes: !0)
!10 = distinct !DISubprogram(type: !21, retainedNodes: !0)
; CHECK: invalid retained nodes, expected DILocalVariable, DILabel, DIImportedEntity or DIType
define void @invalid_retained_nodes_expected() !dbg !11 { ret void }
!11 = distinct !DISubprogram(retainedNodes: !{!0})
!11 = distinct !DISubprogram(type: !21, retainedNodes: !{!0})
; CHECK: invalid reference flags
define void @invalid_reference_flags_reference() !dbg !12 { ret void }
!12 = distinct !DISubprogram(flags: DIFlagLValueReference | DIFlagRValueReference)
!12 = distinct !DISubprogram(type: !21, flags: DIFlagLValueReference | DIFlagRValueReference)
; CHECK: invalid reference flags
define void @invalid_reference_flags_pass_by() !dbg !13 { ret void }
!13 = distinct !DISubprogram(flags: DIFlagTypePassByValue | DIFlagTypePassByReference)
!13 = distinct !DISubprogram(type: !21, flags: DIFlagTypePassByValue | DIFlagTypePassByReference)
; CHECK: subprogram definitions must have a compile unit
define void @subprogram_definitions_must_have_a_compile_unit() !dbg !14 { ret void }
!14 = distinct !DISubprogram()
!14 = distinct !DISubprogram(type: !21)
; CHECK: invalid unit type
define void @invalid_unit_type() !dbg !15 { ret void }
!15 = distinct !DISubprogram(unit: !{})
!15 = distinct !DISubprogram(type: !21, unit: !{})
; FIXME: should something verify `isDefinition` is not a lie? is it meaningful
; to mistmatch it with respect to the LLVM IR function?
; CHECK: subprogram declarations must not have a compile unit
define void @subprogram_declarations_must_not_have_a_compile_unit() !dbg !16 { ret void }
!16 = distinct !DISubprogram(isDefinition: false, unit: !0)
!16 = distinct !DISubprogram(type: !21, isDefinition: false, unit: !0)
; CHECK: invalid thrown types list
define void @invalid_thrown_types_list() !dbg !17 { ret void }
!17 = distinct !DISubprogram(isDefinition: false, thrownTypes: !0)
!17 = distinct !DISubprogram(type: !21, isDefinition: false, thrownTypes: !0)
; CHECK: invalid thrown type
define void @invalid_thrown_type() !dbg !18 { ret void }
!18 = distinct !DISubprogram(isDefinition: false, thrownTypes: !{!0})
!18 = distinct !DISubprogram(type: !21, isDefinition: false, thrownTypes: !{!0})
; CHECK: DIFlagAllCallsDescribed must be attached to a definition
define void @DIFlagAllCallsDescribed_must_be_attached_to_a_definition() !dbg !19 { ret void }
!19 = distinct !DISubprogram(isDefinition: false, flags: DIFlagAllCallsDescribed)
!19 = distinct !DISubprogram(type: !21, isDefinition: false, flags: DIFlagAllCallsDescribed)
; CHECK: warning: ignoring invalid debug info{{.*}}

View file

@ -95,7 +95,7 @@
!1 = !DIFile(filename: "dbgcall-site-interpretation.c", directory: "/dir")
!2 = !{}
!3 = !{!4}
!4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 9, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 9, flags: DIFlagPrototyped, type: !10, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !{i32 2, !"Dwarf Version", i32 4}
!6 = !{i32 2, !"Debug Info Version", i32 3}
!7 = !{i32 1, !"wchar_size", i32 4}

View file

@ -72,8 +72,8 @@
!1 = !DIFile(filename: "dbgcall-site-lea-interpretation.c", directory: "/dir")
!2 = !{}
!3 = !{!4, !5}
!4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !DISubprogram(name: "foo2", scope: !1, file: !1, line: 9, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, flags: DIFlagPrototyped, type: !11, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !DISubprogram(name: "foo2", scope: !1, file: !1, line: 9, flags: DIFlagPrototyped, type: !11, spFlags: DISPFlagOptimized, retainedNodes: !2)
!6 = !{i32 2, !"Dwarf Version", i32 4}
!7 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !{i32 1, !"wchar_size", i32 4}

View file

@ -47,7 +47,7 @@
!1 = !DIFile(filename: "test.c", directory: "/dir")
!2 = !{}
!3 = !{!4}
!4 = !DISubprogram(name: "fn2", scope: !1, file: !1, line: 11, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!4 = !DISubprogram(name: "fn2", scope: !1, file: !1, line: 11, flags: DIFlagPrototyped, type: !10, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !{i32 2, !"Dwarf Version", i32 4}
!6 = !{i32 2, !"Debug Info Version", i32 3}
!7 = !{i32 1, !"wchar_size", i32 4}

View file

@ -108,8 +108,8 @@
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
!1 = !DIFile(filename: "test.c", directory: "/dir")
!2 = !{}
!4 = !DISubprogram(name: "getVal", scope: !1, file: !1, line: 2, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!4 = !DISubprogram(name: "getVal", scope: !1, file: !1, line: 2, type: !11, spFlags: DISPFlagOptimized, retainedNodes: !2)
!5 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, flags: DIFlagPrototyped, type: !11, spFlags: DISPFlagOptimized, retainedNodes: !2)
!6 = !{i32 2, !"Dwarf Version", i32 4}
!7 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !{i32 1, !"wchar_size", i32 4}

View file

@ -73,14 +73,16 @@
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "beards", isOptimized: true, runtimeVersion: 4, emissionKind: FullDebug)
!2 = !DIFile(filename: "bees.cpp", directory: "")
!3 = distinct !DISubprogram(name: "nope", scope: !1, file: !2, line: 1, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !9)
!33 = distinct !DISubprogram(name: "alsonope", scope: !1, file: !2, line: 1, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !9)
!3 = distinct !DISubprogram(name: "nope", type: !35, scope: !1, file: !2, line: 1, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !9)
!33 = distinct !DISubprogram(name: "alsonope", type: !35, scope: !1, file: !2, line: 1, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !9)
!4 = !DILocalVariable(name: "bees", scope: !3, type: !5)
!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64)
!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!7 = !DILocation(line: 0, scope: !3)
!8 = !{!4}
!9 = !{}
!34 = !{null}
!35 = !DISubroutineType(types: !34)
; CHECK: ![[METAVAR:[0-9]+]] = !DILocalVariable(name: "bees",

View file

@ -26,11 +26,13 @@ bb:
}
!llvm.dbg.cu = !{!0}
!6 = !{null}
!7 = !DISubroutineType(types: !6)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1)
!1 = !DIFile(filename: "instr-ref-opt-bisect2.ll", directory: ".")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "instr-ref-opt-bisect2", file: !1, unit: !0)
!3 = distinct !DISubprogram(name: "instr-ref-opt-bisect2", file: !1, type: !7, unit: !0)
!4 = !DILocalVariable(name: "arg", arg: 2, scope: !3)
!5 = !DILocation(line: 0, scope: !3)

View file

@ -45,12 +45,14 @@ bb1:
declare void @llvm.dbg.value(metadata, metadata, metadata)
!8 = !{null}
!9 = !DISubroutineType(types: !8)
!llvm.module.flags = !{!4}
!llvm.dbg.cu = !{!2}
!1 = !DILocalVariable(name: "bees", scope: !5, type: null)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "beards", isOptimized: true, runtimeVersion: 4, emissionKind: FullDebug)
!3 = !DIFile(filename: "bees.cpp", directory: "")
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = distinct !DISubprogram(name: "nope", scope: !2, file: !3, line: 1, unit: !2)
!5 = distinct !DISubprogram(name: "nope", scope: !2, file: !3, line: 1, type: !9, unit: !2)
!6 = !DILocation(line: 0, scope: !5)
!7 = !DILocalVariable(name: "flannel", scope: !5, type: null)

View file

@ -32,6 +32,8 @@ exit2.bb:
}
!llvm.dbg.cu = !{!0}
!10 = !{null}
!11 = !DISubroutineType(types: !10)
!llvm.module.flags = !{!3, !4}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !2)
@ -39,7 +41,7 @@ exit2.bb:
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !1, file: !1, line: 1, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !1, file: !1, line: 1, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, type: !11, unit: !0, retainedNodes: !2)
!6 = !DILocation(line: 2, column: 0, scope: !5)
!7 = !DILocation(line: 3, column: 0, scope: !5)
!8 = !DILocation(line: 4, column: 0, scope: !5)

View file

@ -93,7 +93,7 @@ entry:
!49 = !DISubroutineType(types: !50)
!50 = !{ !51}
!51 = !DICompositeType(tag: DW_TAG_structure_type, identifier: "$s4main1TV13TangentVectorVXMtD")
!52 = !DISubprogram(spFlags: DISPFlagOptimized)
!52 = !DISubprogram(type: !49, spFlags: DISPFlagOptimized)
!53 = !{!54, !56, !57}
!54 = !DILocalVariable(name: "a", scope: !44, flags: DIFlagArtificial)
!55 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !46)
@ -102,7 +102,7 @@ entry:
!58 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !51)
!61 = !DILocation(scope: !44)
!62 = !DILocalVariable(name: "d", scope: !63, type: !72, flags: DIFlagArtificial)
!63 = distinct !DISubprogram(unit: !16, retainedNodes: !70)
!63 = distinct !DISubprogram(type: !49, unit: !16, retainedNodes: !70)
!64 = !DICompositeType(tag: DW_TAG_structure_type, size: 200, identifier: "$s4main1UV13TangentVectorVD")
!70 = !{}
!72 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !64)

View file

@ -94,12 +94,14 @@ define void @Func5() sanitize_address #0 !dbg !11 {
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
!1 = !DIFile(filename: "../file1.c", directory: "/")
!11 = distinct !DISubprogram(name: "Func5", scope: !1, file: !1, line: 6, unit: !0)
!11 = distinct !DISubprogram(name: "Func5", scope: !1, file: !1, line: 6, type: !19, unit: !0)
!12 = !DILocation(line: 7, column: 3, scope: !11)
!18 = !DILocation(line: 10, column: 1, scope: !11)
!19 = !DISubroutineType(types: !20)
!20 = !{null}
!21 = !DIFile(filename: "../file2.c", directory: "/")
!6 = distinct !DISubprogram(name: "Func4", scope: !1, file: !21, line: 2, unit: !0)
!6 = distinct !DISubprogram(name: "Func4", scope: !1, file: !21, line: 2, type: !19, unit: !0)
!15 = distinct !DILocation(line: 8, column: 3, scope: !11)
!14 = !DILocation(line: 3, column: 3, scope: !6, inlinedAt: !15)
!17 = !DILocation(line: 4, column: 1, scope: !6, inlinedAt: !15)

View file

@ -41,11 +41,13 @@ entry:
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!6 = !{null}
!7 = !DISubroutineType(types: !6)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1)
!1 = !DIFile(filename: "foo.c", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !DILocalVariable(scope: !4)
!4 = distinct !DISubprogram(unit: !0)
!4 = distinct !DISubprogram(type: !7, unit: !0)
!5 = !DILocation(scope: !4)

View file

@ -15,7 +15,7 @@ define void @foo() {
define internal void @bar(ptr %p) {
; CHECK-LABEL: define {{.*}}void @bar()
; CHECK-NEXT: #dbg_value(ptr poison, !3, !DIExpression(), !5
; CHECK-NEXT: #dbg_value(ptr poison, !3, !DIExpression(), !7
call void @llvm.dbg.value(metadata ptr %p, metadata !3, metadata !DIExpression()), !dbg !5
ret void
}
@ -31,5 +31,7 @@ attributes #0 = { nofree nosync nounwind readnone speculatable willreturn }
!1 = !DIFile(filename: "test.c", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !DILocalVariable(name: "p", scope: !4)
!4 = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: !0)
!4 = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: !0, type: !6)
!5 = !DILocation(line: 1, column: 1, scope: !4)
!6 = !DISubroutineType(types: !7)
!7 = !{null}

View file

@ -51,12 +51,14 @@ define void @caller(ptr %Y, ptr %P) {
}
!7 = !{null}
!8 = !DISubroutineType(types: !7)
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!3}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !DILocation(line: 8, scope: !2)
!2 = distinct !DISubprogram(name: "test", file: !5, line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, scopeLine: 3, scope: null)
!2 = distinct !DISubprogram(name: "test", file: !5, line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, type: !8, unit: !3, scopeLine: 3, scope: null)
!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !5)
!5 = !DIFile(filename: "test.c", directory: "")
!6 = !DILocation(line: 9, scope: !2)
@ -68,14 +70,14 @@ define void @caller(ptr %Y, ptr %P) {
; TUNIT: [[META0:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
; TUNIT: [[META1:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: [[META2:![0-9]+]], producer: "{{.*}}clang version {{.*}} ", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly)
; TUNIT: [[META2]] = !DIFile(filename: "test.c", directory: "")
; TUNIT: [[DBG3]] = distinct !DISubprogram(name: "test", scope: null, file: [[META2]], line: 3, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: [[META1]])
; TUNIT: [[DBG3]] = distinct !DISubprogram(name: "test", scope: null, file: [[META2]], line: 3, type: [[META4:![0-9]+]], scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: [[META1]])
; TUNIT: [[DBG4]] = !DILocation(line: 8, scope: [[DBG3]])
; TUNIT: [[DBG5]] = !DILocation(line: 9, scope: [[DBG3]])
;.
; CGSCC: [[META0:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
; CGSCC: [[META1:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: [[META2:![0-9]+]], producer: "{{.*}}clang version {{.*}} ", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly)
; CGSCC: [[META2]] = !DIFile(filename: "test.c", directory: "")
; CGSCC: [[DBG3]] = distinct !DISubprogram(name: "test", scope: null, file: [[META2]], line: 3, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: [[META1]])
; CGSCC: [[DBG3]] = distinct !DISubprogram(name: "test", scope: null, file: [[META2]], line: 3, type: [[META4:![0-9]+]], scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: [[META1]])
; CGSCC: [[DBG4]] = !DILocation(line: 8, scope: [[DBG3]])
; CGSCC: [[DBG5]] = !DILocation(line: 9, scope: [[DBG3]])
;.

View file

@ -38,12 +38,14 @@ define internal void @bar(%p_t %p) {
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!7 = !{null}
!8 = !DISubroutineType(types: !7)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
!1 = !DIFile(filename: "test.c", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "bar", unit: !0)
!3 = distinct !DISubprogram(name: "bar", type: !8, unit: !0)
!4 = !DILocalVariable(name: "p", scope: !3)
!5 = !DIExpression()
!6 = !DILocation(line: 1, column: 1, scope: !3)
@ -60,7 +62,7 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
; CGSCC: [[META1]] = !DIFile(filename: "test.c", directory: "")
; CGSCC: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
; CGSCC: [[META3]] = !DILocalVariable(name: "p", scope: [[META4:![0-9]+]])
; CGSCC: [[META4]] = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: [[META0]])
; CGSCC: [[META4]] = distinct !DISubprogram(name: "bar", scope: null, type: [[TYPE:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META0]])
; CGSCC: [[META5]] = !DILocation(line: 1, column: 1, scope: [[META4]])
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:

View file

@ -42,6 +42,8 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
attributes #0 = { nounwind readnone speculatable }
!llvm.dbg.cu = !{!0}
!14 = !{null}
!15 = !DISubroutineType(types: !14)
!llvm.module.flags = !{!2, !3}
!llvm.ident = !{!4}
@ -51,7 +53,7 @@ attributes #0 = { nounwind readnone speculatable }
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{!"My Compiler"}
!5 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, unit: !0)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !15, unit: !0)
!7 = !DILocalVariable(name: "c", scope: !6, line: 5, type: !5)
!8 = !DILocation(line: 5, column: 7, scope: !6)
!11 = !DILocalVariable(name: "a", scope: !6, line: 6, type: !5)

View file

@ -21,13 +21,15 @@ define void @test(i64 %arg) {
!2 = !{}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !DILocalVariable(name: "c", scope: !5, file: !1, line: 26)
!5 = distinct !DISubprogram(name: "n<(lambda at test.cpp:39:14)>", linkageName: "_ZN1m1nIZN1o1pEvEUl1kE_EE5arrayT_i", scope: null, file: !1, line: 25, spFlags: DISPFlagDefinition, unit: !0)
!5 = distinct !DISubprogram(name: "n<(lambda at test.cpp:39:14)>", linkageName: "_ZN1m1nIZN1o1pEvEUl1kE_EE5arrayT_i", scope: null, file: !1, line: 25, spFlags: DISPFlagDefinition, unit: !0, type: !7)
!6 = !DILocation(line: 26, column: 11, scope: !5)
;.
; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: [[META2:![0-9]+]], globals: [[META2]], splitDebugInlining: false, nameTableKind: None)
; CHECK: [[META1]] = !DIFile(filename: "test.cpp", directory: {{.*}})
; CHECK: [[META2]] = !{}
; CHECK: [[META4]] = !DILocalVariable(name: "c", scope: [[META5:![0-9]+]], file: [[META1]], line: 26)
; CHECK: [[META5]] = distinct !DISubprogram(name: "n<(lambda at test.cpp:39:14)>", linkageName: "_ZN1m1nIZN1o1pEvEUl1kE_EE5arrayT_i", scope: null, file: [[META1]], line: 25, spFlags: DISPFlagDefinition, unit: [[META0]])
; CHECK: [[META5]] = distinct !DISubprogram(name: "n<(lambda at test.cpp:39:14)>", linkageName: "_ZN1m1nIZN1o1pEvEUl1kE_EE5arrayT_i", scope: null, file: [[META1]], line: 25, type: [[TYPE:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META0]])
; CHECK: [[META6]] = !DILocation(line: 26, column: 11, scope: [[META5]])
;.
!7 = !DISubroutineType(types: !8)
!8 = !{null}

View file

@ -56,17 +56,19 @@ attributes #0 = { presplitcoroutine }
attributes #1 = { nomerge nounwind }
attributes #2 = { nounwind }
!12 = !{null}
!13 = !DISubroutineType(types: !12)
!llvm.module.flags = !{!0}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
!1 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, type: !13, unit: !2, retainedNodes: !4)
!2 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
!3 = !DIFile(filename: "blah", directory: "")
!4 = !{}
!5 = !DILocalVariable(scope: !1, type: !6)
!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Klass")
!7 = !DILocation(line: 0, scope: !1)
!8 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !2)
!8 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, type: !13, unit: !2)
!9 = !DILocation(line: 0, scope: !8)
!10 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !2)
!10 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, type: !13, unit: !2)
!11 = !DILocation(line: 0, scope: !10)

View file

@ -30,11 +30,13 @@ lpad:
ret void
}
!7 = !{null}
!8 = !DISubroutineType(types: !7)
!llvm.module.flags = !{!1}
!llvm.dbg.cu = !{!5}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DISubprogram(unit: !5)
!2 = distinct !DISubprogram(type: !8, unit: !5)
!3 = !DILocation(line: 1, scope: !2)
!4 = !DILocation(line: 2, scope: !2)
!5 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",

View file

@ -1058,7 +1058,7 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "Me", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: null, retainedTypes: null, imports: null)
!1 = !DILocalVariable(name: "", arg: 1, scope: !2, file: null, line: 1, type: null)
!2 = distinct !DISubprogram(name: "debug", linkageName: "debug", scope: null, file: null, line: 0, type: null, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!2 = distinct !DISubprogram(name: "debug", linkageName: "debug", scope: null, file: null, line: 0, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!3 = !DIFile(filename: "consecutive-fences.ll", directory: "")
!5 = !{i32 2, !"Dwarf Version", i32 4}
!6 = !{i32 2, !"Debug Info Version", i32 3}
@ -1069,3 +1069,5 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind }
!10 = !DISubroutineType(types: !11)
!11 = !{null}

View file

@ -113,10 +113,12 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "Me", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: null, retainedTypes: null, imports: null)
!1 = !DILocalVariable(name: "", arg: 1, scope: !2, file: null, line: 1, type: null)
!2 = distinct !DISubprogram(name: "debug", linkageName: "debug", scope: null, file: null, line: 0, type: null, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!2 = distinct !DISubprogram(name: "debug", linkageName: "debug", scope: null, file: null, line: 0, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!3 = !DIFile(filename: "consecutive-fences.ll", directory: "")
!5 = !{i32 2, !"Dwarf Version", i32 4}
!6 = !{i32 2, !"Debug Info Version", i32 3}
!7 = !{i32 1, !"wchar_size", i32 4}
!8 = !{i32 7, !"PIC Level", i32 2}
!9 = !DILocation(line: 0, column: 0, scope: !2)
!10 = !DISubroutineType(types: !11)
!11 = !{null}

View file

@ -51,7 +51,7 @@ end:
!1 = !DIFile(filename: "t", directory: "/")
!2 = !{i32 7, !"Dwarf Version", i32 5}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "triangle_phi", linkageName: "triangle_phi", scope: !1, file: !1, line: 1, unit: !0)
!4 = distinct !DISubprogram(name: "triangle_phi", linkageName: "triangle_phi", scope: !1, file: !1, line: 1, unit: !0, type: !10)
!5 = !DILocation(line: 1, column: 22, scope: !4)
!6 = !DILocation(line: 2, column: 22, scope: !4)
!7 = !DILocation(line: 3, column: 22, scope: !4)
@ -62,9 +62,11 @@ end:
; CHECK: [[META1:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
; CHECK: [[PROF2]] = !{!"branch_weights", i32 5, i32 7}
; CHECK: [[DBG3]] = !DILocation(line: 2, column: 22, scope: [[META4:![0-9]+]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "triangle_phi", linkageName: "triangle_phi", scope: [[META5:![0-9]+]], file: [[META5]], line: 1, spFlags: DISPFlagDefinition, unit: [[META6:![0-9]+]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "triangle_phi", linkageName: "triangle_phi", scope: [[META5:![0-9]+]], file: [[META5]], line: 1, type: [[TYPE:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META6:![0-9]+]])
; CHECK: [[META5]] = !DIFile(filename: "{{.*}}t", directory: {{.*}})
; CHECK: [[META6]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META5]], isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
; CHECK: [[DBG7]] = !DILocation(line: 3, column: 22, scope: [[META4]])
; CHECK: [[PROF8]] = !{!"branch_weights", i32 13, i32 11}
;.
!10 = !DISubroutineType(types: !11)
!11 = !{null}

View file

@ -35,9 +35,11 @@ exit: ; preds = %for.body
!llvm.module.flags = !{!5, !6, !7}
!0 = !DIFile(filename: "f.c", directory: "/")
!1 = distinct !DISubprogram(name: "f", scope: !0, file: !0, unit: !4)
!1 = distinct !DISubprogram(name: "f", scope: !0, file: !0, type: !8, unit: !4)
!2 = !DILocation(line: 5, column: 2, scope: !1)
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !0, producer: "clang")
!5 = !{i32 1, !"Debug Info Version", i32 3}
!6 = !{i32 2, !"Dwarf Version", i32 2}
!7 = !{i32 1, !"PIC Level", i32 2}
!8 = !DISubroutineType(types: !9)
!9 = !{null}

View file

@ -243,8 +243,8 @@ exit:
!27 = !{i32 1, !"Debug Info Version", i32 3}
!28 = !DILocation(line: 137, column: 44, scope: !29)
!29 = distinct !DILexicalBlock(scope: !30, file: !5, line: 137, column: 2)
!30 = distinct !DISubprogram(name: "Place", scope: !5, file: !5, line: 135, scopeLine: 135, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
!31 = distinct !DISubprogram(name: "Place", scope: !5, file: !5, line: 135, scopeLine: 135, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
!30 = distinct !DISubprogram(name: "Place", scope: !5, file: !5, line: 135, scopeLine: 135, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, type: !7, unit: !0)
!31 = distinct !DISubprogram(name: "Place", scope: !5, file: !5, line: 135, scopeLine: 135, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, type: !7, unit: !0)
!32 = distinct !DILexicalBlock(scope: !31, file: !5, line: 137, column: 2)
!33 = !DILocation(line: 210, column: 44, scope: !32)
!34 = !DILocation(line: 320, column: 44, scope: !32)

View file

@ -57,13 +57,15 @@ define void @_Z3foov() #0 !dbg !6 {
;PSEUDO_PROBE: ![[#PROBE]] = !DILocation(line: 6, column: 13, scope: ![[TOP]])
!llvm.dbg.cu = !{!0}
!23 = !{null}
!24 = !DISubroutineType(types: !23)
!llvm.module.flags = !{!3, !4}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, debugInfoForProfiling: true)
!1 = !DIFile(filename: "a.cc", directory: "/")
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, unit: !0)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !24, unit: !0)
!8 = !DILocation(line: 6, column: 13, scope: !6)
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}

View file

@ -39,6 +39,8 @@ define i32 @foo2(ptr %arg) {
declare void @llvm.dbg.declare(metadata, metadata, metadata)
!41 = !{null}
!42 = !DISubroutineType(types: !41)
!llvm.module.flags = !{!1, !2}
!llvm.dbg.cu = !{!7}
@ -48,7 +50,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata)
!4 = !DIBasicType(name: "ptr sized type", size: 64)
!7 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !8, producer: "clang", emissionKind: FullDebug)
!8 = !DIFile(filename: "test.ll", directory: "")
!10 = distinct !DISubprogram(name: "blah", linkageName: "blah", scope: !8, file: !8, line: 7, unit: !7)
!10 = distinct !DISubprogram(name: "blah", linkageName: "blah", scope: !8, file: !8, line: 7, type: !42, unit: !7)
!25 = !DILocalVariable(name: "blah", arg: 1, scope: !10, file: !8, line: 7, type:!3)
!26 = !DILocalVariable(name: "ptr sized var", arg: 1, scope: !10, file: !8, line: 7, type:!4)
!40 = !DILocation(line: 7, column: 35, scope: !10)

View file

@ -61,13 +61,15 @@ entry:
;; to the GUID of _Z3xyzv, see comments in the profile above.
; CHECK-ENABLE: ![[VP2]] = !{!"VP", i32 0, i64 1, i64 -3079258800046378528, i64 1}
!20 = !{null}
!21 = !DISubroutineType(types: !20)
!llvm.module.flags = !{!2, !3}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1)
!1 = !DIFile(filename: "t", directory: "/")
!2 = !{i32 7, !"Dwarf Version", i32 5}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 1, unit: !0)
!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 1, type: !21, unit: !0)
!5 = !DILocation(line: 4, column: 5, scope: !4)
!6 = !DILocation(line: 5, column: 10, scope: !4)
@ -127,7 +129,9 @@ entry:
!11 = !DIFile(filename: "t", directory: "/")
!12 = !{i32 7, !"Dwarf Version", i32 5}
!13 = !{i32 2, !"Debug Info Version", i32 3}
!14 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !11, file: !11, line: 1, unit: !10)
!14 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !11, file: !11, line: 1, type: !21, unit: !10)
!15 = !DILocation(line: 4, column: 5, scope: !14)
!17 = !DILocation(line: 6, column: 5, scope: !14)
!18 = !DILocation(line: 7, column: 5, scope: !14)
!20 = !{null}
!21 = !DISubroutineType(types: !20)

View file

@ -43,5 +43,7 @@ attributes #0 = { builtin allocsize(0) }
!1 = !DIFile(filename: "t", directory: "/")
!2 = !{i32 7, !"Dwarf Version", i32 5}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, unit: !0)
!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !6, unit: !0)
!5 = !DILocation(line: 1, column: 22, scope: !4)
!6 = !DISubroutineType(types: !7)
!7 = !{null}

View file

@ -158,8 +158,10 @@ attributes #0 = { builtin allocsize(0) }
!1 = !DIFile(filename: "t", directory: "/")
!2 = !{i32 7, !"Dwarf Version", i32 5}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, unit: !0)
!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !9, unit: !0)
!5 = !DILocation(line: 1, column: 22, scope: !4)
!6 = !DILocation(line: 2, column: 22, scope: !4)
!7 = !DILocation(line: 3, column: 22, scope: !4)
!8 = !DILocation(line: 4, column: 22, scope: !4)
!9 = !DISubroutineType(types: !10)
!10 = !{null}

View file

@ -59,12 +59,14 @@ cond.end.i:
!1 = !DIFile(filename: "q.cpp", directory: "/tmp")
!7 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !DILocalVariable(name: "sb", arg: 4, scope: !9)
!9 = distinct !DISubprogram(name: "color_rgba", unit: !0)
!9 = distinct !DISubprogram(name: "color_rgba", unit: !0, type: !17)
!16 = !DILocation(scope: !9)
;.
; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
; CHECK: [[META1]] = !DIFile(filename: "q.cpp", directory: {{.*}})
; CHECK: [[META3]] = !DILocalVariable(name: "sb", arg: 4, scope: [[META4:![0-9]+]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "color_rgba", scope: null, spFlags: DISPFlagDefinition, unit: [[META0]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "color_rgba", scope: null, type: [[TYPE:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META0]])
; CHECK: [[META5]] = !DILocation(line: 0, scope: [[META4]])
;.
!17 = !DISubroutineType(types: !18)
!18 = !{null}

View file

@ -29,12 +29,14 @@ for.body:
!1 = !DIFile(filename: "repro.c", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !DILocalVariable(name: "s0", scope: !4)
!4 = distinct !DISubprogram(name: "foo", scope: !1, unit: !0)
!4 = distinct !DISubprogram(name: "foo", scope: !1, unit: !0, type: !6)
!5 = !DILocation(line: 0, scope: !4)
;.
; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
; CHECK: [[META1]] = !DIFile(filename: "repro.c", directory: {{.*}})
; CHECK: [[META3]] = !DILocalVariable(name: "s0", scope: [[META4:![0-9]+]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "foo", scope: [[META1]], spFlags: DISPFlagDefinition, unit: [[META0]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "foo", scope: [[META1]], type: [[TYPE:![0-9]+]], spFlags: DISPFlagDefinition, unit: [[META0]])
; CHECK: [[META5]] = !DILocation(line: 0, scope: [[META4]])
;.
!6 = !DISubroutineType(types: !7)
!7 = !{null}

View file

@ -189,11 +189,13 @@ entry:
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!6 = !{null}
!7 = !DISubroutineType(types: !6)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1)
!1 = !DIFile(filename: "foo.c", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !DILocalVariable(scope: !4)
!4 = distinct !DISubprogram(unit: !0)
!4 = distinct !DISubprogram(type: !7, unit: !0)
!5 = !DILocation(scope: !4)

View file

@ -26,11 +26,13 @@ entry:
attributes #0 = { nounwind readnone }
!llvm.dbg.cu = !{!9}
!10 = !{null}
!11 = !DISubroutineType(types: !10)
!llvm.module.flags = !{!0}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !DILocalVariable(name: "I", scope: !2, file: !3, line: 947, type: !4)
!2 = distinct !DISubprogram(name: "findInsertLocation", linkageName: "_ZL18findInsertLocationPN4llvm17MachineBasicBlockENS_9SlotIndexERNS_13LiveIntervalsE", scope: !3, file: !3, line: 937, isLocal: true, isDefinition: true, scopeLine: 938, flags: DIFlagPrototyped, isOptimized: true, unit: !9)
!2 = distinct !DISubprogram(name: "findInsertLocation", linkageName: "_ZL18findInsertLocationPN4llvm17MachineBasicBlockENS_9SlotIndexERNS_13LiveIntervalsE", scope: !3, file: !3, line: 937, isLocal: true, isDefinition: true, scopeLine: 938, flags: DIFlagPrototyped, isOptimized: true, type: !11, unit: !9)
!3 = !DIFile(filename: "none", directory: ".")
!4 = !DICompositeType(tag: DW_TAG_class_type, name: "bundle_iterator<llvm::MachineInstr, llvm::ilist_iterator<llvm::MachineInstr> >", scope: !5, file: !3, line: 163, size: 128, align: 64, elements: !6, templateParams: !6, identifier: "_ZTSN4llvm17MachineBasicBlock15bundle_iteratorINS_12MachineInstrENS_14ilist_iteratorIS2_EEEE")
!5 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "MachineBasicBlock", file: !3, line: 68, size: 1408, align: 64, identifier: "_ZTSN4llvm17MachineBasicBlockE")

View file

@ -18,14 +18,16 @@ define i32 @baz() #0 !dbg !7 {
attributes #0 = {"use-sample-profile"}
!llvm.dbg.cu = !{!0}
!9 = !{null}
!10 = !DISubroutineType(types: !9)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
!1 = !DIFile(filename: "foo.cc", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, unit: !0)
!3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !10, unit: !0)
!4 = !DILocation(line: 5, scope: !3)
!5 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 8, unit: !0)
!5 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 8, type: !10, unit: !0)
!6 = !DILocation(line: 9, scope: !5)
!7 = distinct !DISubprogram(name: "baz", scope: !1, file: !1, line: 12, unit: !0)
!7 = distinct !DISubprogram(name: "baz", scope: !1, file: !1, line: 12, type: !10, unit: !0)
!8 = !DILocation(line: 13, scope: !7)

View file

@ -39,20 +39,22 @@ define void @_Z3zoov() #0 !dbg !11 {
attributes #0 = {"use-sample-profile"}
!llvm.dbg.cu = !{!0}
!12 = !{null}
!13 = !DISubroutineType(types: !12)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
!1 = !DIFile(filename: "test.cc", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, unit: !0)
!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, type: !13, unit: !0)
!4 = !DILocation(line: 4, scope: !3)
!5 = !DILocation(line: 5, scope: !3)
!6 = !DILocation(line: 6, scope: !3)
!7 = !DILocation(line: 7, scope: !3)
!8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 29, unit: !0)
!9 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 32, unit: !0)
!10 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !1, file: !1, line: 24, unit: !0)
!11 = distinct !DISubprogram(name: "zoo", linkageName: "_Z3zoov", scope: !1, file: !1, line: 24, unit: !0)
!8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 29, type: !13, unit: !0)
!9 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 32, type: !13, unit: !0)
!10 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !1, file: !1, line: 24, type: !13, unit: !0)
!11 = distinct !DISubprogram(name: "zoo", linkageName: "_Z3zoov", scope: !1, file: !1, line: 24, type: !13, unit: !0)
; ICP-ALL: remark: test.cc:4:0: '_Z3foov' inlined into 'test'

View file

@ -58,19 +58,21 @@ attributes #0 = {"target-features"="+sse4.1" "use-sample-profile"}
attributes #1 = {"target-features"="+sse4.2" "use-sample-profile"}
!llvm.dbg.cu = !{!0}
!18 = !{null}
!19 = !DISubroutineType(types: !18)
!llvm.module.flags = !{!3, !4}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
!1 = !DIFile(filename: "a", directory: "b/")
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(linkageName: "_Z3foov", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
!6 = distinct !DISubprogram(linkageName: "_Z3foov", scope: !1, file: !1, line: 5, scopeLine: 5, type: !19, unit: !0)
!9 = !DILocation(line: 6, column: 3, scope: !6)
!10 = !DILocation(line: 8, column: 5, scope: !11)
!11 = distinct !DILexicalBlock(scope: !6, file: !1, line: 7, column: 7)
!12 = distinct !DISubprogram(linkageName: "_ZL3barv", scope: !1, file: !1, line: 20, scopeLine: 20, unit: !0)
!13 = distinct !DISubprogram(linkageName: "recursive", scope: !1, file: !1, line: 20, scopeLine: 20, unit: !0)
!12 = distinct !DISubprogram(linkageName: "_ZL3barv", scope: !1, file: !1, line: 20, scopeLine: 20, type: !19, unit: !0)
!13 = distinct !DISubprogram(linkageName: "recursive", scope: !1, file: !1, line: 20, scopeLine: 20, type: !19, unit: !0)
!14 = !DILocation(line: 21, column: 3, scope: !13)
!15 = !DILocation(line: 22, column: 3, scope: !13)
!16 = !DILocation(line: 7, column: 3, scope: !6)
!17 = distinct !DISubprogram(linkageName: "no_inline", scope: !1, file: !1, line: 20, scopeLine: 20, unit: !0)
!17 = distinct !DISubprogram(linkageName: "no_inline", scope: !1, file: !1, line: 20, scopeLine: 20, type: !19, unit: !0)

View file

@ -76,7 +76,7 @@ attributes #0 = {"use-sample-profile"}
!9 = !{i32 1, !"Debug Info Version", i32 3}
!10 = !{!"clang version 3.5 "}
!12 = distinct !DISubprogram(name: "test_liveness", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 7, file: !1, scope: !1, type: !6, retainedNodes: !2)
!13 = !DISubprogram(name: "bar_dbg", scope: !1, file: !1, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
!13 = !DISubprogram(name: "bar_dbg", scope: !1, file: !1, flags: DIFlagPrototyped, type: !6, spFlags: DISPFlagOptimized)
!14 = distinct !DISubprogram(name: "bar_available", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 7, file: !1, scope: !1, type: !6, retainedNodes: !2)
!15 = !DILexicalBlockFile(discriminator: 1, file: !1, scope: !7)
!17 = distinct !DILexicalBlock(line: 10, column: 0, file: !1, scope: !7)

View file

@ -17,11 +17,13 @@ define void @test(ptr) #0 !dbg !3 {
attributes #0 = {"use-sample-profile"}
!llvm.dbg.cu = !{!0}
!5 = !{null}
!6 = !DISubroutineType(types: !5)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
!1 = !DIFile(filename: "test.cc", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, unit: !0)
!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, type: !6, unit: !0)
!4 = !DILocation(line: 5, scope: !3)
; CHECK: ![[PROF]] = !{!"VP", i32 0, i64 3457, i64 9191153033785521275, i64 2059, i64 -1069303473483922844, i64 1398}

View file

@ -191,12 +191,14 @@ define void @test_direct() #0 !dbg !22 {
attributes #0 = {"use-sample-profile"}
!llvm.dbg.cu = !{!0}
!36 = !{null}
!37 = !DISubroutineType(types: !36)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
!1 = !DIFile(filename: "test.cc", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, unit: !0)
!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, type: !37, unit: !0)
!4 = !DILocation(line: 4, scope: !3)
!5 = !DILocation(line: 6, scope: !3)
; CHECK: ![[PROF]] = !{!"VP", i32 0, i64 3457, i64 9191153033785521275, i64 2059, i64 -1069303473483922844, i64 1398}
@ -204,33 +206,33 @@ attributes #0 = {"use-sample-profile"}
; CHECK: ![[BR2]] = !{!"branch_weights", i32 3000, i32 1000}
; CHECK: ![[VP]] = !{!"VP", i32 0, i64 8000, i64 7476224446746900038, i64 -1, i64 925324185419832389, i64 -1, i64 -6391416044382067764, i64 1000}
; CHECK: ![[BR3]] = !{!"branch_weights", i32 1, i32 0}
!6 = distinct !DISubprogram(name: "test_inline", scope: !1, file: !1, line: 6, unit: !0)
!6 = distinct !DISubprogram(name: "test_inline", scope: !1, file: !1, line: 6, type: !37, unit: !0)
!7 = !DILocation(line: 7, scope: !6)
!8 = distinct !DISubprogram(name: "test_inline_strip", scope: !1, file: !1, line: 8, unit: !0)
!8 = distinct !DISubprogram(name: "test_inline_strip", scope: !1, file: !1, line: 8, type: !37, unit: !0)
!9 = !DILocation(line: 9, scope: !8)
!10 = distinct !DISubprogram(name: "test_inline_strip_conflict", scope: !1, file: !1, line: 10, unit: !0)
!10 = distinct !DISubprogram(name: "test_inline_strip_conflict", scope: !1, file: !1, line: 10, type: !37, unit: !0)
!11 = !DILocation(line: 11, scope: !10)
!12 = distinct !DISubprogram(name: "test_noinline", scope: !1, file: !1, line: 12, unit: !0)
!12 = distinct !DISubprogram(name: "test_noinline", scope: !1, file: !1, line: 12, type: !37, unit: !0)
!13 = !DILocation(line: 13, scope: !12)
!14 = distinct !DISubprogram(name: "foo_inline1", scope: !1, file: !1, line: 11, unit: !0)
!15 = distinct !DISubprogram(name: "foo_inline_strip.suffix", scope: !1, file: !1, line: 1, unit: !0)
!16 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix1", scope: !1, file: !1, line: 1, unit: !0)
!17 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix2", scope: !1, file: !1, line: 1, unit: !0)
!18 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix3", scope: !1, file: !1, line: 1, unit: !0)
!19 = distinct !DISubprogram(name: "foo_inline2", scope: !1, file: !1, line: 19, unit: !0)
!20 = distinct !DISubprogram(name: "foo_noinline", scope: !1, file: !1, line: 20, unit: !0)
!21 = distinct !DISubprogram(name: "foo_direct", scope: !1, file: !1, line: 21, unit: !0)
!22 = distinct !DISubprogram(name: "test_direct", scope: !1, file: !1, line: 22, unit: !0)
!14 = distinct !DISubprogram(name: "foo_inline1", scope: !1, file: !1, line: 11, type: !37, unit: !0)
!15 = distinct !DISubprogram(name: "foo_inline_strip.suffix", scope: !1, file: !1, line: 1, type: !37, unit: !0)
!16 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix1", scope: !1, file: !1, line: 1, type: !37, unit: !0)
!17 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix2", scope: !1, file: !1, line: 1, type: !37, unit: !0)
!18 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix3", scope: !1, file: !1, line: 1, type: !37, unit: !0)
!19 = distinct !DISubprogram(name: "foo_inline2", scope: !1, file: !1, line: 19, type: !37, unit: !0)
!20 = distinct !DISubprogram(name: "foo_noinline", scope: !1, file: !1, line: 20, type: !37, unit: !0)
!21 = distinct !DISubprogram(name: "foo_direct", scope: !1, file: !1, line: 21, type: !37, unit: !0)
!22 = distinct !DISubprogram(name: "test_direct", scope: !1, file: !1, line: 22, type: !37, unit: !0)
!23 = !DILocation(line: 23, scope: !22)
!24 = distinct !DISubprogram(name: "test_norecursive_inline", scope: !1, file: !1, line: 12, unit: !0)
!24 = distinct !DISubprogram(name: "test_norecursive_inline", scope: !1, file: !1, line: 12, type: !37, unit: !0)
!25 = !DILocation(line: 13, scope: !24)
!26 = distinct !DISubprogram(name: "test_noinline_bitcast", scope: !1, file: !1, line: 12, unit: !0)
!26 = distinct !DISubprogram(name: "test_noinline_bitcast", scope: !1, file: !1, line: 12, type: !37, unit: !0)
!27 = !DILocation(line: 13, scope: !26)
!28 = distinct !DISubprogram(name: "foo_direct_i32", scope: !1, file: !1, line: 11, unit: !0)
!29 = distinct !DISubprogram(name: "return_arg", scope: !1, file: !1, line: 11, unit: !0)
!30 = distinct !DISubprogram(name: "return_arg_caller", scope: !1, file: !1, line: 11, unit: !0)
!28 = distinct !DISubprogram(name: "foo_direct_i32", scope: !1, file: !1, line: 11, type: !37, unit: !0)
!29 = distinct !DISubprogram(name: "return_arg", scope: !1, file: !1, line: 11, type: !37, unit: !0)
!30 = distinct !DISubprogram(name: "return_arg_caller", scope: !1, file: !1, line: 11, type: !37, unit: !0)
!31 = !DILocation(line: 12, scope: !30)
!32 = !DILocation(line: 13, scope: !30)
!33 = distinct !DISubprogram(name: "branch_prof_valid", scope: !1, file: !1, line: 25, unit: !0)
!33 = distinct !DISubprogram(name: "branch_prof_valid", scope: !1, file: !1, line: 25, type: !37, unit: !0)
!34 = !DILocation(line: 27, scope: !33)
!35 = distinct !DISubprogram(name: "foo_inline3", scope: !1, file: !1, line: 29, unit: !0)
!35 = distinct !DISubprogram(name: "foo_inline3", scope: !1, file: !1, line: 29, type: !37, unit: !0)

View file

@ -54,20 +54,22 @@ declare ptr @direct_leaf_func(ptr)
attributes #0 = {"use-sample-profile"}
!llvm.dbg.cu = !{!0}
!13 = !{null}
!14 = !DISubroutineType(types: !13)
!llvm.module.flags = !{!2}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
!1 = !DIFile(filename: "test.cc", directory: "/")
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = distinct !DISubprogram(name: "sample_loader_inlinee", scope: !1, file: !1, line: 11, spFlags: DISPFlagDefinition, unit: !0)
!3 = distinct !DISubprogram(name: "sample_loader_inlinee", scope: !1, file: !1, line: 11, spFlags: DISPFlagDefinition, type: !14, unit: !0)
!4 = !DILocation(line: 12, scope: !3)
!5 = !DILocation(line: 13, scope: !3)
!6 = distinct !DISubprogram(name: "cgscc_inlinee", scope: !1, file: !1, line: 31, spFlags: DISPFlagDefinition, unit: !0)
!6 = distinct !DISubprogram(name: "cgscc_inlinee", scope: !1, file: !1, line: 31, spFlags: DISPFlagDefinition, type: !14, unit: !0)
!7 = !DILocation(line: 32, scope: !6)
!8 = !DILocation(line: 33, scope: !6)
!9 = distinct !DISubprogram(name: "test_sample_loader_inline", scope: !1, file: !1, line: 3, spFlags: DISPFlagDefinition, unit: !0)
!9 = distinct !DISubprogram(name: "test_sample_loader_inline", scope: !1, file: !1, line: 3, spFlags: DISPFlagDefinition, type: !14, unit: !0)
!10 = !DILocation(line: 4, scope: !9)
!11 = distinct !DISubprogram(name: "test_cgscc_inline", scope: !1, file: !1, line: 20, spFlags: DISPFlagDefinition, unit: !0)
!11 = distinct !DISubprogram(name: "test_cgscc_inline", scope: !1, file: !1, line: 20, spFlags: DISPFlagDefinition, type: !14, unit: !0)
!12 = !DILocation(line: 21, scope: !11)
; Make sure the ImportGUID stays with entry count metadata for ThinLTO-PreLink

View file

@ -1231,6 +1231,8 @@ if.end: ; preds = %if.then1, %entry
declare i32 @read_memory_only() readonly nounwind willreturn speculatable
!llvm.dbg.cu = !{!0}
!12 = !{null}
!13 = !DISubroutineType(types: !12)
!llvm.module.flags = !{!2, !3}
!llvm.ident = !{!4}
@ -1240,7 +1242,7 @@ declare i32 @read_memory_only() readonly nounwind willreturn speculatable
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{!"clang"}
!5 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, unit: !0)
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !13, unit: !0)
!7 = !DILocation(line: 5, column: 7, scope: !6)
!8 = !DILocalVariable(name: "a", scope: !6, line: 6, type: !5)
!9 = distinct !DIAssignID()

View file

@ -69,7 +69,7 @@ declare void @_Z3bazv() #1
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{}
!6 = distinct !DISubprogram(unit: !0)
!6 = distinct !DISubprogram(type: !7, unit: !0)
!7 = !DISubroutineType(types: !2)
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}

View file

@ -29,15 +29,17 @@ define internal void @inlinable() !dbg !7 {
}
!llvm.dbg.cu = !{!0}
!9 = !{null}
!10 = !DISubroutineType(types: !9)
!llvm.module.flags = !{!4, !5, !6}
; CHECK: ![[DBGLOC]] = !DILocation(line: 0
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, runtimeVersion: 0, file: !3)
!1 = distinct !DISubprogram(name: "test", unit: !0)
!1 = distinct !DISubprogram(name: "test", type: !10, unit: !0)
!2 = !DILocation(line: 2, scope: !1)
!3 = !DIFile(filename: "foo", directory: ".")
!4 = !{i32 2, !"Dwarf Version", i32 4}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{i32 1, !"wchar_size", i32 4}
!7 = distinct !DISubprogram(name: "inlinable", unit: !0)
!7 = distinct !DISubprogram(name: "inlinable", type: !10, unit: !0)
!8 = !DILocation(line: 3, scope: !1)

View file

@ -531,6 +531,8 @@ sw.epilog: ; preds = %entry
}
!llvm.dbg.cu = !{!0}
!15 = !{null}
!16 = !DISubroutineType(types: !15)
!llvm.module.flags = !{!3, !4, !5}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, runtimeVersion: 0, emissionKind: FullDebug)
@ -538,7 +540,7 @@ sw.epilog: ; preds = %entry
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0)
!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, type: !16, unit: !0)
!12 = !DILocalVariable(name: "c", scope: !7)
!13 = !DIExpression()
!14 = !DILocation(line: 2, column: 12, scope: !7)

View file

@ -15,6 +15,8 @@ define void @func() {
}
!llvm.dbg.cu = !{!0, !1}
!12 = !{null}
!13 = !DISubroutineType(types: !12)
!llvm.module.flags = !{!10}
@ -23,13 +25,13 @@ define void @func() {
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !11)
!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !11)
!2 = distinct !DISubprogram(name: "func", unit: !0)
!2 = distinct !DISubprogram(name: "func", type: !13, unit: !0)
!3 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !2)
!4 = !DIDerivedType(tag: DW_TAG_member, scope: !3, baseType: !5)
!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6)
!6 = !DIBasicType(tag: DW_TAG_base_type)
!7 = !DILocalVariable(name: "a", type: !5, scope: !8)
!8 = distinct !DISubprogram(name: "func", unit: !1)
!8 = distinct !DISubprogram(name: "func", type: !13, unit: !1)
!9 = !DILocation(scope: !8)
!10 = !{i32 2, !"Debug Info Version", i32 3}

View file

@ -617,12 +617,14 @@ declare void @llvm.memmove.element.unordered.atomic.p0.p0.i64(ptr nocapture writ
declare void @bzero(ptr nocapture, i64) nofree nounwind
declare ptr @memset(ptr, i32, i64)
!8 = !{null}
!9 = !DISubroutineType(types: !8)
!llvm.module.flags = !{!1}
!0 = !{ !"auto-init" }
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3)
!3 = !DIFile(filename: "file", directory: "")
!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, unit: !2)
!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, type: !9, unit: !2)
!5 = !DIBasicType(name: "byte", size: 8)
!6 = !DILocalVariable(name: "destination", scope: !4, file: !3, type: !5)
!7 = !DILocalVariable(name: "destination2", scope: !4, file: !3, type: !5)

View file

@ -223,12 +223,14 @@ l2:
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone speculatable willreturn
!8 = !{null}
!9 = !DISubroutineType(types: !8)
!llvm.module.flags = !{!1}
!0 = !{ !"auto-init" }
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3)
!3 = !DIFile(filename: "file", directory: "")
!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, unit: !2)
!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, type: !9, unit: !2)
!5 = !DIBasicType(name: "int", size: 32)
!6 = !DILocalVariable(name: "destination", scope: !4, file: !3, type: !5)
!7 = !DILocalVariable(name: "destination2", scope: !4, file: !3, type: !5)

View file

@ -35,12 +35,14 @@ define void @unknown_intrinsic(ptr %dst) {
declare ptr @llvm.returnaddress(i32) nounwind readnone
!8 = !{null}
!9 = !DISubroutineType(types: !8)
!llvm.module.flags = !{!1}
!0 = !{ !"auto-init" }
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3)
!3 = !DIFile(filename: "file", directory: "")
!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, unit: !2)
!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, type: !9, unit: !2)
!5 = !DIBasicType(name: "byte", size: 8)
!6 = !DILocalVariable(name: "destination", scope: !4, file: !3, type: !5)
!7 = !DILocalVariable(name: "destination2", scope: !4, file: !3, type: !5)

View file

@ -77,18 +77,20 @@ declare void @llvm.assume(i1)
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{!"clang version 4.0.0 (trunk 278098)"}
!5 = distinct !DISubprogram(name: "call", linkageName: "_Z4callPv", scope: !1, file: !1, line: 29, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!5 = distinct !DISubprogram(name: "call", linkageName: "_Z4callPv", scope: !1, file: !1, line: 29, type: !15, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!6 = !DILocation(line: 30, column: 32, scope: !5)
!7 = distinct !DISubprogram(name: "vf", linkageName: "_ZN3vt12vfEv", scope: !1, file: !1, line: 13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!7 = distinct !DISubprogram(name: "vf", linkageName: "_ZN3vt12vfEv", scope: !1, file: !1, line: 13, type: !15, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!8 = !{i32 0, !"typeid"}
!9 = distinct !DISubprogram(name: "call2", linkageName: "_Z5call2Pv", scope: !1, file: !1, line: 40, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!9 = distinct !DISubprogram(name: "call2", linkageName: "_Z5call2Pv", scope: !1, file: !1, line: 40, type: !15, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!10 = !DILocation(line: 41, column: 32, scope: !9)
!11 = !{i32 0, !"typeid2"}
!12 = distinct !DISubprogram(name: "call3", linkageName: "_Z5call3Pv", scope: !1, file: !1, line: 50, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!12 = distinct !DISubprogram(name: "call3", linkageName: "_Z5call3Pv", scope: !1, file: !1, line: 50, type: !15, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!13 = !DILocation(line: 51, column: 32, scope: !12)
!14 = !{i32 0, !"typeid3"}
!15 = !DISubroutineType(types: !16)
!16 = !{null}
; CHECK: 1 wholeprogramdevirt - Number of whole program devirtualization targets
; CHECK: 3 wholeprogramdevirt - Number of single implementation devirtualizations

View file

@ -58,5 +58,7 @@ declare void @llvm.trap()
!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !6)
!6 = !DIFile(filename: "tmp.cc", directory: "")
!7 = !{i32 2, !"Debug Info Version", i32 3}
!10= distinct !DISubprogram(name: "func", scope: !6, file: !6, unit: !5)
!10= distinct !DISubprogram(name: "func", scope: !6, file: !6, unit: !5, type: !12)
!11 = !DILocation(line: 21, column: 3, scope: !10)
!12 = !DISubroutineType(types: !13)
!13 = !{null}

View file

@ -108,23 +108,25 @@ declare void @llvm.assume(i1)
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{!"clang version 4.0.0 (trunk 278098)"}
!5 = distinct !DISubprogram(name: "call", linkageName: "_Z4callPv", scope: !1, file: !1, line: 29, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!5 = distinct !DISubprogram(name: "call", linkageName: "_Z4callPv", scope: !1, file: !1, line: 29, type: !19, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!6 = !DILocation(line: 30, column: 32, scope: !5)
!7 = distinct !DISubprogram(name: "vf", linkageName: "_ZN3vt12vfEv", scope: !1, file: !1, line: 13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!7 = distinct !DISubprogram(name: "vf", linkageName: "_ZN3vt12vfEv", scope: !1, file: !1, line: 13, type: !19, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!8 = !{i32 0, !"typeid"}
!9 = distinct !DISubprogram(name: "call1", linkageName: "_Z5call1Pv", scope: !1, file: !1, line: 31, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!9 = distinct !DISubprogram(name: "call1", linkageName: "_Z5call1Pv", scope: !1, file: !1, line: 31, type: !19, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!10 = !DILocation(line: 35, column: 32, scope: !9)
!11 = distinct !DISubprogram(name: "vf_empty", linkageName: "_ZN3vt18vf_emptyEv", scope: !1, file: !1, line: 23, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!11 = distinct !DISubprogram(name: "vf_empty", linkageName: "_ZN3vt18vf_emptyEv", scope: !1, file: !1, line: 23, type: !19, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!12 = !{i32 0, !"typeid1"}
!13 = distinct !DISubprogram(name: "call2", linkageName: "_Z5call2Pv", scope: !1, file: !1, line: 40, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!13 = distinct !DISubprogram(name: "call2", linkageName: "_Z5call2Pv", scope: !1, file: !1, line: 40, type: !19, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!14 = !DILocation(line: 41, column: 32, scope: !13)
!15 = !{i32 0, !"typeid2"}
!16 = distinct !DISubprogram(name: "call3", linkageName: "_Z5call3Pv", scope: !1, file: !1, line: 50, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!16 = distinct !DISubprogram(name: "call3", linkageName: "_Z5call3Pv", scope: !1, file: !1, line: 50, type: !19, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!17 = !DILocation(line: 51, column: 32, scope: !16)
!18 = !{i32 0, !"typeid3"}
!19 = !DISubroutineType(types: !20)
!20 = !{null}

View file

@ -0,0 +1,47 @@
; Verify that DISubprogram requires a non-null DISubroutineType for its
; `type:` field. See https://github.com/llvm/llvm-project/issues/186557.
; RUN: llvm-as -disable-output < %s 2>&1 | FileCheck %s
; CHECK: DISubprogram requires a non-null type
; CHECK-NEXT: ![[MISSING:[0-9]+]] = distinct !DISubprogram(name: "missing_type"
; CHECK: DISubprogram requires a non-null type
; CHECK-NEXT: ![[NULL:[0-9]+]] = distinct !DISubprogram(name: "null_type"
; CHECK: invalid subroutine type
; CHECK-NEXT: ![[INVALID:[0-9]+]] = distinct !DISubprogram(name: "invalid_type"
; CHECK-NEXT: !{{[0-9]+}} = !DIFile(filename: "x.c", directory: "/")
; CHECK: warning: ignoring invalid debug info
; CHECK-NOT: valid_void_type
define void @missing_type() !dbg !4 {
ret void, !dbg !5
}
define void @null_type() !dbg !7 {
ret void, !dbg !8
}
define void @invalid_type() !dbg !9 {
ret void, !dbg !10
}
define void @valid_void_type() !dbg !11 {
ret void, !dbg !12
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!13}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", emissionKind: FullDebug)
!1 = !DIFile(filename: "x.c", directory: "/")
!2 = !{null}
!3 = !DISubroutineType(types: !2)
!4 = distinct !DISubprogram(name: "missing_type", scope: !1, file: !1, line: 1, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0)
!5 = !DILocation(line: 1, column: 1, scope: !4)
!7 = distinct !DISubprogram(name: "null_type", scope: !1, file: !1, line: 2, type: null, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0)
!8 = !DILocation(line: 2, column: 1, scope: !7)
!9 = distinct !DISubprogram(name: "invalid_type", scope: !1, file: !1, line: 3, type: !1, scopeLine: 3, spFlags: DISPFlagDefinition, unit: !0)
!10 = !DILocation(line: 3, column: 1, scope: !9)
!11 = distinct !DISubprogram(name: "valid_void_type", scope: !1, file: !1, line: 4, type: !3, scopeLine: 4, spFlags: DISPFlagDefinition, unit: !0)
!12 = !DILocation(line: 4, column: 1, scope: !11)
!13 = !{i32 1, !"Debug Info Version", i32 3}

Some files were not shown because too many files have changed in this diff Show more