diff --git a/lld/test/ELF/lto/pseudo-probe-lto.ll b/lld/test/ELF/lto/pseudo-probe-lto.ll --- a/lld/test/ELF/lto/pseudo-probe-lto.ll +++ b/lld/test/ELF/lto/pseudo-probe-lto.ll @@ -30,7 +30,9 @@ !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: !5, unit: !0) +!5 = !DISubroutineType(types: !6) +!6 = !{} !9 = !{i32 2, !"Dwarf Version", i32 4} !10 = !{i32 2, !"Debug Info Version", i32 3} !13 = !DILocation(line: 2, column: 20, scope: !4) diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -5467,7 +5467,7 @@ used for call site debug info. The ``retainedNodes:`` field is a list of :ref:`variables ` and :ref:`labels ` that must be retained, even if their IR counterparts are optimized out of the IR. The -``type:`` field must point at an :ref:`DISubroutineType`. +``type:`` field is required and must point at a :ref:`DISubroutineType`. .. _DISubprogramDeclaration: diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1676,6 +1676,7 @@ // Version 3 has the Unit as Record[15]. // Version 4 added thisAdjustment. // Version 5 repacked flags into DISPFlags, changing many element numbers. + // Version 6 upgrades a null type to !DISubroutineType(types: !{}) bool HasUnit = Record[0] & 2; if (!HasSPFlags && HasUnit && Record.size() < 19) return error("Invalid record"); @@ -1698,6 +1699,12 @@ HasThrownTypes = Record.size() >= 21; } Metadata *CUorFn = getMDOrNull(Record[12 + OffsetB]); + Metadata *Type = getMDOrNull(Record[6]); + if (!Type) { + Metadata *Types = MDTuple::get(Context, {}); + Type = + DISubroutineType::get(Context, DINode::DIFlags::FlagZero, 0, Types); + } DISubprogram *SP = GET_OR_DISTINCT( DISubprogram, (Context, @@ -1706,7 +1713,7 @@ getMDString(Record[3]), // linkageName getMDOrNull(Record[4]), // file Record[5], // line - getMDOrNull(Record[6]), // type + Type, // type Record[7 + OffsetA], // scopeLine getDITypeRefOrNull(Record[8 + OffsetA]), // containingType Record[10 + OffsetA], // virtualIndex diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1245,8 +1245,9 @@ AssertDI(isa(F), "invalid file", &N, F); else AssertDI(N.getLine() == 0, "line specified with no file", &N, N.getLine()); - if (auto *T = N.getRawType()) - AssertDI(isa(T), "invalid subroutine type", &N, T); + auto *T = N.getRawType(); + AssertDI(T, "subprogram must have a type", &N, T); + AssertDI(isa(T), "invalid subroutine type", &N, T); AssertDI(isType(N.getRawContainingType()), "invalid containing type", &N, N.getRawContainingType()); if (auto *Params = N.getRawTemplateParams()) diff --git a/llvm/test/Assembler/debug-info-source-invalid.ll b/llvm/test/Assembler/debug-info-source-invalid.ll --- a/llvm/test/Assembler/debug-info-source-invalid.ll +++ b/llvm/test/Assembler/debug-info-source-invalid.ll @@ -23,5 +23,7 @@ !3 = !DIFile(filename: "bar.h", directory: "dir") !4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2) -!5 = distinct !DISubprogram(name: "foo", file: !2, unit: !4) -!6 = distinct !DISubprogram(name: "bar", file: !3, unit: !4) +!5 = distinct !DISubprogram(name: "foo", file: !2, type: !7, unit: !4) +!6 = distinct !DISubprogram(name: "bar", file: !3, type: !7, unit: !4) +!7 = !DISubroutineType(types: !8) +!8 = !{} diff --git a/llvm/test/Assembler/debug-info-source.ll b/llvm/test/Assembler/debug-info-source.ll --- a/llvm/test/Assembler/debug-info-source.ll +++ b/llvm/test/Assembler/debug-info-source.ll @@ -8,15 +8,15 @@ ret void } -define dso_local void @bar() !dbg !7 { +define dso_local void @bar() !dbg !9 { ret void } -define dso_local void @baz() !dbg !9 { +define dso_local void @baz() !dbg !11 { ret void } -define dso_local void @qux() !dbg !11 { +define dso_local void @qux() !dbg !13 { ret void } @@ -31,11 +31,13 @@ !3 = !DIFile(filename: "qux.h", directory: "dir") !4 = !{i32 2, !"Dwarf Version", i32 5} !5 = !{i32 2, !"Debug Info Version", i32 3} -!6 = distinct !DISubprogram(name: "foo", file: !1, unit: !0) -!7 = distinct !DISubprogram(name: "bar", file: !8, unit: !0) -; CHECK: !8 = !DIFile(filename: "bar.h", directory: "dir", source: "void bar() { }\0A") -!8 = !DIFile(filename: "bar.h", directory: "dir", source: "void bar() { }\0A") -!9 = distinct !DISubprogram(name: "baz", file: !10, unit: !2) -; CHECK: !10 = !DIFile(filename: "baz.c", directory: "dir") -!10 = !DIFile(filename: "baz.c", directory: "dir") -!11 = distinct !DISubprogram(name: "qux", file: !3, unit: !2) +!6 = distinct !DISubprogram(name: "foo", file: !1, type: !7, unit: !0) +!7 = !DISubroutineType(types: !8) +!8 = !{} +!9 = distinct !DISubprogram(name: "bar", file: !10, type: !7, unit: !0) +; CHECK: !10 = !DIFile(filename: "bar.h", directory: "dir", source: "void bar() { }\0A") +!10 = !DIFile(filename: "bar.h", directory: "dir", source: "void bar() { }\0A") +!11 = distinct !DISubprogram(name: "baz", file: !12, type: !7, unit: !2) +; CHECK: !12 = !DIFile(filename: "baz.c", directory: "dir") +!12 = !DIFile(filename: "baz.c", directory: "dir") +!13 = distinct !DISubprogram(name: "qux", file: !3, type: !7, unit: !2) diff --git a/llvm/test/Assembler/dicompositetype-members.ll b/llvm/test/Assembler/dicompositetype-members.ll --- a/llvm/test/Assembler/dicompositetype-members.ll +++ b/llvm/test/Assembler/dicompositetype-members.ll @@ -2,7 +2,7 @@ ; RUN: verify-uselistorder %s ; Anchor the order of the nodes. -!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17} +!named = !{!0, !1, !2, !3, !4, !5, !6, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19} ; Some basic building blocks. ; CHECK: !0 = !DIBasicType @@ -17,38 +17,42 @@ ; 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: !7 = !DISubroutineType(types: !8) +; CHECK-NEXT: !8 = !{} +; CHECK-NEXT: !9 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !3, file: !1 !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, type: !7, isDefinition: false) +!7 = !DISubroutineType(types: !8) +!8 = !{} +!9 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !3, file: !1, type: !7, isDefinition: false) ; 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 -!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) +; 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 +; CHECK-NEXT: !14 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !10, file: !1 +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "no-uuid", file: !1, line: 2, size: 64, align: 32) +!11 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !10, file: !1, line: 4, baseType: !0, size: 32, align: 32, offset: 32) +!12 = !DIDerivedType(tag: DW_TAG_member, name: "field2", scope: !10, file: !1, line: 4, baseType: !0, size: 32, align: 32, offset: 32) +!13 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !10, file: !1, type: !7, isDefinition: false) +!14 = !DISubprogram(name: "foo", linkageName: "foo2", scope: !10, file: !1, type: !7, isDefinition: false) ; 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, -!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) +; 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, +!15 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !10, file: !2, line: 4, baseType: !0, size: 32, align: 32, offset: 32) +!16 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !10, file: !2, type: !7, isDefinition: false) ; 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) +!17 = !DIDerivedType(tag: DW_TAG_member, name: "field1", scope: !3, file: !2, line: 4, baseType: !0, size: 32, align: 32, offset: 32) +!18 = !DISubprogram(name: "foo", linkageName: "foo1", scope: !3, file: !2, type: !7, isDefinition: false) -; CHECK-NEXT: !15 = !{!4, !6} +; CHECK-NEXT: !17 = !{!4, !6} ; CHECK-NOT: !DIDerivedType ; CHECK-NOT: !DISubprogram -!17 = !{!15, !16} +!19 = !{!17, !18} diff --git a/llvm/test/Assembler/diimportedentity.ll b/llvm/test/Assembler/diimportedentity.ll --- a/llvm/test/Assembler/diimportedentity.ll +++ b/llvm/test/Assembler/diimportedentity.ll @@ -1,29 +1,30 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s ; RUN: verify-uselistorder %s -; CHECK: !named = !{!0, !3, !4, !5, !5} -!named = !{!0, !3, !4, !5, !6} +; CHECK: !named = !{!0, !5, !6, !7, !7} +!named = !{!0, !5, !6, !7, !8} -!llvm.module.flags = !{!7} -!llvm.dbg.cu = !{!1} +!llvm.module.flags = !{!9} +!llvm.dbg.cu = !{!3} ; CHECK: !0 = distinct !DISubprogram({{.*}}) -!0 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !1) - -!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", - file: !2, +!0 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !3, type: !1) +!1 = !DISubroutineType(types: !2) +!2 = !{} +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", + file: !4, isOptimized: true, flags: "-O2", splitDebugFilename: "abc.debug", emissionKind: 2) -!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") -; CHECK: !3 = !DICompositeType({{.*}}) -!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 32, align: 32) +!4 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") +; CHECK: !5 = !DICompositeType({{.*}}) +!5 = !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) -!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) +!6 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, + entity: !3, file: !4, line: 7) -; CHECK-NEXT: !5 = !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, +; CHECK-NEXT: !7 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0) +!7 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0) +!8 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "", scope: !0, entity: null, line: 0) -!7 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/Assembler/dilexicalblock.ll b/llvm/test/Assembler/dilexicalblock.ll --- a/llvm/test/Assembler/dilexicalblock.ll +++ b/llvm/test/Assembler/dilexicalblock.ll @@ -1,10 +1,10 @@ ; 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} -!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10} +; CHECK: !named = !{!0, !1, !2, !5, !6, !6, !7, !8, !9, !9, !10} +!named = !{!0, !1, !2, !5, !6, !7, !8, !9, !10, !11, !12} -!llvm.module.flags = !{!11} +!llvm.module.flags = !{!13} !llvm.dbg.cu = !{!0} !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", @@ -12,23 +12,25 @@ 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: !3) -; CHECK: !3 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35) -!3 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35) +; CHECK: !5 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = !DILexicalBlock(scope: !2, file: !1, line: 7, column: 35) -; CHECK: !4 = !DILexicalBlock(scope: !2) -!4 = !DILexicalBlock(scope: !2) -!5 = !DILexicalBlock(scope: !2, file: null, line: 0, column: 0) +; CHECK: !6 = !DILexicalBlock(scope: !2) +!6 = !DILexicalBlock(scope: !2) +!7 = !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) -!6 = !DILexicalBlockFile(scope: !3, file: !1, discriminator: 0) -!7 = !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) +!8 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 0) +!9 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 1) -; CHECK: !7 = !DILexicalBlockFile(scope: !3, discriminator: 7) -!8 = !DILexicalBlockFile(scope: !3, discriminator: 7) -!9 = !DILexicalBlockFile(scope: !3, file: null, discriminator: 7) -!10 = distinct !{} +; CHECK: !9 = !DILexicalBlockFile(scope: !5, discriminator: 7) +!10 = !DILexicalBlockFile(scope: !5, discriminator: 7) +!11 = !DILexicalBlockFile(scope: !5, file: null, discriminator: 7) +!12 = distinct !{} -!11 = !{i32 2, !"Debug Info Version", i32 3} +!13 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/Assembler/dilocalvariable-arg-large.ll b/llvm/test/Assembler/dilocalvariable-arg-large.ll --- a/llvm/test/Assembler/dilocalvariable-arg-large.ll +++ b/llvm/test/Assembler/dilocalvariable-arg-large.ll @@ -1,20 +1,22 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s ; RUN: verify-uselistorder %s -; CHECK: !named = !{!0, !3} -!named = !{!0, !3} +; CHECK: !named = !{!0, !5} +!named = !{!0, !5} -!llvm.module.flags = !{!4} -!llvm.dbg.cu = !{!1} +!llvm.module.flags = !{!6} +!llvm.dbg.cu = !{!3} -!0 = distinct !DISubprogram(unit: !1) -!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", - file: !2, +!0 = distinct !DISubprogram(unit: !3, type: !1) +!1 = !DISubroutineType(types: !2) +!2 = !{} +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", + file: !4, isOptimized: true, flags: "-O2", splitDebugFilename: "abc.debug", emissionKind: 2) -!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") +!4 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") -; CHECK: !3 = !DILocalVariable(name: "foo", arg: 65535, scope: !0) -!3 = !DILocalVariable(name: "foo", arg: 65535, scope: !0) +; CHECK: !5 = !DILocalVariable(name: "foo", arg: 65535, scope: !0) +!5 = !DILocalVariable(name: "foo", arg: 65535, scope: !0) -!4 = !{i32 2, !"Debug Info Version", i32 3} +!6 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/Assembler/dilocalvariable.ll b/llvm/test/Assembler/dilocalvariable.ll --- a/llvm/test/Assembler/dilocalvariable.ll +++ b/llvm/test/Assembler/dilocalvariable.ll @@ -3,33 +3,35 @@ @foo = global i32 0 -; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9} -!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, !3, !4, !5, !6, !7, !8, !9, !10, !11} -!llvm.module.flags = !{!10} -!llvm.dbg.cu = !{!1} +!llvm.module.flags = !{!12} +!llvm.dbg.cu = !{!3} -!0 = distinct !DISubprogram(unit: !1) -!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", - file: !2, +!0 = distinct !DISubprogram(unit: !3, type: !1) +!1 = !DISubroutineType(types: !2) +!2 = !{} +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", + file: !4, isOptimized: true, flags: "-O2", splitDebugFilename: "abc.debug", emissionKind: 2) -!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") -!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!4 = !DILocation(scope: !0) +!4 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") +!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !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) -!5 = !DILocalVariable(name: "foo", arg: 3, - scope: !0, file: !2, line: 7, type: !3, +; 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) +!7 = !DILocalVariable(name: "foo", arg: 3, + scope: !0, file: !4, line: 7, type: !5, flags: DIFlagArtificial, align: 32) -!6 = !DILocalVariable(name: "foo", scope: !0, - file: !2, line: 7, type: !3, flags: DIFlagArtificial) +!8 = !DILocalVariable(name: "foo", scope: !0, + file: !4, line: 7, type: !5, flags: DIFlagArtificial) -; CHECK: !7 = !DILocalVariable(arg: 1, scope: !0) -; CHECK: !8 = !DILocalVariable(scope: !0) -!7 = !DILocalVariable(scope: !0, arg: 1) -!8 = !DILocalVariable(scope: !0) -!9 = distinct !{} +; CHECK: !9 = !DILocalVariable(arg: 1, scope: !0) +; CHECK: !10 = !DILocalVariable(scope: !0) +!9 = !DILocalVariable(scope: !0, arg: 1) +!10 = !DILocalVariable(scope: !0) +!11 = distinct !{} -!10 = !{i32 2, !"Debug Info Version", i32 3} +!12 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/Assembler/dilocation.ll b/llvm/test/Assembler/dilocation.ll --- a/llvm/test/Assembler/dilocation.ll +++ b/llvm/test/Assembler/dilocation.ll @@ -1,40 +1,42 @@ ; 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} -!named = !{!0, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11} +; CHECK: !named = !{!0, !4, !5, !5, !6, !6, !7, !7, !8, !9, !10} +!named = !{!0, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13} -!llvm.module.flags = !{!12} -!llvm.dbg.cu = !{!1} +!llvm.module.flags = !{!14} +!llvm.dbg.cu = !{!3} ; CHECK: !0 = distinct !DISubprogram( -!0 = distinct !DISubprogram(unit: !1) -; CHECK: !1 = distinct !DICompileUnit -!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", - file: !2, +!0 = distinct !DISubprogram(unit: !3, type: !1) +!1 = !DISubroutineType(types: !2) +!2 = !{} +; CHECK: !3 = distinct !DICompileUnit +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", + file: !4, isOptimized: true, flags: "-O2", splitDebugFilename: "abc.debug", emissionKind: 2) -; CHECK: !2 = !DIFile -!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") +; CHECK: !4 = !DIFile +!4 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") -; CHECK-NEXT: !3 = !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: !5 = !DILocation(line: 3, column: 7, scope: !0) +!5 = !DILocation(line: 3, column: 7, scope: !0) +!6 = !DILocation(scope: !0, column: 7, line: 3) -; CHECK-NEXT: !4 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !3) -!5 = !DILocation(scope: !0, inlinedAt: !3, column: 7, line: 3) -!6 = !DILocation(column: 7, line: 3, scope: !0, inlinedAt: !3) +; CHECK-NEXT: !6 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !5) +!7 = !DILocation(scope: !0, inlinedAt: !5, column: 7, line: 3) +!8 = !DILocation(column: 7, line: 3, scope: !0, inlinedAt: !5) -; CHECK-NEXT: !5 = !DILocation(line: 0, scope: !0) -!7 = !DILocation(scope: !0) -!8 = !DILocation(scope: !0, column: 0, line: 0) +; CHECK-NEXT: !7 = !DILocation(line: 0, scope: !0) +!9 = !DILocation(scope: !0) +!10 = !DILocation(scope: !0, column: 0, line: 0) -; CHECK-NEXT: !6 = !DILocation(line: 4294967295, column: 65535, scope: !0) -!9 = !DILocation(line: 4294967295, column: 65535, scope: !0) +; CHECK-NEXT: !8 = !DILocation(line: 4294967295, column: 65535, scope: !0) +!11 = !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) +!12 = !DILocation(scope: !0, column: 0, line: 0, isImplicitCode: true) +!13 = !DILocation(scope: !0, column: 0, line: 1, isImplicitCode: false) +; CHECK-NEXT: !9 = !DILocation(line: 0, scope: !0, isImplicitCode: true) +; CHECK-NEXT: !10 = !DILocation(line: 1, scope: !0) -!12 = !{i32 2, !"Debug Info Version", i32 3} +!14 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/Assembler/disubprogram.ll b/llvm/test/Assembler/disubprogram.ll --- a/llvm/test/Assembler/disubprogram.ll +++ b/llvm/test/Assembler/disubprogram.ll @@ -17,66 +17,66 @@ !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, - file: !2, line: 7, type: !3, isLocal: true, - isDefinition: true, scopeLine: 8, - containingType: !4, - virtuality: DW_VIRTUALITY_pure_virtual, - virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, - isOptimized: true, unit: !8, templateParams: !5, - declaration: !9, retainedNodes: !6) + file: !2, line: 7, type: !3, isLocal: true, + isDefinition: true, scopeLine: 8, + containingType: !4, + virtuality: DW_VIRTUALITY_pure_virtual, + virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, + isOptimized: true, unit: !8, templateParams: !5, + declaration: !9, retainedNodes: !6) ; CHECK: !11 = distinct !DISubprogram ; CHECK-SAME: virtualIndex: 0, !11 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, - file: !2, line: 7, type: !3, isLocal: true, - isDefinition: true, scopeLine: 8, - containingType: !4, - virtuality: DW_VIRTUALITY_pure_virtual, - virtualIndex: 0, - flags: DIFlagPrototyped, isOptimized: true, - unit: !8, templateParams: !5, declaration: !9, - retainedNodes: !6) + file: !2, line: 7, type: !3, isLocal: true, + isDefinition: true, scopeLine: 8, + containingType: !4, + virtuality: DW_VIRTUALITY_pure_virtual, + virtualIndex: 0, + flags: DIFlagPrototyped, isOptimized: true, + unit: !8, templateParams: !5, declaration: !9, + retainedNodes: !6) ; CHECK: !12 = distinct !DISubprogram ; CHECK-NOT: virtualIndex !12 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, - file: !2, line: 7, type: !3, isLocal: true, - isDefinition: true, scopeLine: 8, - containingType: !4, - virtuality: DW_VIRTUALITY_none, - flags: DIFlagPrototyped, isOptimized: true, - unit: !8, - templateParams: !5, declaration: !9, retainedNodes: !6) + file: !2, line: 7, type: !3, isLocal: true, + isDefinition: true, scopeLine: 8, + containingType: !4, + virtuality: DW_VIRTUALITY_none, + flags: DIFlagPrototyped, isOptimized: true, + unit: !8, + templateParams: !5, declaration: !9, retainedNodes: !6) !13 = !{!4} ; CHECK: !13 = !{!4} ; CHECK: !14 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, line: 1, type: !3, scopeLine: 2, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !8, thrownTypes: !13) !14 = distinct !DISubprogram(name: "foo", scope: !1, - file: !2, line: 1, type: !3, isLocal: true, - isDefinition: true, scopeLine: 2, isOptimized: false, - unit: !8, thrownTypes: !13) + file: !2, line: 1, type: !3, isLocal: true, + isDefinition: true, scopeLine: 2, isOptimized: false, + unit: !8, thrownTypes: !13) ; CHECK: !15 = distinct !DISubprogram({{.*}}, flags: DIFlagPrototyped, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, !15 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, - file: !2, line: 7, type: !3, scopeLine: 8, - containingType: !4, virtualIndex: 0, - flags: DIFlagPrototyped, - spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, - unit: !8, templateParams: !5, declaration: !9, - retainedNodes: !6) + file: !2, line: 7, type: !3, scopeLine: 8, + containingType: !4, virtualIndex: 0, + flags: DIFlagPrototyped, + spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, + unit: !8, templateParams: !5, declaration: !9, + retainedNodes: !6) !16 = !{i32 1, !"Debug Info Version", i32 3} !llvm.module.flags = !{!16} diff --git a/llvm/test/Assembler/metadata.ll b/llvm/test/Assembler/metadata.ll --- a/llvm/test/Assembler/metadata.ll +++ b/llvm/test/Assembler/metadata.ll @@ -3,7 +3,7 @@ ; RUN: verify-uselistorder %s ; CHECK-UNMAT: @global = global i32 0, !foo [[M2:![0-9]+]], !foo [[M3:![0-9]+]], !baz [[M3]] -@global = global i32 0, !foo !2, !foo !3, !baz !3 +@global = global i32 0, !foo !4, !foo !5, !baz !5 ; CHECK-LABEL: @test ; CHECK: ret void, !foo [[M0:![0-9]+]], !bar [[M1:![0-9]+]] @@ -16,21 +16,21 @@ } ; CHECK: define void @test2() !foo [[M2]] !baz [[M3]] -define void @test2() !foo !2 !baz !3 { +define void @test2() !foo !4 !baz !5 { unreachable } ; CHECK: define void @test3() !bar [[M3]] ; CHECK: unreachable, !bar [[M4:![0-9]+]] -define void @test3() !bar !3 { - unreachable, !bar !4 +define void @test3() !bar !5 { + unreachable, !bar !6 } ; CHECK-LABEL: define void @test_attachment_name() { ; CHECK: unreachable, !\342abc [[M4]] define void @test_attachment_name() { ;; Escape the first character when printing text IR, since it's a digit - unreachable, !\34\32abc !4 + unreachable, !\34\32abc !6 } ; CHECK-UNMAT: [[M2]] = distinct !{} @@ -39,19 +39,21 @@ ; CHECK: [[M1]] = distinct !DISubprogram ; CHECK: [[M4]] = distinct !{} -!llvm.module.flags = !{!7} -!llvm.dbg.cu = !{!5} +!llvm.module.flags = !{!9} +!llvm.dbg.cu = !{!7} !0 = !DILocation(line: 662302, column: 26, scope: !1) -!1 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !5) -!2 = distinct !{} -!3 = distinct !{} +!1 = distinct !DISubprogram(name: "foo", isDefinition: true, unit: !7, type: !2) +!2 = !DISubroutineType(types: !3) +!3 = !{} !4 = distinct !{} -!5 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", - file: !6, +!5 = distinct !{} +!6 = distinct !{} +!7 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", + file: !8, isOptimized: true, flags: "-O2", splitDebugFilename: "abc.debug", emissionKind: 2) -!6 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") -!7 = !{i32 2, !"Debug Info Version", i32 3} +!8 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") +!9 = !{i32 2, !"Debug Info Version", i32 3} declare void @llvm.dbg.func.start(metadata) nounwind readnone diff --git a/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll b/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll --- a/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll +++ b/llvm/test/Bitcode/DILocalVariable-explicit-tags.ll @@ -10,13 +10,15 @@ !named = !{!0} -!llvm.module.flags = !{!6} -!llvm.dbg.cu = !{!4} +!llvm.module.flags = !{!8} +!llvm.dbg.cu = !{!6} -!0 = distinct !DISubprogram(name: "foo", scope: null, isLocal: false, isDefinition: true, isOptimized: false, 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}) -!5 = !DIFile(filename: "source.c", directory: "/dir") -!6 = !{i32 1, !"Debug Info Version", i32 3} +!0 = distinct !DISubprogram(name: "foo", scope: null, type: !1, isLocal: false, isDefinition: true, isOptimized: false, retainedNodes: !3) +!1 = !DISubroutineType(types: !2) +!2 = !{} +!3 = !{!4, !5} +!4 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "param", arg: 1, scope: !0) +!5 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "auto", scope: !0) +!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, subprograms: !{!0}) +!7 = !DIFile(filename: "source.c", directory: "/dir") +!8 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/llvm/test/Bitcode/DISubprogram-v4.ll b/llvm/test/Bitcode/DISubprogram-v4.ll --- a/llvm/test/Bitcode/DISubprogram-v4.ll +++ b/llvm/test/Bitcode/DISubprogram-v4.ll @@ -2,12 +2,12 @@ ; A 7.0 release version should work to recreate it if necessary. ; RUN: llvm-dis < %s.bc | FileCheck %s -; CHECK: define void @_Z3foov() !dbg !9 +; CHECK: define void @_Z3foov() !dbg !11 define void @_Z3foov() !dbg !9 { ret void } -; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18} +; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20} !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18} !0 = !{null} @@ -18,65 +18,65 @@ !5 = distinct !{} !6 = distinct !{} -; CHECK: !7 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !8) +; CHECK: !7 = distinct !DISubprogram(scope: null, type: !8, spFlags: DISPFlagDefinition, unit: !10) !7 = distinct !DISubprogram(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) +; CHECK: !11 = distinct !DISubprogram(scope: null, type: !8, spFlags: 0) !9 = distinct !DISubprogram(isDefinition: false) -; CHECK: !10 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, +; CHECK: !12 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: true, isDefinition: true, isOptimized: true, virtuality: DW_VIRTUALITY_pure_virtual, unit: !8) -; CHECK: !11 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, +; CHECK: !13 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, !11 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: true, isDefinition: true, isOptimized: true, virtuality: DW_VIRTUALITY_virtual, unit: !8) -; CHECK: !12 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, +; CHECK: !14 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, !12 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: true, isDefinition: true, isOptimized: true, virtuality: DW_VIRTUALITY_none, unit: !8) -; CHECK: !13 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagDefinition | DISPFlagOptimized, +; CHECK: !15 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagDefinition | DISPFlagOptimized, !13 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: false, isDefinition: true, isOptimized: true, unit: !8) -; CHECK: !14 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit | DISPFlagOptimized) +; CHECK: !16 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit | DISPFlagOptimized) !14 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: true, isDefinition: false, isOptimized: true) -; CHECK: !15 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, +; CHECK: !17 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, !15 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: true, isDefinition: true, isOptimized: false, unit: !8) -; CHECK: !16 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit) +; CHECK: !18 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagLocalToUnit) !16 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: true, isDefinition: false, isOptimized: false) -; CHECK: !17 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagDefinition, +; CHECK: !19 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagDefinition, !17 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !8) -; CHECK: !18 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagOptimized) +; CHECK: !20 = distinct !DISubprogram({{.*}}, spFlags: DISPFlagOptimized) !18 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, containingType: !4, isLocal: false, isDefinition: false, isOptimized: true) diff --git a/llvm/test/Bitcode/debug-loc-again.ll b/llvm/test/Bitcode/debug-loc-again.ll --- a/llvm/test/Bitcode/debug-loc-again.ll +++ b/llvm/test/Bitcode/debug-loc-again.ll @@ -12,10 +12,10 @@ define void @foo() { entry: - %a = add i32 0, 0, !dbg !3 - %b = add i32 0, 1, !dbg !3 - %c = add i32 0, 2, !dbg !4 - ret void, !dbg !4 + %a = add i32 0, 0, !dbg !5 + %b = add i32 0, 1, !dbg !5 + %c = add i32 0, 2, !dbg !6 + ret void, !dbg !6 } ; CHECK-LABEL: entry: @@ -31,6 +31,8 @@ !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) -!3 = !DILocation(line: 1, scope: !2) -!4 = !DILocation(line: 2, scope: !2) +!2 = distinct !DISubprogram(name: "foo", type: !3, unit: !1) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = !DILocation(line: 1, scope: !2) +!6 = !DILocation(line: 2, scope: !2) diff --git a/llvm/test/Bitcode/dityperefs-3.8.ll b/llvm/test/Bitcode/dityperefs-3.8.ll --- a/llvm/test/Bitcode/dityperefs-3.8.ll +++ b/llvm/test/Bitcode/dityperefs-3.8.ll @@ -15,16 +15,18 @@ ; CHECK-NEXT: !4 = !DISubroutineType(types: !5) ; CHECK-NEXT: !5 = !{!1, !2} ; CHECK-NEXT: !6 = !DISubprogram(scope: !1,{{.*}} containingType: !1{{[,)]}} -; CHECK-NEXT: !7 = !DILocalVariable(name: "V1", scope: !6, type: !2) -; CHECK-NEXT: !8 = !DIObjCProperty(name: "P1", type: !1) -; CHECK-NEXT: !9 = !DITemplateTypeParameter(type: !1) -; CHECK-NEXT: !10 = !DIGlobalVariable(name: "G",{{.*}} type: !1, -; CHECK-NEXT: !11 = !DITemplateValueParameter(type: !1, value: i32* @G1) -; CHECK-NEXT: !12 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "T2", scope: !0, entity: !1) -; CHECK-NEXT: !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "T3", file: !0, elements: !14, identifier: "T3") -; CHECK-NEXT: !14 = !{!15} -; CHECK-NEXT: !15 = !DISubprogram(scope: !13, -; CHECK-NEXT: !16 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type,{{.*}} extraData: !13) +; CHECK-NEXT: !7 = !DISubroutineType(types: !8) +; CHECK-NEXT: !8 = !{} +; CHECK-NEXT: !9 = !DILocalVariable(name: "V1", scope: !6, type: !2) +; CHECK-NEXT: !10 = !DIObjCProperty(name: "P1", type: !1) +; CHECK-NEXT: !11 = !DITemplateTypeParameter(type: !1) +; CHECK-NEXT: !12 = !DIGlobalVariable(name: "G",{{.*}} type: !1, +; CHECK-NEXT: !13 = !DITemplateValueParameter(type: !1, value: i32* @G1) +; CHECK-NEXT: !14 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "T2", scope: !0, entity: !1) +; CHECK-NEXT: !15 = !DICompositeType(tag: DW_TAG_structure_type, name: "T3", file: !0, elements: !16, identifier: "T3") +; CHECK-NEXT: !16 = !{!17} +; CHECK-NEXT: !17 = !DISubprogram(scope: !15, +; CHECK-NEXT: !18 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type,{{.*}} extraData: !15) !0 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "T1", file: !0, identifier: "T1") diff --git a/llvm/test/BugPoint/invalid-debuginfo.ll b/llvm/test/BugPoint/invalid-debuginfo.ll --- a/llvm/test/BugPoint/invalid-debuginfo.ll +++ b/llvm/test/BugPoint/invalid-debuginfo.ll @@ -19,4 +19,6 @@ !7 = !{i32 2, !"Dwarf Version", i32 4} !8 = !{i32 2, !"Debug Info Version", i32 3} -!9 = distinct !DISubprogram(unit: !0) +!9 = distinct !DISubprogram(unit: !0, type: !10) +!10 = !DISubroutineType(types: !11) +!11 = !{} diff --git a/llvm/test/CodeGen/AArch64/arm64-instruction-mix-remarks.ll b/llvm/test/CodeGen/AArch64/arm64-instruction-mix-remarks.ll --- a/llvm/test/CodeGen/AArch64/arm64-instruction-mix-remarks.ll +++ b/llvm/test/CodeGen/AArch64/arm64-instruction-mix-remarks.ll @@ -44,21 +44,21 @@ ; CHECK-NEXT: ; kill: def $w0 killed $w0 killed $x0 ; CHECK-NEXT: ret entry: - %l = load i32, i32* %ptr, !dbg !4 - %add = add i32 %l, %x, !dbg !4 - %add.ext = zext i32 %add to i64, !dbg !4 - %add.64 = add i64 %add.ext, %y, !dbg !4 - %c = icmp eq i64 %add.64, 999999, !dbg !4 - br i1 %c, label %then, label %else, !dbg !4 + %l = load i32, i32* %ptr, !dbg !6 + %add = add i32 %l, %x, !dbg !6 + %add.ext = zext i32 %add to i64, !dbg !6 + %add.64 = add i64 %add.ext, %y, !dbg !6 + %c = icmp eq i64 %add.64, 999999, !dbg !6 + br i1 %c, label %then, label %else, !dbg !6 then: - ret i32 %add, !dbg !5 + ret i32 %add, !dbg !7 else: - store i32 10, i32* %ptr, !dbg !6 - %res = mul i32 %add, %x, !dbg !6 - %res.2 = mul i32 %res, %x, !dbg !6 - ret i32 %res.2, !dbg !6 + store i32 10, i32* %ptr, !dbg !8 + %res = mul i32 %add, %x, !dbg !8 + %res.2 = mul i32 %res, %x, !dbg !8 + ret i32 %res.2, !dbg !8 } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!2} @@ -66,7 +66,9 @@ !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) -!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) +!3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, type: !4, scopeLine: 5, unit: !0) +!4 = !DISubroutineType(types: !5) +!5 = !{} +!6 = distinct !DILocation(line: 10, column: 10, scope: !3) +!7 = distinct !DILocation(line: 20, column: 20, scope: !3) +!8 = distinct !DILocation(line: 30, column: 30, scope: !3) diff --git a/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll b/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll --- a/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll +++ b/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll @@ -65,7 +65,7 @@ ; NO_HOTNESS: arm64-summary-remarks.ll:5:0: 1 instructions in function{{$}} -define void @empty_func() nounwind ssp !dbg !3 !prof !4 { +define void @empty_func() nounwind ssp !dbg !3 !prof !6 { ret void } @@ -75,5 +75,7 @@ !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) -!4 = !{!"function_entry_count", i64 33} +!3 = distinct !DISubprogram(name: "empty_func", scope: !1, file: !1, line: 5, type: !4, scopeLine: 5, unit: !0) +!4 = !DISubroutineType(types: !5) +!5 = !{} +!6 = !{!"function_entry_count", i64 33} diff --git a/llvm/test/CodeGen/AArch64/arm64-summary-remarks.ll b/llvm/test/CodeGen/AArch64/arm64-summary-remarks.ll --- a/llvm/test/CodeGen/AArch64/arm64-summary-remarks.ll +++ b/llvm/test/CodeGen/AArch64/arm64-summary-remarks.ll @@ -12,4 +12,6 @@ !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, type: !4, scopeLine: 5, unit: !0) +!4 = !DISubroutineType(types: !5) +!5 = !{} diff --git a/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll b/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll --- a/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll +++ b/llvm/test/CodeGen/AArch64/fast-isel-dbg.ll @@ -6,7 +6,7 @@ ; CHECK-LABEL: name: func ; CHECK: DBG_VALUE define void @func(i32 %a) !dbg !4 { - call void @llvm.dbg.declare(metadata i32 %a, metadata !5, metadata !DIExpression()), !dbg !7 + call void @llvm.dbg.declare(metadata i32 %a, metadata !7, metadata !DIExpression()), !dbg !9 ret void } @@ -20,7 +20,9 @@ !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) -!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) +!4 = distinct !DISubprogram(name: "func", type: !5, scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0) +!5 = !DISubroutineType(types: !6) +!6 = !{} +!7 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 17, type: !8) +!8 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned) +!9 = !DILocation(line: 17, scope: !4) diff --git a/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir b/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir --- a/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir +++ b/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir @@ -115,7 +115,7 @@ %tmp85 = fadd fast float %tmp84, undef %tmp86 = fmul float %tmp82, %tmp82 %tmp87 = fdiv float 1.000000e+00, %tmp86 - tail call void @llvm.dbg.value(metadata float %tmp87, metadata !5, metadata !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)) #3, !dbg !8 + tail call void @llvm.dbg.value(metadata float %tmp87, metadata !5, metadata !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)) #3, !dbg !9 %tmp88 = fmul float %tmp82, 0.000000e+00 %tmp89 = fsub fast float %tmp85, %tmp88 %tmp90 = fdiv float %tmp89, %tmp86 @@ -160,16 +160,17 @@ !2 = !{i32 2, !"Debug Info Version", i32 3} !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) - !7 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) - !8 = !DILocation(line: 102, column: 8, scope: !6) + !5 = !DILocalVariable(name: "bar", scope: !6, file: !1, line: 102, type: !8) + !6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, type: !7, line: 81, isLocal: false, isDefinition: true, scopeLine: 86, flags: DIFlagPrototyped, isOptimized: true, unit: !0) + !7 = !DISubroutineType(types: !3) + !8 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) + !9 = !DILocation(line: 102, column: 8, scope: !6) ... --- # 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 !9 name: sched_dbg_value_crash alignment: 1 @@ -319,7 +320,7 @@ %124:vgpr_32 = IMPLICIT_DEF %125:vgpr_32 = IMPLICIT_DEF %126:vgpr_32 = IMPLICIT_DEF - DBG_VALUE %103, _, !5, !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef), debug-location !8 + DBG_VALUE %103, _, !5, !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef), debug-location !9 ADJCALLSTACKUP 0, 0, implicit-def $scc, implicit-def $sgpr32, implicit $sgpr32 %127:sreg_64 = SI_PC_ADD_REL_OFFSET target-flags(amdgpu-rel32-lo) @func + 4, target-flags(amdgpu-rel32-hi) @func + 4, implicit-def dead $scc $sgpr4 = COPY $sgpr101 diff --git a/llvm/test/CodeGen/AMDGPU/vi-removed-intrinsics.ll b/llvm/test/CodeGen/AMDGPU/vi-removed-intrinsics.ll --- a/llvm/test/CodeGen/AMDGPU/vi-removed-intrinsics.ll +++ b/llvm/test/CodeGen/AMDGPU/vi-removed-intrinsics.ll @@ -21,4 +21,6 @@ !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, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0) +!6 = !DISubroutineType(types: !7) +!7 = !{} diff --git a/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir b/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir --- a/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir +++ b/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir @@ -15,7 +15,7 @@ %1 = bitcast [256 x i8]* %y.i to i8* call void @llvm.lifetime.end(i64 -1, i8* %1) #3 call void @llvm.lifetime.start(i64 -1, i8* %0) #3 - call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !DIExpression()) #3, !dbg !7 + call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !DIExpression()) #3, !dbg !8 br label %for.body } @@ -35,13 +35,14 @@ !1 = !DIFile(filename: "t.c", directory: "") !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) - !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) + !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !9) + !5 = distinct !DISubprogram(type: !6, scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0) + !6 = !DISubroutineType(types: !2) + !7 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) + !8 = !DILocation(line: 0, scope: !5) + !9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 2048, align: 8, elements: !10) + !10 = !{!11} + !11 = !DISubrange(count: 256) ... --- name: foo @@ -53,17 +54,17 @@ # 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: '!11' } stack: - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, debug-info-variable: '!4', debug-info-expression: '!DIExpression()', - debug-info-location: '!7' } + debug-info-location: '!8' } body: | bb.0.entry: successors: %bb.1.for.body bb.1.for.body: successors: %bb.1.for.body - DBG_VALUE %stack.0.y.i, 0, !4, !DIExpression(), debug-location !7 + DBG_VALUE %stack.0.y.i, 0, !4, !DIExpression(), debug-location !8 JMP_1 %bb.1.for.body ... diff --git a/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll b/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll --- a/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll +++ b/llvm/test/CodeGen/WebAssembly/lower-em-sjlj-debuginfo.ll @@ -10,11 +10,11 @@ define void @setjmp_debug_info0() !dbg !3 { ; CHECK-LABEL: @setjmp_debug_info0 entry: - %buf = alloca [1 x %struct.__jmp_buf_tag], align 16, !dbg !4 - %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* %buf, i32 0, i32 0, !dbg !5 - %call = call i32 @setjmp(%struct.__jmp_buf_tag* %arraydecay) #0, !dbg !6 - call void @foo(), !dbg !7 - ret void, !dbg !8 + %buf = alloca [1 x %struct.__jmp_buf_tag], align 16, !dbg !6 + %arraydecay = getelementptr inbounds [1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* %buf, i32 0, i32 0, !dbg !7 + %call = call i32 @setjmp(%struct.__jmp_buf_tag* %arraydecay) #0, !dbg !8 + call void @foo(), !dbg !9 + ret void, !dbg !10 ; CHECK: entry: ; CHECK-NEXT: call i8* @malloc(i32 40), !dbg ![[DL0:.*]] ; CHECK-NEXT: bitcast {{.*}}, !dbg ![[DL0]] @@ -47,7 +47,7 @@ ; and the called function (malloc / free) have DISubprograms, so the newly ; generated calls should have debug info attached. We don't have an instruction ; to take debug info from, so we create dummy debug info. -define void @setjmp_debug_info1() !dbg !9 { +define void @setjmp_debug_info1() !dbg !11 { ; CHECK-LABEL: @setjmp_debug_info1 entry: %buf = alloca [1 x %struct.__jmp_buf_tag], align 16 @@ -60,8 +60,8 @@ } ; Note that these functions have DISubprograms. -declare !dbg !10 i8* @malloc(i32) -declare !dbg !11 void @free(i8*) +declare !dbg !12 i8* @malloc(i32) +declare !dbg !13 void @free(i8*) declare void @foo() ; Function Attrs: returns_twice @@ -73,15 +73,17 @@ !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) -!4 = !DILocation(line:2, scope: !3) -!5 = !DILocation(line:3, scope: !3) -!6 = !DILocation(line:4, scope: !3) -!7 = !DILocation(line:5, scope: !3) -!8 = !DILocation(line:6, scope: !3) -!9 = distinct !DISubprogram(name: "setjmp_debug_info1", unit:!2, file: !1, line: 50) -!10 = !DISubprogram(name: "malloc", file: !1, line: 10, isDefinition: false) -!11 = !DISubprogram(name: "free", file: !1, line: 20, isDefinition: false) +!3 = distinct !DISubprogram(name: "setjmp_debug_info0", type: !4, unit:!2, file: !1, line: 1) +!4 = !DISubroutineType(types: !5) +!5 = !{} +!6 = !DILocation(line:2, scope: !3) +!7 = !DILocation(line:3, scope: !3) +!8 = !DILocation(line:4, scope: !3) +!9 = !DILocation(line:5, scope: !3) +!10 = !DILocation(line:6, scope: !3) +!11 = distinct !DISubprogram(name: "setjmp_debug_info1", type: !4, unit:!2, file: !1, line: 50) +!12 = !DISubprogram(name: "malloc", file: !1, line: 10, type: !4, isDefinition: false) +!13 = !DISubprogram(name: "free", file: !1, line: 20, type: !4, isDefinition: false) ; Dummy debug info generated -; CHECK: ![[DL_DUMMY]] = !DILocation(line: 50, column: 1, scope: !9) +; CHECK: ![[DL_DUMMY]] = !DILocation(line: 50, column: 1, scope: !11) diff --git a/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll b/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll --- a/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll +++ b/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll @@ -10,12 +10,12 @@ define hidden void @foo(i32* byval(i32) %dstRect) { ; CHECK-LABEL: name: foo entry: - call void @llvm.dbg.declare(metadata i32* %dstRect, metadata !3, metadata !DIExpression()), !dbg !5 + call void @llvm.dbg.declare(metadata i32* %dstRect, metadata !3, metadata !DIExpression()), !dbg !7 ; CHECK: fixedStack: ; 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 @@ !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) -!5 = !DILocation(line: 42, column: 85, scope: !4) +!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !0, file: !1, line: 42, type: !5, unit: !0) +!5 = !DISubroutineType(types: !6) +!6 = !{} +!7 = !DILocation(line: 42, column: 85, scope: !4) diff --git a/llvm/test/CodeGen/X86/tail-merge-debugloc.ll b/llvm/test/CodeGen/X86/tail-merge-debugloc.ll --- a/llvm/test/CodeGen/X86/tail-merge-debugloc.ll +++ b/llvm/test/CodeGen/X86/tail-merge-debugloc.ll @@ -17,11 +17,11 @@ bb2: %a1 = icmp eq i8* %p, null - br i1 %a1, label %bb4, label %bb5, !dbg !6 + br i1 %a1, label %bb4, label %bb5, !dbg !8 bb3: %a2 = icmp eq i8* %p, null - br i1 %a2, label %bb4, label %bb5, !dbg !6 + br i1 %a2, label %bb4, label %bb5, !dbg !8 bb4: ret i32 1 @@ -37,6 +37,8 @@ !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) -!5 = distinct !DILexicalBlock(scope: !4, file: !1, line: 1, column: 1) -!6 = !DILocation(line: 2, column: 2, scope: !5) +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0) +!5 = !DISubroutineType(types: !6) +!6 = !{} +!7 = distinct !DILexicalBlock(scope: !4, file: !1, line: 1, column: 1) +!8 = !DILocation(line: 2, column: 2, scope: !7) diff --git a/llvm/test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll b/llvm/test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll --- a/llvm/test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll +++ b/llvm/test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll @@ -14,7 +14,8 @@ !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(unit: !2, type: !7) +!7 = !DISubroutineType(types: !3) declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !5 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/llvm/test/DebugInfo/Generic/dbg-value-lower-linenos.ll b/llvm/test/DebugInfo/Generic/dbg-value-lower-linenos.ll --- a/llvm/test/DebugInfo/Generic/dbg-value-lower-linenos.ll +++ b/llvm/test/DebugInfo/Generic/dbg-value-lower-linenos.ll @@ -29,21 +29,21 @@ define i32 @foo(i32 *%bees, i32 *%output) { entry: %bar = alloca i32 - call void @llvm.dbg.declare(metadata i32 *%bar, metadata !7, metadata !DIExpression()), !dbg !6 + call void @llvm.dbg.declare(metadata i32 *%bar, metadata !9, metadata !DIExpression()), !dbg !8 store i32 0, i32 *%bar - br label %bb1, !dbg !6 + br label %bb1, !dbg !8 bb1: - %totest = load i32, i32 *%bees, !dbg !8 - %load1 = load i32, i32 *%bar, !dbg !9 - %add = add i32 %load1, 1, !dbg !10 - store i32 %add, i32 *%bar, !dbg !11 - %toret = add i32 %add, 2, !dbg !12 - %cond = icmp ult i32 %totest, %load1, !dbg !13 - br i1 %cond, label %bb1, label %bb2, !dbg !14 + %totest = load i32, i32 *%bees, !dbg !10 + %load1 = load i32, i32 *%bar, !dbg !11 + %add = add i32 %load1, 1, !dbg !12 + store i32 %add, i32 *%bar, !dbg !13 + %toret = add i32 %add, 2, !dbg !14 + %cond = icmp ult i32 %totest, %load1, !dbg !15 + br i1 %cond, label %bb1, label %bb2, !dbg !16 bb2: - store i32 %toret, i32 *%bar, !dbg !16 + store i32 %toret, i32 *%bar, !dbg !18 ret i32 %toret } @@ -62,15 +62,15 @@ ; CHECK-NEXT: dbg.value(metadata i32 %{{[0-9]+}}, metadata ![[MAPVAR]], ; CHECK-SAME: !dbg ![[UNKNOWN2]] -define void @bar(i32 %map) !dbg !20 { +define void @bar(i32 %map) !dbg !22 { entry: %map.addr = alloca i32, align 4 - store i32 %map, i32* %map.addr, align 4, !dbg !27 - call void @llvm.dbg.declare(metadata i32* %map.addr, metadata !21, metadata !DIExpression()), !dbg !22 - %call = call i32 (i32*, ...) bitcast (i32 (...)* @lookup to i32 (i32*, ...)*)(i32* %map.addr), !dbg !23 -%0 = load i32, i32* %map.addr, align 4, !dbg !24 - %call1 = call i32 (i32, ...) bitcast (i32 (...)* @verify to i32 (i32, ...)*)(i32 %0), !dbg !25 - ret void, !dbg !26 + store i32 %map, i32* %map.addr, align 4, !dbg !29 + call void @llvm.dbg.declare(metadata i32* %map.addr, metadata !23, metadata !DIExpression()), !dbg !24 + %call = call i32 (i32*, ...) bitcast (i32 (...)* @lookup to i32 (i32*, ...)*)(i32* %map.addr), !dbg !25 +%0 = load i32, i32* %map.addr, align 4, !dbg !26 + %call1 = call i32 (i32, ...) bitcast (i32 (...)* @verify to i32 (i32, ...)*)(i32 %0), !dbg !27 + ret void, !dbg !28 } declare void @llvm.dbg.value(metadata, metadata, metadata) @@ -91,23 +91,25 @@ !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) -!6 = !DILocation(line: 1, scope: !5) -!7 = !DILocalVariable(name: "flannel", scope: !5, type: null) -!8 = !DILocation(line: 2, scope: !5) -!9 = !DILocation(line: 3, scope: !5) -!10 = !DILocation(line: 4, scope: !5) -!11 = !DILocation(line: 5, scope: !5) -!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) -!16 = !DILocation(line: 9, scope: !15, inlinedAt: !14) -!20 = distinct !DISubprogram(name: "thin", scope: !3, file: !3, line: 20, unit: !2) -!21 = !DILocalVariable(name: "floogie", scope: !20, type: null) -!22 = !DILocation(line: 21, scope: !20) -!23 = !DILocation(line: 22, scope: !20) -!24 = !DILocation(line: 23, scope: !20) -!25 = !DILocation(line: 24, scope: !20) -!26 = !DILocation(line: 25, scope: !20) -!27 = !DILocation(line: 20, scope: !20) +!5 = distinct !DISubprogram(name: "nope", scope: !3, file: !3, line: 1, type: !6, unit: !2) +!6 = !DISubroutineType(types: !7) +!7 = !{} +!8 = !DILocation(line: 1, scope: !5) +!9 = !DILocalVariable(name: "flannel", scope: !5, type: null) +!10 = !DILocation(line: 2, scope: !5) +!11 = !DILocation(line: 3, scope: !5) +!12 = !DILocation(line: 4, scope: !5) +!13 = !DILocation(line: 5, scope: !5) +!14 = !DILocation(line: 6, scope: !5) +!15 = !DILocation(line: 7, scope: !5) +!16 = !DILocation(line: 8, scope: !5) +!17 = distinct !DISubprogram(name: "wat", scope: !2, file: !3, line: 10, type: !6, unit: !2) +!18 = !DILocation(line: 9, scope: !17, inlinedAt: !16) +!22 = distinct !DISubprogram(name: "thin", scope: !3, file: !3, line: 20, type: !6, unit: !2) +!23 = !DILocalVariable(name: "floogie", scope: !22, type: null) +!24 = !DILocation(line: 21, scope: !22) +!25 = !DILocation(line: 22, scope: !22) +!26 = !DILocation(line: 23, scope: !22) +!27 = !DILocation(line: 24, scope: !22) +!28 = !DILocation(line: 25, scope: !22) +!29 = !DILocation(line: 20, scope: !22) diff --git a/llvm/test/DebugInfo/Generic/invalid.ll b/llvm/test/DebugInfo/Generic/invalid.ll --- a/llvm/test/DebugInfo/Generic/invalid.ll +++ b/llvm/test/DebugInfo/Generic/invalid.ll @@ -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", type: !4, isDefinition: true) +!4 = !DISubroutineType(types: !5) +!5 = !{} +!6 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll b/llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll --- a/llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll +++ b/llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll @@ -5,75 +5,81 @@ !0 = distinct !DICompileUnit(language: 0, file: !1) !1 = !DIFile(filename: "-", directory: "") !2 = !{i32 2, !"Debug Info Version", i32 3} +!3 = !DISubroutineType(types: !4) +!4 = !{} ; CHECK: invalid file -define void @invalid_file() !dbg !3 { ret void } -!3 = distinct !DISubprogram(file: !0) +define void @invalid_file() !dbg !5 { ret void } +!5 = distinct !DISubprogram(file: !0) ; CHECK: line specified with no file -define void @line_specified_with_no_file() !dbg !4 { ret void } -!4 = distinct !DISubprogram(line: 1) +define void @line_specified_with_no_file() !dbg !6 { ret void } +!6 = distinct !DISubprogram(line: 1) + +; CHECK: subprogram must have a type +define void @subprogram_must_have_a_type() !dbg !7 { ret void } +!7 = distinct !DISubprogram() ; CHECK: invalid subroutine type -define void @invalid_subroutine_type() !dbg !5 { ret void } -!5 = distinct !DISubprogram(type: !0) +define void @invalid_subroutine_type() !dbg !8 { ret void } +!8 = distinct !DISubprogram(type: !0) ; CHECK: invalid containing type -define void @invalid_containing_type() !dbg !6 { ret void } -!6 = distinct !DISubprogram(containingType: !0) +define void @invalid_containing_type() !dbg !9 { ret void } +!9 = distinct !DISubprogram(type: !3, containingType: !0) ; CHECK: invalid template params -define void @invalid_template_params() !dbg !7 { ret void } -!7 = distinct !DISubprogram(templateParams: !0) +define void @invalid_template_params() !dbg !10 { ret void } +!10 = distinct !DISubprogram(type: !3, templateParams: !0) ; CHECK: invalid template parameter -define void @invalid_template_parameter() !dbg !8 { ret void } -!8 = distinct !DISubprogram(templateParams: !{!0}) +define void @invalid_template_parameter() !dbg !11 { ret void } +!11 = distinct !DISubprogram(type: !3, templateParams: !{!0}) ; CHECK: invalid subprogram declaration -define void @invalid_subprogram_declaration() !dbg !9 { ret void } -!9 = distinct !DISubprogram(declaration: !0) +define void @invalid_subprogram_declaration() !dbg !12 { ret void } +!12 = distinct !DISubprogram(type: !3, declaration: !0) ; CHECK: invalid retained nodes list -define void @invalid_retained_nodes_list() !dbg !10 { ret void } -!10 = distinct !DISubprogram(retainedNodes: !0) +define void @invalid_retained_nodes_list() !dbg !13 { ret void } +!13 = distinct !DISubprogram(type: !3, retainedNodes: !0) ; CHECK: invalid retained nodes, expected DILocalVariable or DILabel -define void @invalid_retained_nodes_expected() !dbg !11 { ret void } -!11 = distinct !DISubprogram(retainedNodes: !{!0}) +define void @invalid_retained_nodes_expected() !dbg !14 { ret void } +!14 = distinct !DISubprogram(type: !3, retainedNodes: !{!0}) ; CHECK: invalid reference flags -define void @invalid_reference_flags_reference() !dbg !12 { ret void } -!12 = distinct !DISubprogram(flags: DIFlagLValueReference | DIFlagRValueReference) +define void @invalid_reference_flags_reference() !dbg !15 { ret void } +!15 = distinct !DISubprogram(type: !3, flags: DIFlagLValueReference | DIFlagRValueReference) ; CHECK: invalid reference flags -define void @invalid_reference_flags_pass_by() !dbg !13 { ret void } -!13 = distinct !DISubprogram(flags: DIFlagTypePassByValue | DIFlagTypePassByReference) +define void @invalid_reference_flags_pass_by() !dbg !16 { ret void } +!16 = distinct !DISubprogram(type: !3, 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() +define void @subprogram_definitions_must_have_a_compile_unit() !dbg !17 { ret void } +!17 = distinct !DISubprogram(type: !3) ; CHECK: invalid unit type -define void @invalid_unit_type() !dbg !15 { ret void } -!15 = distinct !DISubprogram(unit: !{}) +define void @invalid_unit_type() !dbg !18 { ret void } +!18 = distinct !DISubprogram(type: !3, 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) +define void @subprogram_declarations_must_not_have_a_compile_unit() !dbg !19 { ret void } +!19 = distinct !DISubprogram(type: !3, 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) +define void @invalid_thrown_types_list() !dbg !20 { ret void } +!20 = distinct !DISubprogram(type: !3, isDefinition: false, thrownTypes: !0) ; CHECK: invalid thrown type -define void @invalid_thrown_type() !dbg !18 { ret void } -!18 = distinct !DISubprogram(isDefinition: false, thrownTypes: !{!0}) +define void @invalid_thrown_type() !dbg !21 { ret void } +!21 = distinct !DISubprogram(type: !3, 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) +define void @DIFlagAllCallsDescribed_must_be_attached_to_a_definition() !dbg !22 { ret void } +!22 = distinct !DISubprogram(type: !3, isDefinition: false, flags: DIFlagAllCallsDescribed) ; CHECK: warning: ignoring invalid debug info{{.*}} diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir --- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir +++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir @@ -44,42 +44,42 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable - define dso_local i32 @baa(i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4) local_unnamed_addr !dbg !9 { + define dso_local i32 @baa(i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4) local_unnamed_addr !dbg !10 { entry: %arg3.addr = alloca i32, align 4 %local2 = alloca i32, align 4 - call void @llvm.dbg.value(metadata i32 %arg1, metadata !14, metadata !DIExpression()), !dbg !21 - call void @llvm.dbg.value(metadata i32 %arg2, metadata !15, metadata !DIExpression()), !dbg !21 - call void @llvm.dbg.value(metadata i32 %arg3, metadata !16, metadata !DIExpression()), !dbg !21 + call void @llvm.dbg.value(metadata i32 %arg1, metadata !15, metadata !DIExpression()), !dbg !22 + call void @llvm.dbg.value(metadata i32 %arg2, metadata !16, metadata !DIExpression()), !dbg !22 + call void @llvm.dbg.value(metadata i32 %arg3, metadata !17, metadata !DIExpression()), !dbg !22 store i32 %arg3, i32* %arg3.addr, align 4 - call void @llvm.dbg.value(metadata i32 %arg4, metadata !17, metadata !DIExpression()), !dbg !21 - %0 = bitcast i32* %local2 to i8*, !dbg !21 - call void @llvm.dbg.value(metadata i32* %arg3.addr, metadata !16, metadata !DIExpression(DW_OP_deref)), !dbg !21 - %call = call i32 @foo(i32 %arg1, i32 %arg2, i32* nonnull %arg3.addr, i32 %arg4), !dbg !21 - call void @llvm.dbg.value(metadata i32 %call, metadata !18, metadata !DIExpression()), !dbg !21 - %cmp = icmp sgt i32 %arg1, %arg2, !dbg !21 - %1 = load i32, i32* %arg3.addr, align 4, !dbg !21 - call void @llvm.dbg.value(metadata i32 %1, metadata !16, metadata !DIExpression()), !dbg !21 - %add = add nsw i32 %1, %arg1, !dbg !21 - %add1 = add nsw i32 %arg4, %arg2, !dbg !21 - %local1.0 = select i1 %cmp, i32 %add, i32 %add1, !dbg !21 - call void @llvm.dbg.value(metadata i32 %local1.0, metadata !18, metadata !DIExpression()), !dbg !21 - %rem = srem i32 %1, %arg1, !dbg !21 - %tobool = icmp eq i32 %rem, 0, !dbg !21 - %mul = mul nsw i32 %1, %arg1, !dbg !21 - %add3 = add nsw i32 %1, %arg4, !dbg !21 - %storemerge = select i1 %tobool, i32 %mul, i32 %add3, !dbg !21 - call void @llvm.dbg.value(metadata i32 %storemerge, metadata !19, metadata !DIExpression()), !dbg !21 - store i32 %storemerge, i32* %local2, align 4, !dbg !21 - %cmp6 = icmp slt i32 %storemerge, %arg4, !dbg !21 - %local3.0.v = select i1 %cmp6, i32 %local1.0, i32 %arg1, !dbg !21 - %local3.0 = mul nsw i32 %local3.0.v, %storemerge, !dbg !21 - call void @llvm.dbg.value(metadata i32 %local3.0, metadata !20, metadata !DIExpression()), !dbg !21 - call void @llvm.dbg.value(metadata i32* %local2, metadata !19, metadata !DIExpression(DW_OP_deref)), !dbg !21 - %call12 = call i32 @foo(i32 %local1.0, i32 4, i32* nonnull %local2, i32 %local3.0), !dbg !21 - call void @llvm.dbg.value(metadata i32 %call12, metadata !14, metadata !DIExpression()), !dbg !21 - %add13 = add nsw i32 %call12, 4, !dbg !21 - ret i32 %add13, !dbg !21 + call void @llvm.dbg.value(metadata i32 %arg4, metadata !18, metadata !DIExpression()), !dbg !22 + %0 = bitcast i32* %local2 to i8*, !dbg !22 + call void @llvm.dbg.value(metadata i32* %arg3.addr, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !22 + %call = call i32 @foo(i32 %arg1, i32 %arg2, i32* nonnull %arg3.addr, i32 %arg4), !dbg !22 + call void @llvm.dbg.value(metadata i32 %call, metadata !19, metadata !DIExpression()), !dbg !22 + %cmp = icmp sgt i32 %arg1, %arg2, !dbg !22 + %1 = load i32, i32* %arg3.addr, align 4, !dbg !22 + call void @llvm.dbg.value(metadata i32 %1, metadata !17, metadata !DIExpression()), !dbg !22 + %add = add nsw i32 %1, %arg1, !dbg !22 + %add1 = add nsw i32 %arg4, %arg2, !dbg !22 + %local1.0 = select i1 %cmp, i32 %add, i32 %add1, !dbg !22 + call void @llvm.dbg.value(metadata i32 %local1.0, metadata !19, metadata !DIExpression()), !dbg !22 + %rem = srem i32 %1, %arg1, !dbg !22 + %tobool = icmp eq i32 %rem, 0, !dbg !22 + %mul = mul nsw i32 %1, %arg1, !dbg !22 + %add3 = add nsw i32 %1, %arg4, !dbg !22 + %storemerge = select i1 %tobool, i32 %mul, i32 %add3, !dbg !22 + call void @llvm.dbg.value(metadata i32 %storemerge, metadata !20, metadata !DIExpression()), !dbg !22 + store i32 %storemerge, i32* %local2, align 4, !dbg !22 + %cmp6 = icmp slt i32 %storemerge, %arg4, !dbg !22 + %local3.0.v = select i1 %cmp6, i32 %local1.0, i32 %arg1, !dbg !22 + %local3.0 = mul nsw i32 %local3.0.v, %storemerge, !dbg !22 + call void @llvm.dbg.value(metadata i32 %local3.0, metadata !21, metadata !DIExpression()), !dbg !22 + call void @llvm.dbg.value(metadata i32* %local2, metadata !20, metadata !DIExpression(DW_OP_deref)), !dbg !22 + %call12 = call i32 @foo(i32 %local1.0, i32 4, i32* nonnull %local2, i32 %local3.0), !dbg !22 + call void @llvm.dbg.value(metadata i32 %call12, metadata !15, metadata !DIExpression()), !dbg !22 + %add13 = add nsw i32 %call12, 4, !dbg !22 + ret i32 %add13, !dbg !22 } declare !dbg !4 dso_local i32 @foo(i32, i32, i32*, i32) local_unnamed_addr @@ -88,31 +88,32 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) !llvm.dbg.cu = !{!0} - !llvm.module.flags = !{!5, !6, !7} - !llvm.ident = !{!8} + !llvm.module.flags = !{!6, !7, !8} + !llvm.ident = !{!9} !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None) !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) - !5 = !{i32 2, !"Dwarf Version", i32 4} - !6 = !{i32 2, !"Debug Info Version", i32 3} - !7 = !{i32 1, !"wchar_size", i32 4} - !8 = !{!"clang version 9.0.0"} - !9 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 10, type: !10, scopeLine: 10, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13) - !10 = !DISubroutineType(types: !11) - !11 = !{!12, !12, !12, !12, !12} - !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) - !13 = !{!14, !15, !16, !17, !18, !19, !20} - !14 = !DILocalVariable(name: "arg1", arg: 1, scope: !9, file: !1, line: 10, type: !12) - !15 = !DILocalVariable(name: "arg2", arg: 2, scope: !9, file: !1, line: 10, type: !12) - !16 = !DILocalVariable(name: "arg3", arg: 3, scope: !9, file: !1, line: 10, type: !12) - !17 = !DILocalVariable(name: "arg4", arg: 4, scope: !9, file: !1, line: 10, type: !12) - !18 = !DILocalVariable(name: "local1", scope: !9, file: !1, line: 11, type: !12) - !19 = !DILocalVariable(name: "local2", scope: !9, file: !1, line: 11, type: !12) - !20 = !DILocalVariable(name: "local3", scope: !9, file: !1, line: 11, type: !12) - !21 = !DILocation(line: 10, column: 13, scope: !9) + !4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 9, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) + !5 = !DISubroutineType(types: !2) + !6 = !{i32 2, !"Dwarf Version", i32 4} + !7 = !{i32 2, !"Debug Info Version", i32 3} + !8 = !{i32 1, !"wchar_size", i32 4} + !9 = !{!"clang version 9.0.0"} + !10 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 10, type: !11, scopeLine: 10, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14) + !11 = !DISubroutineType(types: !12) + !12 = !{!13, !13, !13, !13, !13} + !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) + !14 = !{!15, !16, !17, !18, !19, !20, !21} + !15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 10, type: !13) + !16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 10, type: !13) + !17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 10, type: !13) + !18 = !DILocalVariable(name: "arg4", arg: 4, scope: !10, file: !1, line: 10, type: !13) + !19 = !DILocalVariable(name: "local1", scope: !10, file: !1, line: 11, type: !13) + !20 = !DILocalVariable(name: "local2", scope: !10, file: !1, line: 11, type: !13) + !21 = !DILocalVariable(name: "local3", scope: !10, file: !1, line: 11, type: !13) + !22 = !DILocation(line: 10, column: 13, scope: !10) ... --- @@ -137,10 +138,10 @@ bb.0.entry: liveins: $ecx, $edi, $edx, $esi, $r15, $r14, $rbx - DBG_VALUE $edi, $noreg, !14, !DIExpression(), debug-location !21 - DBG_VALUE $esi, $noreg, !15, !DIExpression(), debug-location !21 - DBG_VALUE $edx, $noreg, !16, !DIExpression(), debug-location !21 - DBG_VALUE $ecx, $noreg, !17, !DIExpression(), debug-location !21 + DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !22 + DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !22 + DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !22 + DBG_VALUE $ecx, $noreg, !18, !DIExpression(), debug-location !22 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp CFI_INSTRUCTION def_cfa_offset 16 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp @@ -153,52 +154,52 @@ CFI_INSTRUCTION offset $r14, -24 CFI_INSTRUCTION offset $r15, -16 $r14d = MOV32rr $ecx, implicit-def $r14 - DBG_VALUE $edx, $noreg, !16, !DIExpression(), debug-location !21 + DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !22 $r15d = MOV32rr $esi, implicit-def $r15 $ebx = MOV32rr $edi, implicit-def $rbx $edi = MOV32rr $esi MOV32mr $rsp, 1, $noreg, 8, $noreg, killed renamable $edx :: (store (s32) into %ir.arg3.addr) renamable $rdx = LEA64r $rsp, 1, $noreg, 8, $noreg renamable $ecx = MOV32rr $r14d, - CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, implicit-def $rax, debug-location !21 - DBG_VALUE $noreg, $noreg, !18, !DIExpression(), debug-location !21 + CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, implicit-def $rax, debug-location !22 + DBG_VALUE $noreg, $noreg, !19, !DIExpression(), debug-location !22 $rdx = MOV64rr renamable $rax $ecx = KILL renamable $ecx, implicit-def $rcx - renamable $eax = LEA64_32r renamable $rcx, 1, renamable $rbx, 0, $noreg, debug-location !21 - renamable $edi = LEA64_32r renamable $r14, 1, renamable $r15, 0, $noreg, debug-location !21 - CMP32rr renamable $ebx, renamable $r15d, implicit-def $eflags, implicit killed $r15, debug-location !21 - renamable $edi = CMOV32rr killed renamable $edi, killed renamable $eax, 15, implicit killed $eflags, debug-location !21 - DBG_VALUE $edi, $noreg, !18, !DIExpression(), debug-location !21 - $eax = MOV32rr $ecx, debug-location !21 - CDQ implicit-def $eax, implicit-def $edx, implicit $eax, debug-location !21 - IDIV32r renamable $ebx, implicit-def dead $eax, implicit-def $edx, implicit-def dead $eflags, implicit $eax, implicit $edx, debug-location !21 - $eax = MOV32rr $ecx, debug-location !21 - renamable $eax = nsw IMUL32rr killed renamable $eax, renamable $ebx, implicit-def dead $eflags, debug-location !21 - renamable $ecx = nsw ADD32rr renamable $ecx, renamable $r14d, implicit-def dead $eflags, implicit killed $rcx, implicit-def $rcx, debug-location !21 - TEST32rr killed renamable $edx, renamable $edx, implicit-def $eflags, debug-location !21 - renamable $ecx = CMOV32rr renamable $ecx, killed renamable $eax, 4, implicit killed $eflags, implicit killed $rcx, implicit-def $rcx, debug-location !21 - DBG_VALUE $ecx, $noreg, !19, !DIExpression(), debug-location !21 - MOV32mr $rsp, 1, $noreg, 12, $noreg, renamable $ecx, debug-location !21 :: (store (s32) into %ir.local2) - CMP32rr renamable $ecx, renamable $r14d, implicit-def $eflags, implicit killed $r14, debug-location !21 - renamable $ebx = CMOV32rr renamable $ebx, renamable $edi, 12, implicit killed $eflags, implicit killed $rbx, implicit-def $rbx, debug-location !21 - renamable $ecx = nsw IMUL32rr renamable $ecx, renamable $ebx, implicit-def dead $eflags, implicit killed $rbx, implicit killed $rcx, implicit-def $rcx, debug-location !21 - DBG_VALUE $rsp, $noreg, !19, !DIExpression(DW_OP_plus_uconst, 12, DW_OP_deref), debug-location !21 - DBG_VALUE $ecx, $noreg, !20, !DIExpression(), debug-location !21 - $esi = MOV32ri 4, debug-location !21 - renamable $ecx = MOV32rm $rsp, 1, $noreg, 8, $noreg, implicit-def $rcx, debug-location !21 :: (dereferenceable load (s32) from %ir.arg3.addr) - CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, implicit-def $rax, debug-location !21 - DBG_VALUE $eax, $noreg, !14, !DIExpression(), debug-location !21 - renamable $eax = nsw ADD32ri8 killed renamable $eax, 4, implicit-def dead $eflags, debug-location !21 - $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !21 - CFI_INSTRUCTION def_cfa_offset 32, debug-location !21 - $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !21 - CFI_INSTRUCTION def_cfa_offset 24, debug-location !21 - $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !21 - DBG_VALUE $ecx, $noreg, !17, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !21 - CFI_INSTRUCTION def_cfa_offset 16, debug-location !21 - $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !21 - DBG_VALUE $esi, $noreg, !15, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !21 - CFI_INSTRUCTION def_cfa_offset 8, debug-location !21 - RETQ $eax, debug-location !21 + renamable $eax = LEA64_32r renamable $rcx, 1, renamable $rbx, 0, $noreg, debug-location !22 + renamable $edi = LEA64_32r renamable $r14, 1, renamable $r15, 0, $noreg, debug-location !22 + CMP32rr renamable $ebx, renamable $r15d, implicit-def $eflags, implicit killed $r15, debug-location !22 + renamable $edi = CMOV32rr killed renamable $edi, killed renamable $eax, 15, implicit killed $eflags, debug-location !22 + DBG_VALUE $edi, $noreg, !19, !DIExpression(), debug-location !22 + $eax = MOV32rr $ecx, debug-location !22 + CDQ implicit-def $eax, implicit-def $edx, implicit $eax, debug-location !22 + IDIV32r renamable $ebx, implicit-def dead $eax, implicit-def $edx, implicit-def dead $eflags, implicit $eax, implicit $edx, debug-location !22 + $eax = MOV32rr $ecx, debug-location !22 + renamable $eax = nsw IMUL32rr killed renamable $eax, renamable $ebx, implicit-def dead $eflags, debug-location !22 + renamable $ecx = nsw ADD32rr renamable $ecx, renamable $r14d, implicit-def dead $eflags, implicit killed $rcx, implicit-def $rcx, debug-location !22 + TEST32rr killed renamable $edx, renamable $edx, implicit-def $eflags, debug-location !22 + renamable $ecx = CMOV32rr renamable $ecx, killed renamable $eax, 4, implicit killed $eflags, implicit killed $rcx, implicit-def $rcx, debug-location !22 + DBG_VALUE $ecx, $noreg, !20, !DIExpression(), debug-location !22 + MOV32mr $rsp, 1, $noreg, 12, $noreg, renamable $ecx, debug-location !22 :: (store (s32) into %ir.local2) + CMP32rr renamable $ecx, renamable $r14d, implicit-def $eflags, implicit killed $r14, debug-location !22 + renamable $ebx = CMOV32rr renamable $ebx, renamable $edi, 12, implicit killed $eflags, implicit killed $rbx, implicit-def $rbx, debug-location !22 + renamable $ecx = nsw IMUL32rr renamable $ecx, renamable $ebx, implicit-def dead $eflags, implicit killed $rbx, implicit killed $rcx, implicit-def $rcx, debug-location !22 + DBG_VALUE $rsp, $noreg, !20, !DIExpression(DW_OP_plus_uconst, 12, DW_OP_deref), debug-location !22 + DBG_VALUE $ecx, $noreg, !21, !DIExpression(), debug-location !22 + $esi = MOV32ri 4, debug-location !22 + renamable $ecx = MOV32rm $rsp, 1, $noreg, 8, $noreg, implicit-def $rcx, debug-location !22 :: (dereferenceable load (s32) from %ir.arg3.addr) + CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, implicit-def $rax, debug-location !22 + DBG_VALUE $eax, $noreg, !15, !DIExpression(), debug-location !22 + renamable $eax = nsw ADD32ri8 killed renamable $eax, 4, implicit-def dead $eflags, debug-location !22 + $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !22 + CFI_INSTRUCTION def_cfa_offset 32, debug-location !22 + $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !22 + CFI_INSTRUCTION def_cfa_offset 24, debug-location !22 + $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !22 + DBG_VALUE $ecx, $noreg, !18, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !22 + CFI_INSTRUCTION def_cfa_offset 16, debug-location !22 + $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !22 + DBG_VALUE $esi, $noreg, !16, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !22 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !22 + RETQ $eax, debug-location !22 ... diff --git a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir --- a/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir +++ b/llvm/test/DebugInfo/MIR/X86/dbgcall-site-lea-interpretation.mir @@ -39,50 +39,51 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" - define dso_local i32 @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr !dbg !10 { + define dso_local i32 @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr !dbg !11 { entry: %arg1.addr = alloca i32, align 4 %arg3.addr = alloca i32, align 4 %local1 = alloca i32, align 4 store i32 %arg1, i32* %arg1.addr, align 4 store i32 %arg3, i32* %arg3.addr, align 4 - %0 = bitcast i32* %local1 to i8*, !dbg !14 - %mul = mul nsw i32 %arg3, %arg1, !dbg !14 - store i32 %mul, i32* %local1, align 4, !dbg !14 - %add = add nsw i32 %arg2, %arg1, !dbg !14 - %sub = sub nsw i32 %add, %arg3, !dbg !14 - %call = call i32 @foo(i32 %mul, i32 %sub, i32* nonnull %local1, i32* nonnull %arg1.addr, i32* nonnull %arg3.addr, i32 %add), !dbg !14 - %1 = load i32, i32* %local1, align 4, !dbg !14 - %add2 = add nsw i32 %1, %call, !dbg !14 - store i32 %add2, i32* %local1, align 4, !dbg !14 - %call3 = call i32 @foo2(i32* nonnull %local1), !dbg !14 - %2 = load i32, i32* %local1, align 4, !dbg !14 - ret i32 %2, !dbg !14 + %0 = bitcast i32* %local1 to i8*, !dbg !15 + %mul = mul nsw i32 %arg3, %arg1, !dbg !15 + store i32 %mul, i32* %local1, align 4, !dbg !15 + %add = add nsw i32 %arg2, %arg1, !dbg !15 + %sub = sub nsw i32 %add, %arg3, !dbg !15 + %call = call i32 @foo(i32 %mul, i32 %sub, i32* nonnull %local1, i32* nonnull %arg1.addr, i32* nonnull %arg3.addr, i32 %add), !dbg !15 + %1 = load i32, i32* %local1, align 4, !dbg !15 + %add2 = add nsw i32 %1, %call, !dbg !15 + store i32 %add2, i32* %local1, align 4, !dbg !15 + %call3 = call i32 @foo2(i32* nonnull %local1), !dbg !15 + %2 = load i32, i32* %local1, align 4, !dbg !15 + ret i32 %2, !dbg !15 } declare !dbg !4 dso_local i32 @foo(i32, i32, i32*, i32*, i32*, i32) local_unnamed_addr - declare !dbg !5 dso_local i32 @foo2(i32*) local_unnamed_addr + declare !dbg !6 dso_local i32 @foo2(i32*) local_unnamed_addr !llvm.dbg.cu = !{!0} - !llvm.module.flags = !{!6, !7, !8} - !llvm.ident = !{!9} + !llvm.module.flags = !{!7, !8, !9} + !llvm.ident = !{!10} !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None) !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) - !6 = !{i32 2, !"Dwarf Version", i32 4} - !7 = !{i32 2, !"Debug Info Version", i32 3} - !8 = !{i32 1, !"wchar_size", i32 4} - !9 = !{!"clang version 9.0.0"} - !10 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 11, type: !11, scopeLine: 11, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) - !11 = !DISubroutineType(types: !12) - !12 = !{!13, !13, !13, !13} - !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) - !14 = !DILocation(line: 11, column: 13, scope: !10) + !3 = !{!4, !6} + !4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) + !5 = !DISubroutineType(types: !2) + !6 = !DISubprogram(name: "foo2", scope: !1, file: !1, line: 9, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) + !7 = !{i32 2, !"Dwarf Version", i32 4} + !8 = !{i32 2, !"Debug Info Version", i32 3} + !9 = !{i32 1, !"wchar_size", i32 4} + !10 = !{!"clang version 9.0.0"} + !11 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 11, type: !12, scopeLine: 11, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) + !12 = !DISubroutineType(types: !13) + !13 = !{!14, !14, !14, !14} + !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) + !15 = !DILocation(line: 11, column: 13, scope: !11) ... --- @@ -115,26 +116,26 @@ $r15 = MOV64rr $rdi MOV32mr $rsp, 1, $noreg, 12, $noreg, renamable $edi :: (store (s32) into %ir.arg1.addr) MOV32mr $rsp, 1, $noreg, 8, $noreg, renamable $edx :: (store (s32) into %ir.arg3.addr) - renamable $r9d = nsw ADD32rr killed renamable $r9d, renamable $edi, implicit-def dead $eflags, debug-location !14 - $esi = MOV32rr $r9d, debug-location !14 - renamable $esi = nsw SUB32rr killed renamable $esi, renamable $edx, implicit-def dead $eflags, debug-location !14 - renamable $edx = nsw IMUL32rr killed renamable $edx, killed renamable $edi, implicit-def dead $eflags, debug-location !14 - MOV32mr $rsp, 1, $noreg, 4, $noreg, renamable $edx, debug-location !14 :: (store (s32) into %ir.local1) + renamable $r9d = nsw ADD32rr killed renamable $r9d, renamable $edi, implicit-def dead $eflags, debug-location !15 + $esi = MOV32rr $r9d, debug-location !15 + renamable $esi = nsw SUB32rr killed renamable $esi, renamable $edx, implicit-def dead $eflags, debug-location !15 + renamable $edx = nsw IMUL32rr killed renamable $edx, killed renamable $edi, implicit-def dead $eflags, debug-location !15 + MOV32mr $rsp, 1, $noreg, 4, $noreg, renamable $edx, debug-location !15 :: (store (s32) into %ir.local1) renamable $rcx = LEA64r $r14, 1, $r15, 0, $noreg renamable $edi = LEA64_32r $r14, 2, $r15, 4, $noreg renamable $esi = LEA64_32r $r14, 1, $noreg, 0, $noreg renamable $rdx = LEA64r $r14, 4, $r14, 8, $noreg renamable $r8 = LEA64r $noreg, 2, $r15, 8, $noreg renamable $r9d = LEA64_32r $noreg, 1, $r15, 10, $noreg, implicit-def $r9d - CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $rcx, implicit $r8, implicit $r9d, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !14 - ADD32mr $rsp, 1, $noreg, 4, $noreg, killed renamable $eax, implicit-def dead $eflags, debug-location !14 :: (store (s32) into %ir.local1), (dereferenceable load (s32) from %ir.local1) + CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $rcx, implicit $r8, implicit $r9d, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !15 + ADD32mr $rsp, 1, $noreg, 4, $noreg, killed renamable $eax, implicit-def dead $eflags, debug-location !15 :: (store (s32) into %ir.local1), (dereferenceable load (s32) from %ir.local1) $rdi = LEA64r $r14, 1, killed $r14, 0, $noreg - CALL64pcrel32 @foo2, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eax, debug-location !14 - renamable $eax = MOV32rm $rsp, 1, $noreg, 4, $noreg, debug-location !14 :: (dereferenceable load (s32) from %ir.local1) - $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !14 - CFI_INSTRUCTION def_cfa_offset 16, debug-location !14 - $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !14 - CFI_INSTRUCTION def_cfa_offset 8, debug-location !14 - RETQ $eax, debug-location !14 + CALL64pcrel32 @foo2, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eax, debug-location !15 + renamable $eax = MOV32rm $rsp, 1, $noreg, 4, $noreg, debug-location !15 :: (dereferenceable load (s32) from %ir.local1) + $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !15 + CFI_INSTRUCTION def_cfa_offset 16, debug-location !15 + $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !15 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !15 + RETQ $eax, debug-location !15 ... diff --git a/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir b/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir --- a/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir +++ b/llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir @@ -15,8 +15,8 @@ # fn2 (a); # u --; #} -# CHECK: DBG_VALUE $edi, $noreg, !14, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}} -# CHECK-NOT: DBG_VALUE $esi, $noreg, !15, !DIExpression(DW_OP_LLVM_entry_value, 1) +# CHECK: DBG_VALUE $edi, $noreg, !15, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}} +# CHECK-NOT: DBG_VALUE $esi, $noreg, !16, !DIExpression(DW_OP_LLVM_entry_value, 1) --- | ; ModuleID = 'test.c' @@ -24,13 +24,13 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; Function Attrs: noinline nounwind uwtable - define dso_local void @fn1(i32 %x, i32 %y) local_unnamed_addr !dbg !9 { + define dso_local void @fn1(i32 %x, i32 %y) local_unnamed_addr !dbg !10 { entry: - call void @llvm.dbg.value(metadata i32 %x, metadata !14, metadata !DIExpression()), !dbg !18 - call void @llvm.dbg.value(metadata i32 %y, metadata !15, metadata !DIExpression()), !dbg !18 - call void @llvm.dbg.value(metadata i32 7, metadata !17, metadata !DIExpression()), !dbg !18 - tail call void @fn2(i32 7), !dbg !18 - ret void, !dbg !18 + call void @llvm.dbg.value(metadata i32 %x, metadata !15, metadata !DIExpression()), !dbg !19 + call void @llvm.dbg.value(metadata i32 %y, metadata !16, metadata !DIExpression()), !dbg !19 + call void @llvm.dbg.value(metadata i32 7, metadata !18, metadata !DIExpression()), !dbg !19 + tail call void @fn2(i32 7), !dbg !19 + ret void, !dbg !19 } declare !dbg !4 dso_local void @fn2(i32) local_unnamed_addr @@ -40,28 +40,29 @@ !llvm.dbg.cu = !{!0} - !llvm.module.flags = !{!5, !6, !7} - !llvm.ident = !{!8} + !llvm.module.flags = !{!6, !7, !8} + !llvm.ident = !{!9} !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None) !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) - !5 = !{i32 2, !"Dwarf Version", i32 4} - !6 = !{i32 2, !"Debug Info Version", i32 3} - !7 = !{i32 1, !"wchar_size", i32 4} - !8 = !{!"clang version 9.0.0"} - !9 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 15, type: !10, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13) - !10 = !DISubroutineType(types: !11) - !11 = !{null, !12, !12} - !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) - !13 = !{!14, !15, !16, !17} - !14 = !DILocalVariable(name: "x", arg: 1, scope: !9, file: !1, line: 15, type: !12) - !15 = !DILocalVariable(name: "y", arg: 2, scope: !9, file: !1, line: 15, type: !12) - !16 = !DILocalVariable(name: "u", scope: !9, file: !1, line: 16, type: !12) - !17 = !DILocalVariable(name: "a", scope: !9, file: !1, line: 21, type: !12) - !18 = !DILocation(line: 15, column: 10, scope: !9) + !4 = !DISubprogram(name: "fn2", scope: !1, file: !1, line: 11, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) + !5 = !DISubroutineType(types: !2) + !6 = !{i32 2, !"Dwarf Version", i32 4} + !7 = !{i32 2, !"Debug Info Version", i32 3} + !8 = !{i32 1, !"wchar_size", i32 4} + !9 = !{!"clang version 9.0.0"} + !10 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 15, type: !11, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14) + !11 = !DISubroutineType(types: !12) + !12 = !{null, !13, !13} + !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) + !14 = !{!15, !16, !17, !18} + !15 = !DILocalVariable(name: "x", arg: 1, scope: !10, file: !1, line: 15, type: !13) + !16 = !DILocalVariable(name: "y", arg: 2, scope: !10, file: !1, line: 15, type: !13) + !17 = !DILocalVariable(name: "u", scope: !10, file: !1, line: 16, type: !13) + !18 = !DILocalVariable(name: "a", scope: !10, file: !1, line: 21, type: !13) + !19 = !DILocation(line: 15, column: 10, scope: !10) ... --- @@ -71,10 +72,10 @@ liveins: [] body: | bb.0.entry: - DBG_VALUE $edi, $noreg, !14, !DIExpression(), debug-location !18 - DBG_VALUE $esi, $noreg, !15, !DIExpression(), debug-location !18 - DBG_VALUE 7, $noreg, !17, !DIExpression(), debug-location !18 - $edi = MOV32ri 7, debug-location !18 - TAILJMPd64 @fn2, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit killed $edi, debug-location !18 + DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !19 + DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !19 + DBG_VALUE 7, $noreg, !18, !DIExpression(), debug-location !19 + $edi = MOV32ri 7, debug-location !19 + TAILJMPd64 @fn2, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit killed $edi, debug-location !19 ... diff --git a/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir b/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir --- a/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir +++ b/llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir @@ -77,59 +77,60 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; Function Attrs: nounwind uwtable - define dso_local void @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr !dbg !10 { + define dso_local void @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr !dbg !11 { entry: %local1 = alloca i32, align 4 - call void @llvm.dbg.value(metadata i32 %arg1, metadata !15, metadata !DIExpression()), !dbg !19 - call void @llvm.dbg.value(metadata i32 %arg2, metadata !16, metadata !DIExpression()), !dbg !20 - call void @llvm.dbg.value(metadata i32 %arg3, metadata !17, metadata !DIExpression()), !dbg !21 - %0 = bitcast i32* %local1 to i8*, !dbg !22 - %call = tail call i32 (...) @getVal(), !dbg !23 - call void @llvm.dbg.value(metadata i32 %call, metadata !18, metadata !DIExpression()), !dbg !24 - store i32 %call, i32* %local1, align 4, !dbg !24 - %add = add nsw i32 %arg3, 3, !dbg !24 - %add1 = add nsw i32 %arg2, %arg1, !dbg !24 - call void @llvm.dbg.value(metadata i32* %local1, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !24 - call void @foo(i32* nonnull %local1, i32 %arg2, i32 10, i32 15, i32 %add, i32 %add1), !dbg !24 - ret void, !dbg !24 + call void @llvm.dbg.value(metadata i32 %arg1, metadata !16, metadata !DIExpression()), !dbg !20 + call void @llvm.dbg.value(metadata i32 %arg2, metadata !17, metadata !DIExpression()), !dbg !21 + call void @llvm.dbg.value(metadata i32 %arg3, metadata !18, metadata !DIExpression()), !dbg !22 + %0 = bitcast i32* %local1 to i8*, !dbg !23 + %call = tail call i32 (...) @getVal(), !dbg !24 + call void @llvm.dbg.value(metadata i32 %call, metadata !19, metadata !DIExpression()), !dbg !25 + store i32 %call, i32* %local1, align 4, !dbg !25 + %add = add nsw i32 %arg3, 3, !dbg !25 + %add1 = add nsw i32 %arg2, %arg1, !dbg !25 + call void @llvm.dbg.value(metadata i32* %local1, metadata !19, metadata !DIExpression(DW_OP_deref)), !dbg !25 + call void @foo(i32* nonnull %local1, i32 %arg2, i32 10, i32 15, i32 %add, i32 %add1), !dbg !25 + ret void, !dbg !25 } declare !dbg !4 dso_local i32 @getVal(...) local_unnamed_addr - declare !dbg !5 dso_local void @foo(i32*, i32, i32, i32, i32, i32) local_unnamed_addr + declare !dbg !6 dso_local void @foo(i32*, i32, i32, i32, i32, i32) local_unnamed_addr ; Function Attrs: nounwind readnone speculatable declare void @llvm.dbg.value(metadata, metadata, metadata) !llvm.dbg.cu = !{!0} - !llvm.module.flags = !{!6, !7, !8} - !llvm.ident = !{!9} + !llvm.module.flags = !{!7, !8, !9} + !llvm.ident = !{!10} !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None) !1 = !DIFile(filename: "test.c", directory: "/dir") !2 = !{} - !3 = !{!4, !5} - !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) - !6 = !{i32 2, !"Dwarf Version", i32 4} - !7 = !{i32 2, !"Debug Info Version", i32 3} - !8 = !{i32 1, !"wchar_size", i32 4} - !9 = !{!"clang version 9.0.0"} - !10 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 4, type: !11, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14) - !11 = !DISubroutineType(types: !12) - !12 = !{null, !13, !13, !13} - !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) - !14 = !{!15, !16, !17, !18} - !15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13) - !16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13) - !17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13) - !18 = !DILocalVariable(name: "local1", scope: !10, file: !1, line: 5, type: !13) - !19 = !DILocation(line: 4, column: 14, scope: !10) - !20 = !DILocation(line: 4, column: 24, scope: !10) - !21 = !DILocation(line: 4, column: 34, scope: !10) - !22 = !DILocation(line: 5, column: 3, scope: !10) - !23 = !DILocation(line: 5, column: 16, scope: !10) - !24 = !DILocation(line: 5, column: 7, scope: !10) + !3 = !{!4, !6} + !4 = !DISubprogram(name: "getVal", scope: !1, file: !1, line: 2, type: !5, spFlags: DISPFlagOptimized, retainedNodes: !2) + !5 = !DISubroutineType(types: !2) + !6 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) + !7 = !{i32 2, !"Dwarf Version", i32 4} + !8 = !{i32 2, !"Debug Info Version", i32 3} + !9 = !{i32 1, !"wchar_size", i32 4} + !10 = !{!"clang version 9.0.0"} + !11 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 4, type: !12, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15) + !12 = !DISubroutineType(types: !13) + !13 = !{null, !14, !14, !14} + !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) + !15 = !{!16, !17, !18, !19} + !16 = !DILocalVariable(name: "arg1", arg: 1, scope: !11, file: !1, line: 4, type: !14) + !17 = !DILocalVariable(name: "arg2", arg: 2, scope: !11, file: !1, line: 4, type: !14) + !18 = !DILocalVariable(name: "arg3", arg: 3, scope: !11, file: !1, line: 4, type: !14) + !19 = !DILocalVariable(name: "local1", scope: !11, file: !1, line: 5, type: !14) + !20 = !DILocation(line: 4, column: 14, scope: !11) + !21 = !DILocation(line: 4, column: 24, scope: !11) + !22 = !DILocation(line: 4, column: 34, scope: !11) + !23 = !DILocation(line: 5, column: 3, scope: !11) + !24 = !DILocation(line: 5, column: 16, scope: !11) + !25 = !DILocation(line: 5, column: 7, scope: !11) ... --- @@ -151,9 +152,9 @@ bb.0.entry: liveins: $edi, $edx, $esi, $r15, $r14, $rbx - DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !19 - DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !20 - DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !21 + DBG_VALUE $edi, $noreg, !16, !DIExpression(), debug-location !20 + DBG_VALUE $esi, $noreg, !17, !DIExpression(), debug-location !21 + DBG_VALUE $edx, $noreg, !18, !DIExpression(), debug-location !22 frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp CFI_INSTRUCTION def_cfa_offset 16 frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp @@ -168,29 +169,29 @@ $r14d = MOV32rr $edx, implicit-def $r14 $ebx = MOV32rr $esi, implicit-def $rbx $r15d = MOV32rr $edi, implicit-def $r15 - DBG_VALUE $r14d, $noreg, !17, !DIExpression(), debug-location !21 - DBG_VALUE $ebx, $noreg, !16, !DIExpression(), debug-location !20 - DBG_VALUE $r15d, $noreg, !15, !DIExpression(), debug-location !19 - dead $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags, implicit-def $al, debug-location !23 - CALL64pcrel32 @getVal, csr_64, implicit $rsp, implicit $ssp, implicit $al, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !23 - DBG_VALUE $eax, $noreg, !18, !DIExpression(), debug-location !24 - MOV32mr $rsp, 1, $noreg, 12, $noreg, killed renamable $eax, debug-location !24 :: (store (s32) into %ir.local1) - renamable $r8d = LEA64_32r killed renamable $r14, 1, $noreg, 3, $noreg, debug-location !24 - renamable $r9d = LEA64_32r killed renamable $r15, 1, renamable $rbx, 0, $noreg, debug-location !24 - DBG_VALUE $rsp, $noreg, !18, !DIExpression(DW_OP_plus_uconst, 12, DW_OP_deref), debug-location !24 + DBG_VALUE $r14d, $noreg, !18, !DIExpression(), debug-location !22 + DBG_VALUE $ebx, $noreg, !17, !DIExpression(), debug-location !21 + DBG_VALUE $r15d, $noreg, !16, !DIExpression(), debug-location !20 + dead $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags, implicit-def $al, debug-location !24 + CALL64pcrel32 @getVal, csr_64, implicit $rsp, implicit $ssp, implicit $al, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !24 + DBG_VALUE $eax, $noreg, !19, !DIExpression(), debug-location !25 + MOV32mr $rsp, 1, $noreg, 12, $noreg, killed renamable $eax, debug-location !25 :: (store (s32) into %ir.local1) + renamable $r8d = LEA64_32r killed renamable $r14, 1, $noreg, 3, $noreg, debug-location !25 + renamable $r9d = LEA64_32r killed renamable $r15, 1, renamable $rbx, 0, $noreg, debug-location !25 + DBG_VALUE $rsp, $noreg, !19, !DIExpression(DW_OP_plus_uconst, 12, DW_OP_deref), debug-location !25 renamable $rdi = LEA64r $rsp, 1, $noreg, 12, $noreg - $esi = MOV32rr $ebx, implicit killed $rbx, debug-location !24 - $edx = MOV32ri 10, debug-location !24 - $ecx = MOV32ri 15, debug-location !24 - CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit $esi, implicit $edx, implicit killed $ecx, implicit $r8d, implicit $r9d, implicit-def $rsp, implicit-def $ssp, debug-location !24 - $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !24 - CFI_INSTRUCTION def_cfa_offset 32, debug-location !24 - $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !24 - CFI_INSTRUCTION def_cfa_offset 24, debug-location !24 - $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !24 - CFI_INSTRUCTION def_cfa_offset 16, debug-location !24 - $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !24 - CFI_INSTRUCTION def_cfa_offset 8, debug-location !24 - RETQ debug-location !24 + $esi = MOV32rr $ebx, implicit killed $rbx, debug-location !25 + $edx = MOV32ri 10, debug-location !25 + $ecx = MOV32ri 15, debug-location !25 + CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit $esi, implicit $edx, implicit killed $ecx, implicit $r8d, implicit $r9d, implicit-def $rsp, implicit-def $ssp, debug-location !25 + $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !25 + CFI_INSTRUCTION def_cfa_offset 32, debug-location !25 + $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !25 + CFI_INSTRUCTION def_cfa_offset 24, debug-location !25 + $r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !25 + CFI_INSTRUCTION def_cfa_offset 16, debug-location !25 + $r15 = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !25 + CFI_INSTRUCTION def_cfa_offset 8, debug-location !25 + RETQ debug-location !25 ... diff --git a/llvm/test/DebugInfo/MIR/X86/machine-cse.mir b/llvm/test/DebugInfo/MIR/X86/machine-cse.mir --- a/llvm/test/DebugInfo/MIR/X86/machine-cse.mir +++ b/llvm/test/DebugInfo/MIR/X86/machine-cse.mir @@ -31,7 +31,7 @@ bb1: ; preds = %entry %2 = getelementptr inbounds %struct.s2, %struct.s2* null, i64 %0, i32 0 - call void @llvm.dbg.value(metadata i32* %2, metadata !4, metadata !DIExpression()), !dbg !7 + call void @llvm.dbg.value(metadata i32* %2, metadata !6, metadata !DIExpression()), !dbg !9 call void @bar(i32* %2) unreachable @@ -42,7 +42,7 @@ } ; This is a stub replicating bb structure of @t - define fastcc i8* @u(i32 %base) !dbg !33 { + define fastcc i8* @u(i32 %base) !dbg !35 { entry: br i1 undef, label %bb1, label %bb2 @@ -72,13 +72,15 @@ !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: !8) - !33 = distinct !DISubprogram(name: "alsonope", scope: !1, file: !2, line: 1, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !8) - !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} + !3 = distinct !DISubprogram(name: "nope", scope: !1, file: !2, line: 1, type: !4, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !10) + !4 = !DISubroutineType(types: !5) + !5 = !{} + !35 = distinct !DISubprogram(name: "alsonope", scope: !1, file: !2, line: 1, type: !4, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !10) + !6 = !DILocalVariable(name: "bees", scope: !3, type: !7) + !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64) + !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) + !9 = !DILocation(line: 0, scope: !3) + !10 = !{!6} ; CHECK: ![[METAVAR:[0-9]+]] = !DILocalVariable(name: "bees", @@ -127,7 +129,7 @@ %7:gr64_nosp = SHL64ri %100, 9, implicit-def dead $eflags %8:gr64 = LEA64r %7, 4, %7, 0, $noreg - DBG_VALUE %100, $noreg, !4, !DIExpression(), debug-location !7 + DBG_VALUE %100, $noreg, !6, !DIExpression(), debug-location !9 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp $rdi = COPY %8 CALL64pcrel32 @bar, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp @@ -143,7 +145,7 @@ ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp $rdi = COPY %1 - DBG_VALUE %100, $noreg, !4, !DIExpression(), debug-location !7 + DBG_VALUE %100, $noreg, !6, !DIExpression(), debug-location !9 CALL64pcrel32 @baz, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp @@ -193,7 +195,7 @@ %7:gr64_nosp = SHL64ri %100, 9, implicit-def dead $eflags %8:gr64 = LEA64r %7, 4, %7, 0, $noreg - DBG_VALUE %100, $noreg, !4, !DIExpression(), debug-location !7 + DBG_VALUE %100, $noreg, !6, !DIExpression(), debug-location !9 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp $rdi = COPY %8 CALL64pcrel32 @bar, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp @@ -211,7 +213,7 @@ ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp $rdi = COPY %100 - DBG_VALUE %100, $noreg, !4, !DIExpression(), debug-location !7 + DBG_VALUE %100, $noreg, !6, !DIExpression(), debug-location !9 CALL64pcrel32 @baz, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp diff --git a/llvm/test/DebugInfo/X86/pr40427.ll b/llvm/test/DebugInfo/X86/pr40427.ll --- a/llvm/test/DebugInfo/X86/pr40427.ll +++ b/llvm/test/DebugInfo/X86/pr40427.ll @@ -25,14 +25,14 @@ ; CHECK-NEXT: %{{[0-9]+}}:gr32 = IMPLICIT_DEF %foo = phi i64 *[%bees, %trueb], [%more, %falseb] %forks = bitcast i64 *%foo to i32 * - %ret = load i32, i32 *%forks, !dbg !6 - %cast = trunc i32 %ret to i16, !dbg !6 - call void @llvm.dbg.value(metadata i16 %cast, metadata !1, metadata !DIExpression()), !dbg !6 + %ret = load i32, i32 *%forks, !dbg !8 + %cast = trunc i32 %ret to i16, !dbg !8 + call void @llvm.dbg.value(metadata i16 %cast, metadata !1, metadata !DIExpression()), !dbg !8 %orly2 = add i16 %yellow, 1 br label %bb1 bb1: %cheese = add i16 %orly2, %cast - ret i16 %cheese, !dbg !6 + ret i16 %cheese, !dbg !8 } declare void @llvm.dbg.value(metadata, metadata, metadata) @@ -43,6 +43,8 @@ !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) -!6 = !DILocation(line: 0, scope: !5) -!7 = !DILocalVariable(name: "flannel", scope: !5, type: null) +!5 = distinct !DISubprogram(name: "nope", scope: !2, file: !3, line: 1, type: !6, unit: !2) +!6 = !DISubroutineType(types: !7) +!7 = !{} +!8 = !DILocation(line: 0, scope: !5) +!9 = !DILocalVariable(name: "flannel", scope: !5, type: null) diff --git a/llvm/test/DebugInfo/X86/sunk-compare.ll b/llvm/test/DebugInfo/X86/sunk-compare.ll --- a/llvm/test/DebugInfo/X86/sunk-compare.ll +++ b/llvm/test/DebugInfo/X86/sunk-compare.ll @@ -16,18 +16,18 @@ define i32 @_Z3fooii(i32 %x, i32 %y) !dbg !5 { entry: - %cmp17 = icmp sgt i32 %x, 0, !dbg !6 - br label %other.bb, !dbg !6 + %cmp17 = icmp sgt i32 %x, 0, !dbg !7 + br label %other.bb, !dbg !7 other.bb: - br i1 %cmp17, label %exit1.bb, label %exit2.bb, !dbg !7 + br i1 %cmp17, label %exit1.bb, label %exit2.bb, !dbg !8 exit1.bb: - %0 = add i32 %y, 42, !dbg !8 - ret i32 %0, !dbg !8 + %0 = add i32 %y, 42, !dbg !9 + ret i32 %0, !dbg !9 exit2.bb: - ret i32 44, !dbg !9 + ret i32 44, !dbg !10 } @@ -39,8 +39,9 @@ !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) -!6 = !DILocation(line: 2, column: 0, scope: !5) -!7 = !DILocation(line: 3, column: 0, scope: !5) -!8 = !DILocation(line: 4, column: 0, scope: !5) -!9 = !DILocation(line: 5, column: 0, scope: !5) +!5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) +!6 = !DISubroutineType(types: !2) +!7 = !DILocation(line: 2, column: 0, scope: !5) +!8 = !DILocation(line: 3, column: 0, scope: !5) +!9 = !DILocation(line: 4, column: 0, scope: !5) +!10 = !DILocation(line: 5, column: 0, scope: !5) diff --git a/llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll b/llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll --- a/llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll +++ b/llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll @@ -94,13 +94,13 @@ %AAA = alloca i32, align 4 ; File is not the same as !11 %BBB = alloca i32, align 4 ; File is the same as !11 %BBB.ptr = bitcast i32* %BBB to i8* - call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %BBB.ptr), !dbg !12 + call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %BBB.ptr), !dbg !14 store volatile i32 5, i32* %BBB, align 4 %AAA.ptr = bitcast i32* %AAA to i8* - call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %AAA.ptr), !dbg !14 + call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %AAA.ptr), !dbg !16 store volatile i32 3, i32* %AAA, align 4 - call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %AAA.ptr), !dbg !17 - call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %BBB.ptr), !dbg !18 + call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %AAA.ptr), !dbg !19 + call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %BBB.ptr), !dbg !20 ret void } @@ -111,12 +111,14 @@ !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) -!12 = !DILocation(line: 7, column: 3, scope: !11) -!18 = !DILocation(line: 10, column: 1, scope: !11) - -!21 = !DIFile(filename: "../file2.c", directory: "/") -!6 = distinct !DISubprogram(name: "Func4", scope: !1, file: !21, line: 2, 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) +!11 = distinct !DISubprogram(name: "Func5", scope: !1, file: !1, line: 6, type: !12, unit: !0) +!12 = !DISubroutineType(types: !13) +!13 = !{} +!14 = !DILocation(line: 7, column: 3, scope: !11) +!20 = !DILocation(line: 10, column: 1, scope: !11) + +!23 = !DIFile(filename: "../file2.c", directory: "/") +!6 = distinct !DISubprogram(name: "Func4", scope: !1, file: !23, line: 2, type: !12, unit: !0) +!17 = distinct !DILocation(line: 8, column: 3, scope: !11) +!16 = !DILocation(line: 3, column: 3, scope: !6, inlinedAt: !17) +!19 = !DILocation(line: 4, column: 1, scope: !6, inlinedAt: !17) diff --git a/llvm/test/Transforms/ArgumentPromotion/dbg.ll b/llvm/test/Transforms/ArgumentPromotion/dbg.ll --- a/llvm/test/Transforms/ArgumentPromotion/dbg.ll +++ b/llvm/test/Transforms/ArgumentPromotion/dbg.ll @@ -46,17 +46,19 @@ ; call void @test(i32** %Y), !dbg !1 - call void @test_byval(%struct.pair* byval(%struct.pair) align 4 %P), !dbg !6 + call void @test_byval(%struct.pair* byval(%struct.pair) align 4 %P), !dbg !8 ret void } !llvm.module.flags = !{!0} -!llvm.dbg.cu = !{!3} +!llvm.dbg.cu = !{!5} !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) -!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) +!2 = distinct !DISubprogram(name: "test", file: !7, line: 3, type: !3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !5, scopeLine: 3, scope: null) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !7) +!7 = !DIFile(filename: "test.c", directory: "") +!8 = !DILocation(line: 9, scope: !2) diff --git a/llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll b/llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll --- a/llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll +++ b/llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll @@ -16,8 +16,8 @@ define internal void @bar(i16* %p) { ; CHECK-LABEL: define {{.*}}void @bar() -; CHECK-NEXT: call void @llvm.dbg.value(metadata i16* undef, metadata !3, metadata !DIExpression()), !dbg !5 - call void @llvm.dbg.value(metadata i16* %p, metadata !3, metadata !DIExpression()), !dbg !5 +; CHECK-NEXT: call void @llvm.dbg.value(metadata i16* undef, metadata !3, metadata !DIExpression()), !dbg !7 + call void @llvm.dbg.value(metadata i16* %p, metadata !3, metadata !DIExpression()), !dbg !7 ret void } @@ -32,5 +32,7 @@ !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) -!5 = !DILocation(line: 1, column: 1, scope: !4) +!4 = distinct !DISubprogram(name: "bar", type: !5, scope: null, spFlags: DISPFlagDefinition, unit: !0) +!5 = !DISubroutineType(types: !6) +!6 = !{} +!7 = !DILocation(line: 1, column: 1, scope: !4) diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll @@ -46,25 +46,27 @@ ; call void @test(i32** %Y), !dbg !1 - call void @test_byval(%struct.pair* byval(%struct.pair) %P), !dbg !6 + call void @test_byval(%struct.pair* byval(%struct.pair) %P), !dbg !8 ret void } !llvm.module.flags = !{!0} -!llvm.dbg.cu = !{!3} +!llvm.dbg.cu = !{!5} !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) -!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) +!2 = distinct !DISubprogram(name: "test", file: !7, line: 3, type: !3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !5, scopeLine: 3, scope: null) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !7) +!7 = !DIFile(filename: "test.c", directory: "") +!8 = !DILocation(line: 9, scope: !2) ;. ; CHECK: [[META0:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} ; CHECK: [[META1:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly) ; CHECK: [[META2:![0-9]+]] = !DIFile(filename: "test.c", directory: "") -; CHECK: [[DBG3]] = distinct !DISubprogram(name: "test", scope: null, file: !2, line: 3, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +; CHECK: [[DBG3]] = distinct !DISubprogram(name: "test", scope: null, file: !2, line: 3, type: !4, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) ; CHECK: [[META4:![0-9]+]] = !DILocation(line: 8, scope: !3) ; CHECK: [[META5:![0-9]+]] = !DILocation(line: 9, scope: !3) ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll @@ -46,7 +46,7 @@ ; IS__CGSCC____-NEXT: call void @llvm.dbg.value(metadata i16* [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()) #[[ATTR3:[0-9]+]], !dbg [[DBG5:![0-9]+]] ; IS__CGSCC____-NEXT: ret void ; - call void @llvm.dbg.value(metadata %p_t %p, metadata !4, metadata !5), !dbg !6 + call void @llvm.dbg.value(metadata %p_t %p, metadata !3, metadata !7), !dbg !8 ret void } @@ -58,10 +58,12 @@ !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) -!4 = !DILocalVariable(name: "p", scope: !3) -!5 = !DIExpression() -!6 = !DILocation(line: 1, column: 1, scope: !3) +!3 = !DILocalVariable(name: "p", scope: !4) +!4 = distinct !DISubprogram(name: "bar", type: !5, unit: !0) +!5 = !DISubroutineType(types: !6) +!6 = !{} +!7 = !DIExpression() +!8 = !DILocation(line: 1, column: 1, scope: !4) ;. ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn } @@ -76,6 +78,6 @@ ; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "") ; CHECK: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} ; CHECK: [[META3:![0-9]+]] = !DILocalVariable(name: "p", scope: !4) -; CHECK: [[META4:![0-9]+]] = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: !0) +; CHECK: [[META4:![0-9]+]] = distinct !DISubprogram(name: "bar", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !0) ; CHECK: [[META5:![0-9]+]] = !DILocation(line: 1, column: 1, scope: !4) ;. diff --git a/llvm/test/Transforms/Inline/debug-invoke.ll b/llvm/test/Transforms/Inline/debug-invoke.ll --- a/llvm/test/Transforms/Inline/debug-invoke.ll +++ b/llvm/test/Transforms/Inline/debug-invoke.ll @@ -13,13 +13,13 @@ attributes #0 = { alwaysinline } define void @inl() #0 { - call void @test(), !dbg !3 + call void @test(), !dbg !5 ret void } define void @caller() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { invoke void @inl() - to label %cont unwind label %lpad, !dbg !4 + to label %cont unwind label %lpad, !dbg !6 cont: ret void @@ -31,14 +31,16 @@ } !llvm.module.flags = !{!1} -!llvm.dbg.cu = !{!5} +!llvm.dbg.cu = !{!7} !1 = !{i32 2, !"Debug Info Version", i32 3} -!2 = distinct !DISubprogram(unit: !5) -!3 = !DILocation(line: 1, scope: !2) -!4 = !DILocation(line: 2, scope: !2) -!5 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", - file: !6, +!2 = distinct !DISubprogram(unit: !7, type: !3) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = !DILocation(line: 1, scope: !2) +!6 = !DILocation(line: 2, scope: !2) +!7 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", + file: !8, isOptimized: true, flags: "-O2", splitDebugFilename: "abc.debug", emissionKind: 2) -!6 = !DIFile(filename: "path/davidino", directory: "/path/to/dir") +!8 = !DIFile(filename: "path/davidino", directory: "/path/to/dir") diff --git a/llvm/test/Transforms/InstCombine/assume.ll b/llvm/test/Transforms/InstCombine/assume.ll --- a/llvm/test/Transforms/InstCombine/assume.ll +++ b/llvm/test/Transforms/InstCombine/assume.ll @@ -416,11 +416,11 @@ %cmp1 = icmp eq i8 %x, 0 %cmp2 = icmp ne i8 %x, 0 tail call void @llvm.assume(i1 %cmp1) - tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !9 + tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !11 tail call void @llvm.assume(i1 %cmp1) - tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !9 + tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !11 tail call void @llvm.assume(i1 %cmp2) - tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !9 + tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !11 tail call void @llvm.assume(i1 %cmp2) ret void } @@ -801,17 +801,19 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) !llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!5, !6, !7, !8} +!llvm.module.flags = !{!7, !8, !9, !10} -!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "Me", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: null, retainedTypes: null, imports: null) +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !5, 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) -!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) +!2 = distinct !DISubprogram(name: "debug", linkageName: "debug", scope: null, file: null, line: 0, type: !3, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = !DIFile(filename: "consecutive-fences.ll", directory: "") +!7 = !{i32 2, !"Dwarf Version", i32 4} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"wchar_size", i32 4} +!10 = !{i32 7, !"PIC Level", i32 2} +!11 = !DILocation(line: 0, column: 0, scope: !2) attributes #0 = { nounwind uwtable } diff --git a/llvm/test/Transforms/InstCombine/consecutive-fences.ll b/llvm/test/Transforms/InstCombine/consecutive-fences.ll --- a/llvm/test/Transforms/InstCombine/consecutive-fences.ll +++ b/llvm/test/Transforms/InstCombine/consecutive-fences.ll @@ -52,7 +52,7 @@ ; CHECK: fence seq_cst define void @debug() { fence seq_cst - tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !9 + tail call void @llvm.dbg.value(metadata i32 5, metadata !1, metadata !DIExpression()), !dbg !11 fence seq_cst ret void } @@ -60,14 +60,16 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) !llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!5, !6, !7, !8} +!llvm.module.flags = !{!7, !8, !9, !10} -!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "Me", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: null, retainedTypes: null, imports: null) +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !5, 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) -!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) +!2 = distinct !DISubprogram(name: "debug", linkageName: "debug", scope: null, file: null, line: 0, type: !3, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0) +!3 = !DISubroutineType(types: !4) +!4 = !{} +!5 = !DIFile(filename: "consecutive-fences.ll", directory: "") +!7 = !{i32 2, !"Dwarf Version", i32 4} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"wchar_size", i32 4} +!10 = !{i32 7, !"PIC Level", i32 2} +!11 = !DILocation(line: 0, column: 0, scope: !2) diff --git a/llvm/test/Transforms/LoopVectorize/discriminator.ll b/llvm/test/Transforms/LoopVectorize/discriminator.ll --- a/llvm/test/Transforms/LoopVectorize/discriminator.ll +++ b/llvm/test/Transforms/LoopVectorize/discriminator.ll @@ -19,26 +19,26 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 define void @_Z3foov() local_unnamed_addr #0 !dbg !6 { - %1 = load i32*, i32** @b, align 8, !dbg !8, !tbaa !9 - %2 = load i32*, i32** @a, align 8, !dbg !13, !tbaa !9 - br label %3, !dbg !14 + %1 = load i32*, i32** @b, align 8, !dbg !9, !tbaa !10 + %2 = load i32*, i32** @a, align 8, !dbg !14, !tbaa !10 + br label %3, !dbg !15 ;