diff options
Diffstat (limited to 'test/DebugInfo/X86')
165 files changed, 1853 insertions, 735 deletions
| diff --git a/test/DebugInfo/X86/2010-04-13-PubType.ll b/test/DebugInfo/X86/2010-04-13-PubType.ll index 4688f959fbdb..820086af9f1b 100644 --- a/test/DebugInfo/X86/2010-04-13-PubType.ll +++ b/test/DebugInfo/X86/2010-04-13-PubType.ll @@ -32,9 +32,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.module.flags = !{!20}  !0 = !DILocalVariable(name: "x", line: 7, arg: 1, scope: !1, file: !2, type: !7) -!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !18, scope: !2, type: !4) +!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, scopeLine: 7, file: !18, scope: !2, type: !4)  !2 = !DIFile(filename: "a.c", directory: "/tmp/") -!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !17, imports:  null) +!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !18, enums: !19, retainedTypes: !19, imports:  null)  !4 = !DISubroutineType(types: !5)  !5 = !{!6, !7, !9}  !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -48,7 +48,6 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !14 = !DILocalVariable(name: "y", line: 7, arg: 2, scope: !1, file: !2, type: !9)  !15 = !DILocation(line: 7, scope: !16)  !16 = distinct !DILexicalBlock(line: 7, column: 0, file: !18, scope: !1) -!17 = !{!1}  !18 = !DIFile(filename: "a.c", directory: "/tmp/")  !19 = !{}  !20 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll b/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll index aaf72311cb46..62d88ca733b2 100644 --- a/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll +++ b/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll @@ -19,10 +19,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!21} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !12, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !6, scope: !6, type: !7) +!5 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, file: !6, scope: !6, type: !7)  !6 = !DIFile(filename: "test.c", directory: "/work/llvm/vanilla/test/DebugInfo")  !7 = !DISubroutineType(types: !8)  !8 = !{!9} diff --git a/test/DebugInfo/X86/2011-12-16-BadStructRef.ll b/test/DebugInfo/X86/2011-12-16-BadStructRef.ll index 2319c0b70881..73d48675d915 100644 --- a/test/DebugInfo/X86/2011-12-16-BadStructRef.ll +++ b/test/DebugInfo/X86/2011-12-16-BadStructRef.ll @@ -89,7 +89,7 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!83} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 146596)", isOptimized: false, emissionKind: 0, file: !82, enums: !1, retainedTypes: !3, subprograms: !27, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 146596)", isOptimized: false, emissionKind: FullDebug, file: !82, enums: !1, retainedTypes: !3, globals: !1, imports:  !1)  !1 = !{}  !3 = !{!5, !9}  !5 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", line: 9, size: 128, align: 64, file: !82, elements: !7) @@ -110,8 +110,7 @@ entry:  !22 = !DISubroutineType(types: !23)  !23 = !{null, !24, !12}  !24 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !5) -!27 = !{!29, !37, !40, !43, !46} -!29 = distinct !DISubprogram(name: "main", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: !6, type: !30) +!29 = distinct !DISubprogram(name: "main", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !82, scope: !6, type: !30)  !30 = !DISubroutineType(types: !31)  !31 = !{!12, !12, !32}  !32 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !33) @@ -119,16 +118,16 @@ entry:  !34 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)  !35 = !{!36}  !36 = !{} ; previously: invalid DW_TAG_base_type -!37 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3barC1Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !22, declaration: !21) +!37 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3barC1Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !82, scope: null, type: !22, declaration: !21)  !38 = !{!39}  !39 = !{} ; previously: invalid DW_TAG_base_type -!40 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3barC2Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !22, declaration: !21) +!40 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3barC2Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !82, scope: null, type: !22, declaration: !21)  !41 = !{!42}  !42 = !{} ; previously: invalid DW_TAG_base_type -!43 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3bazC1Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !14, declaration: !13) +!43 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3bazC1Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !82, scope: null, type: !14, declaration: !13)  !44 = !{!45}  !45 = !{} ; previously: invalid DW_TAG_base_type -!46 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3bazC2Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !14, declaration: !13) +!46 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3bazC2Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !82, scope: null, type: !14, declaration: !13)  !49 = !DILocalVariable(name: "argc", line: 16, arg: 1, scope: !29, file: !6, type: !12)  !50 = !DILocation(line: 16, column: 14, scope: !29)  !51 = !DILocalVariable(name: "argv", line: 16, arg: 2, scope: !29, file: !6, type: !32) diff --git a/test/DebugInfo/X86/DIModule.ll b/test/DebugInfo/X86/DIModule.ll index daed43a58cda..1fe7f0c5fabe 100644 --- a/test/DebugInfo/X86/DIModule.ll +++ b/test/DebugInfo/X86/DIModule.ll @@ -14,7 +14,7 @@ target triple = "x86_64-apple-macosx"  !llvm.module.flags = !{!6, !7}  !llvm.ident = !{!8} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "LLVM version 3.7.0", isOptimized: false, runtimeVersion: 2, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "LLVM version 3.7.0", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !3)  !1 = !DIFile(filename: "/llvm/tools/clang/test/Modules/<stdin>", directory: "/")  !2 = !{}  !3 = !{!4} diff --git a/test/DebugInfo/X86/DIModuleContext.ll b/test/DebugInfo/X86/DIModuleContext.ll index 413b45c4ab48..3955256d85e0 100644 --- a/test/DebugInfo/X86/DIModuleContext.ll +++ b/test/DebugInfo/X86/DIModuleContext.ll @@ -16,7 +16,7 @@ target triple = "x86_64-apple-macosx"  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!7, !8} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, globals: !3, imports: !11) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3, imports: !11)  !1 = !DIFile(filename: "test.c", directory: "/")  !2 = !{}  !3 = !{!4} diff --git a/test/DebugInfo/X86/DW_AT_byte_size.ll b/test/DebugInfo/X86/DW_AT_byte_size.ll index d879f6732e76..3fd4884d8221 100644 --- a/test/DebugInfo/X86/DW_AT_byte_size.ll +++ b/test/DebugInfo/X86/DW_AT_byte_size.ll @@ -26,10 +26,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!21} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 150996)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 150996)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooP1A", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !20, scope: !6, type: !7) +!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooP1A", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !20, scope: !6, type: !7)  !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !10} diff --git a/test/DebugInfo/X86/DW_AT_calling-convention.ll b/test/DebugInfo/X86/DW_AT_calling-convention.ll new file mode 100644 index 000000000000..6a64f5d06e30 --- /dev/null +++ b/test/DebugInfo/X86/DW_AT_calling-convention.ll @@ -0,0 +1,86 @@ +; RUN: llc < %s -filetype=obj -o %t +; RUN: llvm-dwarfdump %t | FileCheck %s + +; C++ source to regenerate: +; $ cat t.cpp +; struct A { +;   void thiscallcc(); +; }; +; void A::thiscallcc() {} +; void cdeclcc() {} +; void __fastcall fastcallcc() {} +; void __stdcall stdcallcc() {} +; void __vectorcall vectorcallcc() {} +; $ clang -g t.cpp -emit-llvm -S -o t.ll -O1 + +; CHECK: .debug_abbrev contents: + +; CHECK: [[subroutine_abbrev:\[[0-9]+\]]] DW_TAG_subroutine_type      DW_CHILDREN_yes +; CHECK-NEXT:         DW_AT_type      DW_FORM_ref4 +; CHECK-NEXT:         DW_AT_calling_convention        DW_FORM_data1 + +; CHECK: .debug_info contents: + +; CHECK:  DW_TAG_subroutine_type [[subroutine_abbrev]] * +; CHECK-NEXT:         DW_AT_type [DW_FORM_ref4]       {{.*}} +; CHECK-NEXT:         DW_AT_calling_convention [DW_FORM_data1]        (DW_CC_BORLAND_msfastcall) + +; CHECK: DW_TAG_subprogram [{{.*}}] * +; CHECK:                 DW_AT_low_pc +; CHECK:                 DW_AT_high_pc +; CHECK:                 DW_AT_frame_base +; CHECK:                 DW_AT_linkage_name +; CHECK:                 DW_AT_name +; CHECK:                 DW_AT_decl_file +; CHECK:                 DW_AT_decl_line +; CHECK:                 DW_AT_calling_convention [DW_FORM_data1]        (DW_CC_BORLAND_msfastcall) +; CHECK:                 DW_AT_type +; CHECK:                 DW_AT_external + +; ModuleID = 't.cpp' +source_filename = "t.cpp" +target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" +target triple = "i386-pc-windows-msvc19.0.23918" + +@"\01?fptr@@3P6IHHH@ZA" = global i32 (i32, i32)* @"\01?f@@YIHHH@Z", align 4 + +; Function Attrs: nounwind readnone +define x86_fastcallcc i32 @"\01?f@@YIHHH@Z"(i32 inreg %a, i32 inreg %b) #0 !dbg !12 { +entry: +  tail call void @llvm.dbg.value(metadata i32 %b, i64 0, metadata !14, metadata !16), !dbg !17 +  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !15, metadata !16), !dbg !18 +  %add = add nsw i32 %b, %a, !dbg !19 +  ret i32 %add, !dbg !20 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 + +attributes #0 = { nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind readnone } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!9, !10} +!llvm.ident = !{!11} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 272067)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3) +!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild") +!2 = !{} +!3 = !{!4} +!4 = distinct !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32 (i32, i32)** @"\01?fptr@@3P6IHHH@ZA") +!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 32, align: 32) +!6 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !7) +!7 = !{!8, !8, !8} +!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !{i32 2, !"Dwarf Version", i32 4} +!10 = !{i32 2, !"Debug Info Version", i32 3} +!11 = !{!"clang version 3.9.0 (trunk 272067)"} +!12 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YIHHH@Z", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !13) +!13 = !{!14, !15} +!14 = !DILocalVariable(name: "b", arg: 2, scope: !12, file: !1, line: 1, type: !8) +!15 = !DILocalVariable(name: "a", arg: 1, scope: !12, file: !1, line: 1, type: !8) +!16 = !DIExpression() +!17 = !DILocation(line: 1, column: 29, scope: !12) +!18 = !DILocation(line: 1, column: 22, scope: !12) +!19 = !DILocation(line: 1, column: 43, scope: !12) +!20 = !DILocation(line: 1, column: 34, scope: !12) diff --git a/test/DebugInfo/X86/DW_AT_linkage_name.ll b/test/DebugInfo/X86/DW_AT_linkage_name.ll index a3f3da2298e3..e20ef418cfe0 100644 --- a/test/DebugInfo/X86/DW_AT_linkage_name.ll +++ b/test/DebugInfo/X86/DW_AT_linkage_name.ll @@ -77,24 +77,23 @@ attributes #2 = { ssp uwtable }  !llvm.module.flags = !{!23, !24}  !llvm.ident = !{!25} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "linkage-name.cpp", directory: "")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A")  !5 = !{!6, !12} -!6 = !DISubprogram(name: "A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS1A", type: !7) +!6 = !DISubprogram(name: "A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9, !10} -!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)  !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!12 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !"_ZTS1A", type: !13) +!12 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !4, type: !13)  !13 = !DISubroutineType(types: !14)  !14 = !{null, !9} -!16 = !{!17, !18, !19} -!17 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !"_ZTS1A", type: !13, declaration: !12, variables: !2) -!18 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !"_ZTS1A", type: !13, declaration: !12, variables: !2) -!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !20, type: !21, variables: !2) +!17 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !4, type: !13, declaration: !12, variables: !2) +!18 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !4, type: !13, declaration: !12, variables: !2) +!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !1, scope: !20, type: !21, variables: !2)  !20 = !DIFile(filename: "linkage-name.cpp", directory: "")  !21 = !DISubroutineType(types: !22)  !22 = !{null} @@ -102,13 +101,13 @@ attributes #2 = { ssp uwtable }  !24 = !{i32 1, !"Debug Info Version", i32 3}  !25 = !{!"clang version 3.5.0 "}  !26 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !27) -!27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)  !28 = !DILocation(line: 0, scope: !17)  !29 = !DILocation(line: 8, scope: !17)  !30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !18, type: !27)  !31 = !DILocation(line: 0, scope: !18)  !32 = !DILocation(line: 6, scope: !18)  !33 = !DILocation(line: 8, scope: !18) -!34 = !DILocalVariable(name: "a", line: 11, scope: !19, file: !20, type: !"_ZTS1A") +!34 = !DILocalVariable(name: "a", line: 11, scope: !19, file: !20, type: !4)  !35 = !DILocation(line: 11, scope: !19)  !36 = !DILocation(line: 12, scope: !19) diff --git a/test/DebugInfo/X86/DW_AT_location-reference.ll b/test/DebugInfo/X86/DW_AT_location-reference.ll index 593611d76bc4..2c322fd05951 100644 --- a/test/DebugInfo/X86/DW_AT_location-reference.ll +++ b/test/DebugInfo/X86/DW_AT_location-reference.ll @@ -102,9 +102,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!24} -!0 = distinct !DISubprogram(name: "f", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !23, scope: !1, type: !3, variables: !22) +!0 = distinct !DISubprogram(name: "f", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 4, file: !23, scope: !1, type: !3, variables: !22)  !1 = !DIFile(filename: "simple.c", directory: "/home/rengol01/temp/tests/dwarf/relocation") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: true, emissionKind: 1, file: !23, enums: !{}, retainedTypes: !{}, subprograms: !21, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: true, emissionKind: FullDebug, file: !23, enums: !{}, retainedTypes: !{}, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{null}  !5 = !DILocalVariable(name: "x", line: 5, scope: !6, file: !1, type: !7) @@ -120,7 +120,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !18 = !DILocation(line: 11, column: 3, scope: !6)  !19 = !DILocation(line: 12, column: 3, scope: !6)  !20 = !DILocation(line: 13, column: 1, scope: !6) -!21 = !{!0}  !22 = !{!5}  !23 = !DIFile(filename: "simple.c", directory: "/home/rengol01/temp/tests/dwarf/relocation")  !24 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/DW_AT_object_pointer.ll b/test/DebugInfo/X86/DW_AT_object_pointer.ll index 4e6c7c83d1f4..554f68804902 100644 --- a/test/DebugInfo/X86/DW_AT_object_pointer.ll +++ b/test/DebugInfo/X86/DW_AT_object_pointer.ll @@ -51,15 +51,14 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!38} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 163586) (llvm/trunk 163570)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 163586) (llvm/trunk 163570)", isOptimized: false, emissionKind: FullDebug, file: !37, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5, !10, !20} -!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !6, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 7, file: !6, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "bar.cpp", directory: "/Users/echristo/debug-tests")  !7 = !DISubroutineType(types: !8)  !8 = !{!9}  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC1Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !11, declaration: !17, variables: !1) +!10 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC1Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !11, declaration: !17, variables: !1)  !11 = !DISubroutineType(types: !12)  !12 = !{null, !13}  !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !14) @@ -67,7 +66,7 @@ entry:  !15 = !{!16, !17}  !16 = !DIDerivedType(tag: DW_TAG_member, name: "m_a", line: 4, size: 32, align: 32, file: !37, scope: !14, baseType: !9)  !17 = !DISubprogram(name: "A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !14, type: !11) -!20 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !11, declaration: !17, variables: !1) +!20 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !11, declaration: !17, variables: !1)  !21 = !DILocalVariable(name: "a", line: 8, scope: !22, file: !6, type: !14)  !22 = distinct !DILexicalBlock(line: 7, column: 11, file: !6, scope: !5)  !23 = !DILocation(line: 8, column: 5, scope: !22) diff --git a/test/DebugInfo/X86/DW_AT_specification.ll b/test/DebugInfo/X86/DW_AT_specification.ll index 2b8345b66b71..edc19893f444 100644 --- a/test/DebugInfo/X86/DW_AT_specification.ll +++ b/test/DebugInfo/X86/DW_AT_specification.ll @@ -20,10 +20,9 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!28} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 0, file: !27, enums: !1, retainedTypes: !1, subprograms: !3, globals: !18, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: FullDebug, file: !27, enums: !1, retainedTypes: !1, globals: !18, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !6, scope: null, type: !7, declaration: !11) +!5 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 4, file: !6, scope: null, type: !7, declaration: !11)  !6 = !DIFile(filename: "nsNativeAppSupportBase.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library")  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} diff --git a/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll b/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll index 988a2b7daf4f..ee4da44181ca 100644 --- a/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll +++ b/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll @@ -30,11 +30,10 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"=  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9, !11} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "test.c", directory: "C:\5CProjects")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "test.c", directory: "C:CProjects")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/DW_TAG_friend.ll b/test/DebugInfo/X86/DW_TAG_friend.ll index 8681f33e7e28..5ce75cbaddaf 100644 --- a/test/DebugInfo/X86/DW_TAG_friend.ll +++ b/test/DebugInfo/X86/DW_TAG_friend.ll @@ -18,7 +18,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!29} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, emissionKind: 0, file: !28, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, emissionKind: FullDebug, file: !28, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5, !17}  !5 = !DIGlobalVariable(name: "a", line: 10, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) diff --git a/test/DebugInfo/X86/InlinedFnLocalVar.ll b/test/DebugInfo/X86/InlinedFnLocalVar.ll index a262fc8e88ca..e70be4c85dd7 100644 --- a/test/DebugInfo/X86/InlinedFnLocalVar.ll +++ b/test/DebugInfo/X86/InlinedFnLocalVar.ll @@ -25,13 +25,13 @@ entry:  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!28} -!0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) +!0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)  !1 = !DIFile(filename: "bar.c", directory: "/tmp/") -!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports:  !20) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !27, enums: !20, retainedTypes: !20, globals: !26, imports:  !20)  !3 = !DISubroutineType(types: !4)  !4 = !{!5, !5}  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7) +!6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, file: !27, scope: !1, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{!5}  !9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) @@ -54,7 +54,6 @@ entry:  !22 = !DILocation(line: 11, scope: !11, inlinedAt: !17)  !23 = !DILocation(line: 16, scope: !18)  !24 = !{!9, !10} -!25 = !{!0, !6}  !26 = !{!16}  !27 = !DIFile(filename: "bar.c", directory: "/tmp/")  !28 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/PR26148.ll b/test/DebugInfo/X86/PR26148.ll index b552508910c9..b195eafd5eaf 100644 --- a/test/DebugInfo/X86/PR26148.ll +++ b/test/DebugInfo/X86/PR26148.ll @@ -19,7 +19,7 @@  ; AS in 26163, we expect two ranges (as opposed to one), the first one being zero sized  ;  ; -; CHECK: 0x00000000: Beginning address offset: 0x0000000000000004 +; CHECK: 0x00000025: Beginning address offset: 0x0000000000000004  ; CHECK:                Ending address offset: 0x0000000000000004  ; CHECK:                 Location description: 10 03 55 93 04  ; CHECK:             Beginning address offset: 0x0000000000000004 @@ -64,11 +64,10 @@ entry:  !llvm.module.flags = !{!22, !23, !24}  !llvm.ident = !{!25} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (https://github.com/llvm-mirror/clang 8f258397c5afd7a708bd95770c718e81d08fb11a) (https://github.com/llvm-mirror/llvm 18481855bdfa1b4a424f81be8525db002671348d)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !20) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (https://github.com/llvm-mirror/clang 8f258397c5afd7a708bd95770c718e81d08fb11a) (https://github.com/llvm-mirror/llvm 18481855bdfa1b4a424f81be8525db002671348d)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !20)  !1 = !DIFile(filename: "small.c", directory: "/Users/kfischer/Projects/clangbug")  !2 = !{} -!3 = !{!4, !17} -!4 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, variables: !8) +!4 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !8)  !5 = !DISubroutineType(types: !6)  !6 = !{null, !7}  !7 = !DIBasicType(name: "short", size: 16, align: 16, encoding: DW_ATE_signed) @@ -81,7 +80,7 @@ entry:  !14 = !DIDerivedType(tag: DW_TAG_member, name: "f3", scope: !11, file: !1, line: 3, baseType: !15, size: 32, align: 32, offset: 32)  !15 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !16 = !DILocalVariable(name: "c", scope: !4, file: !1, line: 6, type: !11) -!17 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 11, type: !18, isLocal: false, isDefinition: true, scopeLine: 11, isOptimized: true, variables: !2) +!17 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 11, type: !18, isLocal: false, isDefinition: true, scopeLine: 11, isOptimized: true, unit: !0, variables: !2)  !18 = !DISubroutineType(types: !19)  !19 = !{!15}  !20 = !{!21} diff --git a/test/DebugInfo/X86/abstract_origin.ll b/test/DebugInfo/X86/abstract_origin.ll new file mode 100644 index 000000000000..05abc0481dbd --- /dev/null +++ b/test/DebugInfo/X86/abstract_origin.ll @@ -0,0 +1,57 @@ +; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; Generated at -O2 from: +;   void f(); +;   __attribute__((always_inline)) void g() { +;     f(); +;   } +;   void h() { +;     g(); +;   }; +; CHECK: DW_TAG_subprogram +; CHECK:  DW_AT_abstract_origin {{.*}}"g" +; CHECK-NOT:  DW_AT_abstract_origin {{.*}}"g" +; CHECK: DW_TAG +source_filename = "test.c" +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +; Function Attrs: alwaysinline nounwind ssp uwtable +define void @g() #0 !dbg !7 { +entry: +  tail call void (...) @f() #3, !dbg !10 +  ret void, !dbg !11 +} + +declare void @f(...) + +; Function Attrs: nounwind ssp uwtable +define void @h() #2 !dbg !12 { +entry: +  tail call void (...) @f() #3, !dbg !13 +  ret void, !dbg !15 +} + +attributes #0 = { alwaysinline nounwind ssp uwtable } +attributes #2 = { nounwind ssp uwtable } +attributes #3 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5} +!llvm.ident = !{!6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 2} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"PIC Level", i32 2} +!6 = !{!"clang version 3.9.0 "} +!7 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, variables: !2) +!8 = !DISubroutineType(types: !9) +!9 = !{null} +!10 = !DILocation(line: 3, column: 3, scope: !7) +!11 = !DILocation(line: 4, column: 1, scope: !7) +!12 = distinct !DISubprogram(name: "h", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: true, unit: !0, variables: !2) +!13 = !DILocation(line: 3, column: 3, scope: !7, inlinedAt: !14) +!14 = distinct !DILocation(line: 6, column: 3, scope: !12) +!15 = !DILocation(line: 7, column: 1, scope: !12) diff --git a/test/DebugInfo/X86/aligned_stack_var.ll b/test/DebugInfo/X86/aligned_stack_var.ll index 02a51f346ee7..8f58399da594 100644 --- a/test/DebugInfo/X86/aligned_stack_var.ll +++ b/test/DebugInfo/X86/aligned_stack_var.ll @@ -27,10 +27,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!15} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 155696:155697) (llvm/trunk 155696)", isOptimized: false, emissionKind: 0, file: !14, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 155696:155697) (llvm/trunk 155696)", isOptimized: false, emissionKind: FullDebug, file: !14, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "run", linkageName: "_Z3runv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !14, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "run", linkageName: "_Z3runv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !14, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "test.cc", directory: "/home/samsonov/debuginfo")  !7 = !DISubroutineType(types: !8)  !8 = !{null} diff --git a/test/DebugInfo/X86/arange-and-stub.ll b/test/DebugInfo/X86/arange-and-stub.ll index 39727753b8f9..891429e3ef19 100644 --- a/test/DebugInfo/X86/arange-and-stub.ll +++ b/test/DebugInfo/X86/arange-and-stub.ll @@ -18,7 +18,7 @@ define void @foo() !dbg !4 {  define void @bar() personality i8* bitcast (void ()* @foo to i8*) !dbg !9 {    invoke void @foo() -          to label %invoke.cont unwind label %lpad +          to label %invoke.cont unwind label %lpad, !dbg !19  invoke.cont:                                      ; preds = %0    ret void @@ -32,16 +32,15 @@ lpad:                                             ; preds = %0  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!17, !18} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234308) (llvm/trunk 234310)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234308) (llvm/trunk 234310)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !10, imports: !2)  !1 = !DIFile(filename: "/Users/espindola/llvm/<stdin>", directory: "/Users/espindola/llvm/build")  !2 = !{} -!3 = !{!4, !9} -!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)  !5 = !DIFile(filename: "/Users/espindola/llvm/test.cpp", directory: "/Users/espindola/llvm/build")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8}  !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = distinct !DISubprogram(name: "bar_d", linkageName: "bar", scope: !5, file: !5, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!9 = distinct !DISubprogram(name: "bar_d", linkageName: "bar", scope: !5, file: !5, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)  !10 = !{!11}  !11 = !DIGlobalVariable(name: "zed", scope: !0, file: !5, line: 6, type: !12, isLocal: false, isDefinition: true, variable: [1 x void ()*]* @zed)  !12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 64, align: 64, elements: !15) @@ -51,3 +50,4 @@ lpad:                                             ; preds = %0  !16 = !DISubrange(count: 1)  !17 = !{i32 2, !"Dwarf Version", i32 4}  !18 = !{i32 2, !"Debug Info Version", i32 3} +!19 = !DILocation(line: 0, scope: !9) diff --git a/test/DebugInfo/X86/arange.ll b/test/DebugInfo/X86/arange.ll index f88cdb3a90ad..322459a2678d 100644 --- a/test/DebugInfo/X86/arange.ll +++ b/test/DebugInfo/X86/arange.ll @@ -29,7 +29,7 @@  !llvm.module.flags = !{!12, !13}  !llvm.ident = !{!14} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !9, imports: !2)  !1 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4} diff --git a/test/DebugInfo/X86/arguments.ll b/test/DebugInfo/X86/arguments.ll index 8b3902765bbd..bfb5138f27cd 100644 --- a/test/DebugInfo/X86/arguments.ll +++ b/test/DebugInfo/X86/arguments.ll @@ -49,11 +49,10 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!24} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4func3fooS_", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4func3fooS_", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8, !8} diff --git a/test/DebugInfo/X86/array.ll b/test/DebugInfo/X86/array.ll index 4ffe0a710b85..6d4245cf0d54 100644 --- a/test/DebugInfo/X86/array.ll +++ b/test/DebugInfo/X86/array.ll @@ -16,9 +16,9 @@  ; Test that we only emit register-indirect locations for the array array.  ; rdar://problem/14874886  ; -; CHECK:     ##DEBUG_VALUE: main:array <- [%R{{.*}}+0] -; CHECK:     ##DEBUG_VALUE: main:array <- [%R{{.*}}+0] -; CHECK:     ##DEBUG_VALUE: main:array <- [%R{{.*}}+0] +; FIXME: If we described this location as RSP-relative instead of RDI-relative +; the live range would be larger. +; CHECK:     ##DEBUG_VALUE: main:array <- [%RDI+0]  ; CHECK-NOT: ##DEBUG_VALUE: main:array <- %R{{.*}}  target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"  target triple = "x86_64-apple-macosx10.9.0" @@ -62,11 +62,10 @@ attributes #2 = { nounwind readnone }  !llvm.module.flags = !{!25, !26}  !llvm.ident = !{!27} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "array.c", directory: "")  !2 = !{} -!3 = !{!4, !12} -!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !10) +!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !10)  !5 = !DIFile(filename: "array.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8} @@ -74,7 +73,7 @@ attributes #2 = { nounwind readnone }  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !10 = !{!11}  !11 = !DILocalVariable(name: "p", line: 1, arg: 1, scope: !4, file: !5, type: !8) -!12 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !13, variables: !18) +!12 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !13, variables: !18)  !13 = !DISubroutineType(types: !14)  !14 = !{!9, !9, !15}  !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16) diff --git a/test/DebugInfo/X86/array2.ll b/test/DebugInfo/X86/array2.ll index f456aae2e250..2289e3284275 100644 --- a/test/DebugInfo/X86/array2.ll +++ b/test/DebugInfo/X86/array2.ll @@ -72,17 +72,16 @@ attributes #2 = { nounwind }  !llvm.module.flags = !{!16, !17}  !llvm.ident = !{!18} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "array.c", directory: "")  !2 = !{} -!3 = !{!4, !10} -!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "array.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8}  !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !11, variables: !2) +!10 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !11, variables: !2)  !11 = !DISubroutineType(types: !12)  !12 = !{!9, !9, !13}  !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !14) diff --git a/test/DebugInfo/X86/bbjoin.ll b/test/DebugInfo/X86/bbjoin.ll index 8061a8d2ce9a..2055fe3f1910 100644 --- a/test/DebugInfo/X86/bbjoin.ll +++ b/test/DebugInfo/X86/bbjoin.ll @@ -1,5 +1,5 @@  ; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 %s -stop-after=livedebugvars \ -; RUN:   -o %t.s | FileCheck %s +; RUN:   -o - | FileCheck %s  ; Generated from:  ; void g(int *);  ; int f() { @@ -14,7 +14,7 @@  ; CHECK:   DBG_VALUE 23, 0, ![[X]],  ; CHECK:   DBG_VALUE debug-use %rdi, debug-use _, ![[X]]  ; CHECK: bb.1.if.then: -; CHECK:   DBG_VALUE debug-use %rdi, debug-use _, ![[X]], +; CHECK:   DBG_VALUE 43, 0, ![[X]],  ; CHECK: bb.2.if.end:  ; CHECK-NOT:  DBG_VALUE 23, 0, ![[X]],  ; CHECK:   RETQ %eax @@ -30,9 +30,9 @@ entry:    call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !14    tail call void @llvm.dbg.value(metadata i32 23, i64 0, metadata !9, metadata !15), !dbg !16    store i32 23, i32* %x, align 4, !dbg !16, !tbaa !17 -  tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16 +  tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16    call void @g(i32* nonnull %x) #4, !dbg !21 -  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16 +  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16    %1 = load i32, i32* %x, align 4, !dbg !22, !tbaa !17    %cmp = icmp eq i32 %1, 42, !dbg !24    br i1 %cmp, label %if.then, label %if.end, !dbg !25 @@ -44,7 +44,7 @@ if.then:                                          ; preds = %entry  if.end:                                           ; preds = %if.then, %entry    %2 = phi i32 [ 43, %if.then ], [ %1, %entry ], !dbg !27 -  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16 +  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16    call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !28    ret i32 %2, !dbg !29  } @@ -69,11 +69,10 @@ attributes #4 = { nounwind }  !llvm.module.flags = !{!10, !11, !12}  !llvm.ident = !{!13} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255890) (llvm/trunk 255919)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255890) (llvm/trunk 255919)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)  !1 = !DIFile(filename: "constant.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, variables: !8) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, variables: !8)  !5 = !DISubroutineType(types: !6)  !6 = !{!7}  !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/bitfields-dwarf4.ll b/test/DebugInfo/X86/bitfields-dwarf4.ll new file mode 100644 index 000000000000..5275fc645543 --- /dev/null +++ b/test/DebugInfo/X86/bitfields-dwarf4.ll @@ -0,0 +1,77 @@ +; RUN: llc -mtriple x86_64-apple-macosx -O0 -filetype=obj -o - %s \ +; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: llc -mtriple x86_64-gnu-linux -O0 -filetype=obj -o - %s \ +; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=LINUX +; LINUX-NOT: DW_AT_data_bit_offset +; +; Generated from: +;   #include <stdint.h> +;   #pragma pack(1) +;      struct PackedBits +;      { +;        char a; +;        uint32_t b : 5, +;        c : 27 +;      } s; +;   #pragma pack() + +source_filename = "bitfield.c" +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx" + +%struct.PackedBits = type <{ i8, i32 }> + +@s = common global %struct.PackedBits zeroinitializer, align 1 + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!14, !15, !16} +!llvm.ident = !{!17} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 267633)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3) +!1 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm") +!2 = !{} +!3 = !{!4} +!4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, variable: %struct.PackedBits* @s) +!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !1, line: 3, size: 40, align: 8, elements: !6) +!6 = !{!7, !9, !13} + +; CHECK: DW_TAG_member +; CHECK-NEXT: DW_AT_name{{.*}}"a" +; CHECK-NOT:  DW_TAG +; CHECK-NOT:  DW_AT_bit_offset +; CHECK-NOT:  DW_AT_data_bit_offset +; CHECK:      DW_AT_data_member_location [DW_FORM_data1]	(0x00) +!7 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !5, file: !1, line: 5, baseType: !8, size: 8, align: 8) + +!8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) + +; CHECK: DW_TAG_member +; CHECK-NEXT: DW_AT_name{{.*}}"b" +; CHECK-NOT:  DW_TAG +; CHECK-NOT:  DW_AT_bit_offset +; CHECK-NOT:  DW_AT_byte_size +; CHECK:      DW_AT_bit_size             [DW_FORM_data1]	(0x05) +; CHECK-NOT:  DW_AT_byte_size +; CHECK-NEXT: DW_AT_data_bit_offset      [DW_FORM_data1]	(0x08) +; CHECK-NOT:  DW_AT_data_member_location +!9 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !5, file: !1, line: 6, baseType: !10, size: 5, align: 32, offset: 8) + +!10 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !11, line: 183, baseType: !12) +!11 = !DIFile(filename: "/Volumes/Data/llvm/_build.ninja.release/bin/../lib/clang/3.9.0/include/stdint.h", directory: "/Volumes/Data/llvm") +!12 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) + +; CHECK: DW_TAG_member +; CHECK-NEXT: DW_AT_name{{.*}}"c" +; CHECK-NOT:  DW_TAG +; CHECK-NOT:  DW_AT_bit_offset +; CHECK-NOT:  DW_AT_byte_size +; CHECK:      DW_AT_bit_size             [DW_FORM_data1]	(0x1b) +; CHECK-NEXT: DW_AT_data_bit_offset      [DW_FORM_data1]	(0x0d) +; CHECK-NOT:  DW_AT_data_member_location +; CHECK: DW_TAG +!13 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !1, line: 7, baseType: !10, size: 27, align: 32, offset: 13) + +!14 = !{i32 2, !"Dwarf Version", i32 4} +!15 = !{i32 2, !"Debug Info Version", i32 3} +!16 = !{i32 1, !"PIC Level", i32 2} +!17 = !{!"clang version 3.9.0 (trunk 267633)"} diff --git a/test/DebugInfo/X86/bitfields.ll b/test/DebugInfo/X86/bitfields.ll index e0fa4f6d9980..1011558f6036 100644 --- a/test/DebugInfo/X86/bitfields.ll +++ b/test/DebugInfo/X86/bitfields.ll @@ -54,7 +54,7 @@ target triple = "x86_64-apple-macosx"  !llvm.module.flags = !{!13, !14, !15}  !llvm.ident = !{!16} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)  !1 = !DIFile(filename: "bitfields.c", directory: "/")  !2 = !{}  !3 = !{!4} diff --git a/test/DebugInfo/X86/block-capture.ll b/test/DebugInfo/X86/block-capture.ll index 640973ed2a68..168040507eef 100644 --- a/test/DebugInfo/X86/block-capture.ll +++ b/test/DebugInfo/X86/block-capture.ll @@ -62,14 +62,13 @@ attributes #3 = { nounwind }  !llvm.module.flags = !{!16, !17, !18, !19, !20, !21, !22}  !llvm.ident = !{!23} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.6.0 (trunk 223471)", isOptimized: false, runtimeVersion: 2, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.6.0 (trunk 223471)", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "foo.m", directory: "")  !2 = !{} -!3 = !{!8}  !5 = !DIFile(filename: "foo.m", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null} -!8 = distinct !DISubprogram(name: "__foo_block_invoke", line: 2, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !9, variables: !2) +!8 = distinct !DISubprogram(name: "__foo_block_invoke", line: 2, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !9, variables: !2)  !9 = !DISubroutineType(types: !10)  !10 = !{null, !11}  !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) diff --git a/test/DebugInfo/X86/byvalstruct.ll b/test/DebugInfo/X86/byvalstruct.ll index 422789ae77b5..1474a8929542 100644 --- a/test/DebugInfo/X86/byvalstruct.ll +++ b/test/DebugInfo/X86/byvalstruct.ll @@ -87,14 +87,13 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!24, !25, !26, !27, !38} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !6, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "t.mm", directory: "")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Bitmap", line: 8, size: 8, align: 8, flags: DIFlagObjcClassComplete, runtimeLang: DW_LANG_ObjC_plus_plus, file: !1, scope: !5, elements: !2)  !5 = !DIFile(filename: "t.mm", directory: "") -!6 = !{!7} -!7 = distinct !DISubprogram(name: "-[Bitmap initWithCopy:andInfo:andLength:]", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !1, scope: !5, type: !8, variables: !2) +!7 = distinct !DISubprogram(name: "-[Bitmap initWithCopy:andInfo:andLength:]", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 9, file: !1, scope: !5, type: !8, variables: !2)  !8 = !DISubroutineType(types: !9)  !9 = !{!4, !10, !11, !14, !15, !19}  !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) diff --git a/test/DebugInfo/X86/c-type-units.ll b/test/DebugInfo/X86/c-type-units.ll index d8321380c535..37cb3d55659f 100644 --- a/test/DebugInfo/X86/c-type-units.ll +++ b/test/DebugInfo/X86/c-type-units.ll @@ -17,7 +17,7 @@  !llvm.module.flags = !{!7, !8}  !llvm.ident = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !3, imports: !2)  !1 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4} diff --git a/test/DebugInfo/X86/coff_debug_info_type.ll b/test/DebugInfo/X86/coff_debug_info_type.ll index cede74d5dc6a..b01a976ada0f 100644 --- a/test/DebugInfo/X86/coff_debug_info_type.ll +++ b/test/DebugInfo/X86/coff_debug_info_type.ll @@ -31,11 +31,10 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"=  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9, !11} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "test.c", directory: "C:\5CProjects")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "test.c", directory: "C:CProjects")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/coff_relative_names.ll b/test/DebugInfo/X86/coff_relative_names.ll index 7ca4b04a871f..e79d7ea7f3c4 100644 --- a/test/DebugInfo/X86/coff_relative_names.ll +++ b/test/DebugInfo/X86/coff_relative_names.ll @@ -23,11 +23,10 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"=  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9, !11} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "test.c", directory: "C:\5CProjects")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "test.c", directory: "C:CProjects")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/concrete_out_of_line.ll b/test/DebugInfo/X86/concrete_out_of_line.ll index d34c1ae37e3f..47b2e5fa5921 100644 --- a/test/DebugInfo/X86/concrete_out_of_line.ll +++ b/test/DebugInfo/X86/concrete_out_of_line.ll @@ -78,10 +78,9 @@ declare void @_Z8moz_freePv(i8*)  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!60} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 ()", isOptimized: true, emissionKind: 0, file: !59, enums: !1, retainedTypes: !1, subprograms: !3, globals: !47, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 ()", isOptimized: true, emissionKind: FullDebug, file: !59, enums: !1, retainedTypes: !1, globals: !47, imports:  !1)  !1 = !{} -!3 = !{!5, !23, !27, !31} -!5 = distinct !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !6, scope: null, type: !7 , declaration: !12, variables: !20) +!5 = distinct !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 14, file: !6, scope: null, type: !7 , declaration: !12, variables: !20)  !6 = !DIFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !10} @@ -97,13 +96,13 @@ declare void @_Z8moz_freePv(i8*)  !18 = !{}  !20 = !{!22}  !22 = !DILocalVariable(name: "this", line: 14, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !10) -!23 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, declaration: !15, variables: !24) +!23 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 18, file: !6, scope: null, type: !16, declaration: !15, variables: !24)  !24 = !{!26}  !26 = !DILocalVariable(name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !23, file: !6, type: !10) -!27 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, declaration: !15, variables: !28) +!27 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 18, file: !6, scope: null, type: !16, declaration: !15, variables: !28)  !28 = !{!30}  !30 = !DILocalVariable(name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !27, file: !6, type: !10) -!31 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: null, type: !32, declaration: !36, variables: !43) +!31 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 4, file: !6, scope: null, type: !32, declaration: !36, variables: !43)  !32 = !DISubroutineType(types: !33)  !33 = !{!9, !34, !9}  !34 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !35) diff --git a/test/DebugInfo/X86/constant-aggregate.ll b/test/DebugInfo/X86/constant-aggregate.ll index 35bf9a516807..80c9b06b483b 100644 --- a/test/DebugInfo/X86/constant-aggregate.ll +++ b/test/DebugInfo/X86/constant-aggregate.ll @@ -72,31 +72,30 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!33, !34, !35}  !llvm.ident = !{!36} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 225364) (llvm/trunk 225366)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 225364) (llvm/trunk 225366)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "sroasplit-4.cpp", directory: "")  !2 = !{}  !3 = !{!4, !8}  !4 = !DICompositeType(tag: DW_TAG_structure_type, line: 1, size: 32, align: 32, file: !1, elements: !5, identifier: "_ZTS1S")  !5 = !{!6} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 1, size: 32, align: 32, file: !1, scope: !"_ZTS1S", baseType: !7) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 1, size: 32, align: 32, file: !1, scope: !4, baseType: !7)  !7 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)  !8 = !DICompositeType(tag: DW_TAG_class_type, name: "C", line: 8, size: 32, align: 32, file: !1, elements: !9, identifier: "_ZTS1C")  !9 = !{!10} -!10 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 8, size: 32, align: 32, flags: DIFlagPublic, file: !1, scope: !"_ZTS1C", baseType: !7) -!11 = !{!12, !19, !24} -!12 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo1S", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !13, type: !14, variables: !17) +!10 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 8, size: 32, align: 32, flags: DIFlagPublic, file: !1, scope: !8, baseType: !7) +!12 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo1S", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !13, type: !14, variables: !17)  !13 = !DIFile(filename: "sroasplit-4.cpp", directory: "")  !14 = !DISubroutineType(types: !15)  !15 = !{!7, !16} -!16 = !DIDerivedType(tag: DW_TAG_typedef, name: "S", line: 1, file: !1, baseType: !"_ZTS1S") +!16 = !DIDerivedType(tag: DW_TAG_typedef, name: "S", line: 1, file: !1, baseType: !4)  !17 = !{!18}  !18 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !12, file: !13, type: !16) -!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo1C", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !1, scope: !13, type: !20, variables: !22) +!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo1C", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 10, file: !1, scope: !13, type: !20, variables: !22)  !20 = !DISubroutineType(types: !21) -!21 = !{!7, !"_ZTS1C"} +!21 = !{!7, !8}  !22 = !{!23} -!23 = !DILocalVariable(name: "c", line: 10, arg: 1, scope: !19, file: !13, type: !"_ZTS1C") -!24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 15, file: !1, scope: !13, type: !25, variables: !27) +!23 = !DILocalVariable(name: "c", line: 10, arg: 1, scope: !19, file: !13, type: !8) +!24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 15, file: !1, scope: !13, type: !25, variables: !27)  !25 = !DISubroutineType(types: !26)  !26 = !{!7}  !27 = !{!28} diff --git a/test/DebugInfo/X86/constant-loclist.ll b/test/DebugInfo/X86/constant-loclist.ll new file mode 100644 index 000000000000..ad2ad6947a81 --- /dev/null +++ b/test/DebugInfo/X86/constant-loclist.ll @@ -0,0 +1,76 @@ +; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s + +; A hand-written testcase to check 64-bit constant handling in location lists. + +; CHECK: .debug_info contents: +; CHECK: DW_TAG_variable +; CHECK-NEXT: DW_AT_location [DW_FORM_data4]	(0x[[D:.*]]) +; CHECK-NEXT: DW_AT_name {{.*}}"d" +; CHECK: DW_TAG_variable +; CHECK-NEXT: DW_AT_location [DW_FORM_data4]	(0x[[I:.*]]) +; CHECK-NEXT: DW_AT_name {{.*}}"i" +; CHECK: DW_TAG_variable +; CHECK-NEXT: DW_AT_location [DW_FORM_data4]	(0x[[U:.*]]) +; CHECK-NEXT: DW_AT_name {{.*}}"u" +; CHECK: .debug_loc contents: +; CHECK: [[D]]: +; CHECK: Location description: 10 80 80 80 80 80 80 80 80 40 +; CHECK: [[I]]: +; CHECK: Location description: 11 80 80 80 80 80 80 80 80 c0 00 +; CHECK: [[U]]: +; CHECK: Location description: 10 80 80 80 80 80 80 80 80 40  + +source_filename = "test.c" +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx" + +; Function Attrs: nounwind ssp uwtable +define void @main() #0 !dbg !7 { +  %1 = alloca double, align 8 +  %2 = alloca i64, align 8 +  %3 = alloca i64, align 8 +  store double 2.000000e+00, double* %1, align 8, !dbg !21 +  call void @llvm.dbg.value(metadata i64 0, i64 0, metadata !22, metadata !15), !dbg !24 +  call void @llvm.dbg.value(metadata i64 0, i64 0, metadata !25, metadata !15), !dbg !27 +  call void @llvm.dbg.value(metadata double 2.000000e+00, i64 0, metadata !19, metadata !15), !dbg !21 +  store i64 4611686018427387904, i64* %2, align 8, !dbg !24 +  call void @llvm.dbg.value(metadata i64 4611686018427387904, i64 0, metadata !22, metadata !15), !dbg !24 +  call void @llvm.dbg.value(metadata i64 4611686018427387904, i64 0, metadata !25, metadata !15), !dbg !27 +  store i64 4611686018427387904, i64* %3, align 8, !dbg !27 +  ret void, !dbg !28 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 + + +attributes #0 = { nounwind ssp uwtable } +attributes #1 = { nounwind readnone } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5} +!llvm.ident = !{!6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.c", directory: "/tmp") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 2} +!4 = !{i32 2, !"Debug Info Version", i32 00000003} +!5 = !{i32 1, !"PIC Level", i32 2} +!6 = !{!"clang"} +!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!8 = !DISubroutineType(types: !{}) +!15 = !DIExpression() +!16 = !DILocation(line: 1, column: 14, scope: !7) +!18 = !DILocation(line: 1, column: 24, scope: !7) +!19 = !DILocalVariable(name: "d", scope: !7, file: !1, line: 2, type: !20) +!20 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) +!21 = !DILocation(line: 2, column: 10, scope: !7) +!22 = !DILocalVariable(name: "u", scope: !7, file: !1, line: 3, type: !23) +!23 = !DIBasicType(name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) +!24 = !DILocation(line: 3, column: 22, scope: !7) +!25 = !DILocalVariable(name: "i", scope: !7, file: !1, line: 4, type: !26) +!26 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed) +!27 = !DILocation(line: 4, column: 20, scope: !7) +!28 = !DILocation(line: 5, column: 3, scope: !7) diff --git a/test/DebugInfo/X86/cu-ranges-odr.ll b/test/DebugInfo/X86/cu-ranges-odr.ll index 67da59a0e4bb..163d9330075b 100644 --- a/test/DebugInfo/X86/cu-ranges-odr.ll +++ b/test/DebugInfo/X86/cu-ranges-odr.ll @@ -61,25 +61,24 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!23, !24}  !llvm.ident = !{!25} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 (trunk 199923) (llvm/trunk 199940)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !21, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 (trunk 199923) (llvm/trunk 199940)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !21, imports: !2)  !1 = !DIFile(filename: "baz.cpp", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !1, elements: !5, identifier: "_ZTS1A")  !5 = !{!6, !8} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 5, size: 32, align: 32, flags: DIFlagPrivate, file: !1, scope: !"_ZTS1A", baseType: !7) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 5, size: 32, align: 32, flags: DIFlagPrivate, file: !1, scope: !4, baseType: !7)  !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = !DISubprogram(name: "A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !"_ZTS1A", type: !9) +!8 = !DISubprogram(name: "A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !4, type: !9)  !9 = !DISubroutineType(types: !10)  !10 = !{null, !11, !7} -!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") -!13 = !{!14, !18, !19} -!14 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !15, type: !16, variables: !2) +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) +!14 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !1, scope: !15, type: !16, variables: !2)  !15 = !DIFile(filename: "baz.cpp", directory: "/usr/local/google/home/echristo/tmp")  !16 = !DISubroutineType(types: !17)  !17 = !{null} -!18 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !"_ZTS1A", type: !9, declaration: !8, variables: !2) -!19 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, scopeLine: 3, file: !1, scope: !15, type: !20, variables: !2) +!18 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !4, type: !9, declaration: !8, variables: !2) +!19 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !15, type: !20, variables: !2)  !20 = !DISubroutineType(types: !2)  !21 = !{!22}  !22 = !DIGlobalVariable(name: "a", line: 8, isLocal: false, isDefinition: true, scope: null, file: !15, type: !4, variable: %class.A* @a) @@ -88,7 +87,7 @@ attributes #1 = { nounwind readnone }  !25 = !{!"clang version 3.5 (trunk 199923) (llvm/trunk 199940)"}  !26 = !DILocation(line: 8, scope: !14)  !27 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !18, type: !28) -!28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)  !29 = !DILocation(line: 0, scope: !18)  !30 = !DILocalVariable(name: "i", line: 3, arg: 2, scope: !18, file: !15, type: !7)  !31 = !DILocation(line: 3, scope: !18) diff --git a/test/DebugInfo/X86/cu-ranges.ll b/test/DebugInfo/X86/cu-ranges.ll index 543684596d9e..af129c7525de 100644 --- a/test/DebugInfo/X86/cu-ranges.ll +++ b/test/DebugInfo/X86/cu-ranges.ll @@ -56,16 +56,15 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!10, !11}  !llvm.ident = !{!12} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo")  !2 = !{} -!3 = !{!4, !9} -!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8}  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = distinct !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!9 = distinct !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)  !10 = !{i32 2, !"Dwarf Version", i32 4}  !11 = !{i32 1, !"Debug Info Version", i32 3}  !12 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"} diff --git a/test/DebugInfo/X86/data_member_location.ll b/test/DebugInfo/X86/data_member_location.ll index 5b33096864bb..eea636b53b3e 100644 --- a/test/DebugInfo/X86/data_member_location.ll +++ b/test/DebugInfo/X86/data_member_location.ll @@ -34,15 +34,15 @@  !llvm.module.flags = !{!13, !15}  !llvm.ident = !{!14} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !10, imports: !2)  !1 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 64, align: 32, file: !1, elements: !5, identifier: "_ZTS3foo")  !5 = !{!6, !8} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 2, size: 8, align: 8, file: !1, scope: !"_ZTS3foo", baseType: !7) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 2, size: 8, align: 8, file: !1, scope: !4, baseType: !7)  !7 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!8 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 3, size: 32, align: 32, offset: 32, file: !1, scope: !"_ZTS3foo", baseType: !9) +!8 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 3, size: 32, align: 32, offset: 32, file: !1, scope: !4, baseType: !9)  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !10 = !{!11}  !11 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !12, type: !4, variable: %struct.foo* @f) diff --git a/test/DebugInfo/X86/dbg-byval-parameter.ll b/test/DebugInfo/X86/dbg-byval-parameter.ll index c80f8d90ca89..fdf5d49b31ad 100644 --- a/test/DebugInfo/X86/dbg-byval-parameter.ll +++ b/test/DebugInfo/X86/dbg-byval-parameter.ll @@ -29,9 +29,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.module.flags = !{!21}  !0 = !DILocalVariable(name: "my_r0", line: 11, arg: 1, scope: !1, file: !2, type: !7) -!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !19, scope: !2, type: !4) +!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !19, scope: !2, type: !4)  !2 = !DIFile(filename: "b2.c", directory: "/tmp/") -!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18, imports:  null) +!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !20, retainedTypes: !20, imports:  null)  !4 = !DISubroutineType(types: !5)  !5 = !{!6, !7}  !6 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) @@ -46,7 +46,6 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !15 = !DILocation(line: 11, scope: !1)  !16 = !DILocation(line: 12, scope: !17)  !17 = distinct !DILexicalBlock(line: 11, column: 0, file: !19, scope: !1) -!18 = !{!1}  !19 = !DIFile(filename: "b2.c", directory: "/tmp/")  !20 = !{}  !21 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/dbg-const-int.ll b/test/DebugInfo/X86/dbg-const-int.ll index 7e90a14c21a2..c27aa5f601d9 100644 --- a/test/DebugInfo/X86/dbg-const-int.ll +++ b/test/DebugInfo/X86/dbg-const-int.ll @@ -21,8 +21,8 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!15} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 132191)", isOptimized: true, emissionKind: 0, file: !13, enums: !14, retainedTypes: !14, subprograms: !11, imports:  null) -!1 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !13, scope: !2, type: !3, variables: !12) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 132191)", isOptimized: true, emissionKind: FullDebug, file: !13, enums: !14, retainedTypes: !14, imports:  null) +!1 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, file: !13, scope: !2, type: !3, variables: !12)  !2 = !DIFile(filename: "a.c", directory: "/private/tmp")  !3 = !DISubroutineType(types: !4)  !4 = !{!5} @@ -32,7 +32,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !8 = !{i32 42}  !9 = !DILocation(line: 2, column: 12, scope: !7)  !10 = !DILocation(line: 3, column: 2, scope: !7) -!11 = !{!1}  !12 = !{!6}  !13 = !DIFile(filename: "a.c", directory: "/private/tmp")  !14 = !{} diff --git a/test/DebugInfo/X86/dbg-const.ll b/test/DebugInfo/X86/dbg-const.ll index 6d710c512fd7..c3c86d7fff3b 100644 --- a/test/DebugInfo/X86/dbg-const.ll +++ b/test/DebugInfo/X86/dbg-const.ll @@ -31,9 +31,9 @@ declare i32 @bar() nounwind readnone  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!17} -!0 = distinct !DISubprogram(name: "foobar", linkageName: "foobar", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !15, scope: !1, type: !3, variables: !14) +!0 = distinct !DISubprogram(name: "foobar", linkageName: "foobar", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, file: !15, scope: !1, type: !3, variables: !14)  !1 = !DIFile(filename: "mu.c", directory: "/private/tmp") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 114183)", isOptimized: true, emissionKind: 1, file: !15, enums: !16, retainedTypes: !16, subprograms: !13, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 114183)", isOptimized: true, emissionKind: FullDebug, file: !15, enums: !16, retainedTypes: !16, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{!5}  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -44,7 +44,6 @@ declare i32 @bar() nounwind readnone  !10 = !DILocation(line: 23, column: 3, scope: !7)  !11 = !DILocation(line: 17, column: 3, scope: !7)  !12 = !DILocation(line: 18, column: 3, scope: !7) -!13 = !{!0}  !14 = !{!6}  !15 = !DIFile(filename: "mu.c", directory: "/private/tmp")  !16 = !{} diff --git a/test/DebugInfo/X86/dbg-declare-arg.ll b/test/DebugInfo/X86/dbg-declare-arg.ll index c35bc8c5f629..7fd6296c7ee1 100644 --- a/test/DebugInfo/X86/dbg-declare-arg.ll +++ b/test/DebugInfo/X86/dbg-declare-arg.ll @@ -54,7 +54,7 @@ entry:    store %class.A* %this, %class.A** %this.addr, align 8    call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !43, metadata !DIExpression()), !dbg !44    %this1 = load %class.A*, %class.A** %this.addr -  call void @_ZN1AD2Ev(%class.A* %this1) +  call void @_ZN1AD2Ev(%class.A* %this1), !dbg !53    ret void, !dbg !45  } @@ -74,7 +74,7 @@ entry:  !0 = !DISubprogram(name: "~A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !1, type: !11)  !1 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 128, align: 32, file: !51, scope: !2, elements: !4) -!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130127)", isOptimized: false, emissionKind: 1, file: !51, enums: !{}, retainedTypes: !{}, subprograms: !50) +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130127)", isOptimized: false, emissionKind: FullDebug, file: !51, enums: !{}, retainedTypes: !{})  !3 = !DIFile(filename: "a.cc", directory: "/private/tmp")  !4 = !{!5, !7, !8, !9, !0, !10, !14}  !5 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 2, size: 32, align: 32, file: !51, scope: !3, baseType: !6) @@ -91,13 +91,13 @@ entry:  !16 = !{null, !13, !17}  !17 = !DIDerivedType(tag: DW_TAG_reference_type, scope: !2, baseType: !18)  !18 = !DIDerivedType(tag: DW_TAG_const_type, file: !3, baseType: !1) -!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !20) +!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !51, scope: !3, type: !20)  !20 = !DISubroutineType(types: !21)  !21 = !{!1} -!22 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23) +!22 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !51, scope: !3, type: !23)  !23 = !DISubroutineType(types: !24)  !24 = !{null} -!25 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23) +!25 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !51, scope: !3, type: !23)  !26 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !19, file: !3, type: !6)  !27 = !DILocation(line: 4, column: 11, scope: !19)  !28 = !DILocalVariable(name: "j", line: 5, scope: !29, file: !3, type: !6) @@ -122,6 +122,6 @@ entry:  !47 = !DILocation(line: 2, column: 47, scope: !25)  !48 = !DILocation(line: 2, column: 54, scope: !49)  !49 = distinct !DILexicalBlock(line: 2, column: 52, file: !51, scope: !25) -!50 = !{!19, !22, !25}  !51 = !DIFile(filename: "a.cc", directory: "/private/tmp")  !52 = !{i32 1, !"Debug Info Version", i32 3} +!53 = !DILocation(line: 0, scope: !22) diff --git a/test/DebugInfo/X86/dbg-declare.ll b/test/DebugInfo/X86/dbg-declare.ll index 1d6cfe859596..29c900132551 100644 --- a/test/DebugInfo/X86/dbg-declare.ll +++ b/test/DebugInfo/X86/dbg-declare.ll @@ -30,10 +30,9 @@ declare void @llvm.stackrestore(i8*) nounwind  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!27} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153698)", isOptimized: false, emissionKind: 0, file: !26, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153698)", isOptimized: false, emissionKind: FullDebug, file: !26, enums: !1, retainedTypes: !1, globals: !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "foo", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !26, scope: !0, type: !7) +!5 = distinct !DISubprogram(name: "foo", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !26, scope: !0, type: !7)  !6 = !DIFile(filename: "20020104-2.c", directory: "/Volumes/Sandbox/llvm")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !10} diff --git a/test/DebugInfo/X86/dbg-file-name.ll b/test/DebugInfo/X86/dbg-file-name.ll index 60954b9746ba..251952df1910 100644 --- a/test/DebugInfo/X86/dbg-file-name.ll +++ b/test/DebugInfo/X86/dbg-file-name.ll @@ -1,6 +1,7 @@  ; RUN: llc -enable-dwarf-directory -mtriple x86_64-apple-darwin10.0.0  < %s | FileCheck %s -; Radar 8884898 +; Verify that the file name is relative to the directory. +; rdar://problem/8884898  ; CHECK: file	1 "simple.c"  declare i32 @printf(i8*, ...) nounwind @@ -13,12 +14,11 @@ define i32 @main() nounwind !dbg !6 {  !llvm.module.flags = !{!12}  !1 = !DIFile(filename: "simple.c", directory: "/Users/manav/one/two") -!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "LLVM build 00", isOptimized: true, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "LLVM build 00", isOptimized: true, emissionKind: FullDebug, file: !10, enums: !11, retainedTypes: !11)  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = distinct !DISubprogram(name: "main", linkageName: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !10, scope: !1, type: !7) +!6 = distinct !DISubprogram(name: "main", linkageName: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !10, scope: !1, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{!5} -!9 = !{!6}  !10 = !DIFile(filename: "simple.c", directory: "/Users/manav/one/two")  !11 = !{}  !12 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/dbg-i128-const.ll b/test/DebugInfo/X86/dbg-i128-const.ll index 80ea1769b60e..64e2d8f77295 100644 --- a/test/DebugInfo/X86/dbg-i128-const.ll +++ b/test/DebugInfo/X86/dbg-i128-const.ll @@ -19,16 +19,15 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !0 = !{i128 42 }  !1 = !DILocalVariable(name: "MAX", line: 29, scope: !2, file: !4, type: !8)  !2 = distinct !DILexicalBlock(line: 26, column: 0, file: !13, scope: !3) -!3 = distinct !DISubprogram(name: "__foo", linkageName: "__foo", line: 26, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 26, file: !13, scope: !4, type: !6) +!3 = distinct !DISubprogram(name: "__foo", linkageName: "__foo", line: 26, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !5, scopeLine: 26, file: !13, scope: !4, type: !6)  !4 = !DIFile(filename: "foo.c", directory: "/tmp") -!5 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clang", isOptimized: true, emissionKind: 0, file: !13, enums: !15, retainedTypes: !15, subprograms: !12, imports:  null) +!5 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clang", isOptimized: true, emissionKind: FullDebug, file: !13, enums: !15, retainedTypes: !15, imports:  null)  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8, !8}  !8 = !DIDerivedType(tag: DW_TAG_typedef, name: "ti_int", line: 78, file: !14, scope: !4, baseType: !10)  !9 = !DIFile(filename: "myint.h", directory: "/tmp")  !10 = !DIBasicType(tag: DW_TAG_base_type, size: 128, align: 128, encoding: DW_ATE_signed)  !11 = !DILocation(line: 29, scope: !2) -!12 = !{!3}  !13 = !DIFile(filename: "foo.c", directory: "/tmp")  !14 = !DIFile(filename: "myint.h", directory: "/tmp")  !15 = !{} diff --git a/test/DebugInfo/X86/dbg-merge-loc-entry.ll b/test/DebugInfo/X86/dbg-merge-loc-entry.ll index fc5c1bbd529d..17fd0d54d40d 100644 --- a/test/DebugInfo/X86/dbg-merge-loc-entry.ll +++ b/test/DebugInfo/X86/dbg-merge-loc-entry.ll @@ -40,16 +40,16 @@ declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!32} -!0 = distinct !DISubprogram(name: "__udivmodti4", line: 879, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 879, file: !29, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "__udivmodti4", line: 879, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 879, file: !29, scope: !1, type: !3)  !1 = !DIFile(filename: "foobar.c", directory: "/tmp") -!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !29, enums: !31, retainedTypes: !31, subprograms: !28, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !29, enums: !31, retainedTypes: !31, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{!5, !5, !5, !8}  !5 = !DIDerivedType(tag: DW_TAG_typedef, name: "UTItype", line: 166, file: !30, scope: !6, baseType: !7)  !6 = !DIFile(filename: "foobar.h", directory: "/tmp")  !7 = !DIBasicType(tag: DW_TAG_base_type, size: 128, align: 128, encoding: DW_ATE_unsigned)  !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !29, scope: !1, baseType: !5) -!9 = distinct !DISubprogram(name: "__divti3", linkageName: "__divti3", line: 1094, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1094, file: !29, scope: !1, type: !10) +!9 = distinct !DISubprogram(name: "__divti3", linkageName: "__divti3", line: 1094, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 1094, file: !29, scope: !1, type: !10)  !10 = !DISubroutineType(types: !11)  !11 = !{!12, !12, !12}  !12 = !DIDerivedType(tag: DW_TAG_typedef, name: "TItype", line: 160, file: !30, scope: !6, baseType: !13) @@ -68,7 +68,6 @@ declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone  !25 = distinct !DILexicalBlock(line: 879, column: 0, file: !29, scope: !0)  !26 = !DILocation(line: 1107, scope: !18)  !27 = !DILocation(line: 1111, scope: !18) -!28 = !{!0, !9}  !29 = !DIFile(filename: "foobar.c", directory: "/tmp")  !30 = !DIFile(filename: "foobar.h", directory: "/tmp")  !31 = !{} diff --git a/test/DebugInfo/X86/dbg-prolog-end.ll b/test/DebugInfo/X86/dbg-prolog-end.ll index c3802b9bfa5a..a3e9db96c8f2 100644 --- a/test/DebugInfo/X86/dbg-prolog-end.ll +++ b/test/DebugInfo/X86/dbg-prolog-end.ll @@ -36,13 +36,13 @@ entry:  !llvm.module.flags = !{!21}  !18 = !{!1, !6} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131100)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18, imports:  null) -!1 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !19, scope: !2, type: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131100)", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !20, retainedTypes: !20, imports:  null) +!1 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !19, scope: !2, type: !3)  !2 = !DIFile(filename: "/tmp/a.c", directory: "/private/tmp")  !3 = !DISubroutineType(types: !4)  !4 = !{!5}  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !19, scope: !2, type: !3) +!6 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 7, file: !19, scope: !2, type: !3)  !7 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !1, file: !2, type: !5)  !8 = !DILocation(line: 1, column: 13, scope: !1)  !9 = !DILocalVariable(name: "j", line: 2, scope: !10, file: !2, type: !5) diff --git a/test/DebugInfo/X86/dbg-subrange.ll b/test/DebugInfo/X86/dbg-subrange.ll index 5239daea800b..6c69053ae67d 100644 --- a/test/DebugInfo/X86/dbg-subrange.ll +++ b/test/DebugInfo/X86/dbg-subrange.ll @@ -15,10 +15,9 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!22} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 144833)", isOptimized: false, emissionKind: 0, file: !21, enums: !1, retainedTypes: !1, subprograms: !3, globals: !11, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 144833)", isOptimized: false, emissionKind: FullDebug, file: !21, enums: !1, retainedTypes: !1, globals: !11, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "bar", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !21, scope: !6, type: !7) +!5 = distinct !DISubprogram(name: "bar", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !21, scope: !6, type: !7)  !6 = !DIFile(filename: "small.c", directory: "/private/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{null} diff --git a/test/DebugInfo/X86/dbg-value-const-byref.ll b/test/DebugInfo/X86/dbg-value-const-byref.ll index 2b4c1dc1a937..195efce5b8d7 100644 --- a/test/DebugInfo/X86/dbg-value-const-byref.ll +++ b/test/DebugInfo/X86/dbg-value-const-byref.ll @@ -78,11 +78,10 @@ attributes #3 = { nounwind }  !llvm.module.flags = !{!11, !12}  !llvm.ident = !{!13} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "dbg-value-const-byref.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !9) +!4 = distinct !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !9)  !5 = !DIFile(filename: "dbg-value-const-byref.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/dbg-value-dag-combine.ll b/test/DebugInfo/X86/dbg-value-dag-combine.ll index 6243be8aa4a6..62e53bb3f532 100644 --- a/test/DebugInfo/X86/dbg-value-dag-combine.ll +++ b/test/DebugInfo/X86/dbg-value-dag-combine.ll @@ -1,8 +1,15 @@  ; RUN: llc < %s | FileCheck %s -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -target triple = "x86_64-apple-darwin10.0.0" +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32" +target triple = "i686-apple-darwin"  ; PR 9817 +; There should be a DEBUG_VALUE for each call to llvm.dbg.value + +; CHECK:  ##DEBUG_VALUE: __OpenCL_test_kernel:ip <-  +; CHECK:  ##DEBUG_VALUE: xxx <- 0 +; CHECK:  ##DEBUG_VALUE: gid <- %E{{..$}} +; CHECK:  ##DEBUG_VALUE: idx <- %E{{..$}} +; CHECK-NOT:  ##DEBUG_VALUE:  declare <4 x i32> @__amdil_get_global_id_int()  declare void @llvm.dbg.value(metadata, i64, metadata, metadata) @@ -12,10 +19,9 @@ entry:    %0 = call <4 x i32> @__amdil_get_global_id_int() nounwind    %1 = extractelement <4 x i32> %0, i32 0    call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !9, metadata !DIExpression()), !dbg !11 -  call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !13, metadata !DIExpression()), !dbg !14 +  call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !21, metadata !DIExpression()), !dbg !14    %tmp2 = load i32, i32 addrspace(1)* %ip, align 4, !dbg !15    %tmp3 = add i32 0, %tmp2, !dbg !15 -; CHECK:  ##DEBUG_VALUE: idx <- %E{{..$}}    call void @llvm.dbg.value(metadata i32 %tmp3, i64 0, metadata !13, metadata !DIExpression()), !dbg !15    %arrayidx = getelementptr i32, i32 addrspace(1)* %ip, i32 %1, !dbg !16    store i32 %tmp3, i32 addrspace(1)* %arrayidx, align 4, !dbg !16 @@ -24,9 +30,9 @@ entry:  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!20} -!0 = distinct !DISubprogram(name: "__OpenCL_test_kernel", linkageName: "__OpenCL_test_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !19, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "__OpenCL_test_kernel", linkageName: "__OpenCL_test_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2, file: !19, scope: !1, type: !3)  !1 = !DIFile(filename: "OCL6368.tmp.cl", directory: "E:CUsersCmvillmow.AMDCAppDataCLocalCTemp") -!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !19, enums: !12, retainedTypes: !12, subprograms: !18, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !12, retainedTypes: !12, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{null, !5}  !5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: !6) @@ -42,6 +48,6 @@ entry:  !15 = !DILocation(line: 5, column: 15, scope: !10)  !16 = !DILocation(line: 6, column: 18, scope: !10)  !17 = !DILocation(line: 7, column: 1, scope: !0) -!18 = !{!0}  !19 = !DIFile(filename: "OCL6368.tmp.cl", directory: "E:\5CUsers\5Cmvillmow.AMD\5CAppData\5CLocal\5CTemp")  !20 = !{i32 1, !"Debug Info Version", i32 3} +!21 = !DILocalVariable(name: "xxx", line: 4, scope: !10, file: !1, type: !6) diff --git a/test/DebugInfo/X86/dbg-value-inlined-parameter.ll b/test/DebugInfo/X86/dbg-value-inlined-parameter.ll index 7ec21f8cf7cb..f647d60ff74c 100644 --- a/test/DebugInfo/X86/dbg-value-inlined-parameter.ll +++ b/test/DebugInfo/X86/dbg-value-inlined-parameter.ll @@ -74,13 +74,13 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!43} -!0 = distinct !DISubprogram(name: "foo", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !1, scope: !1, type: !3, variables: !41) +!0 = distinct !DISubprogram(name: "foo", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 8, file: !1, scope: !1, type: !3, variables: !41)  !1 = !DIFile(filename: "nm2.c", directory: "/private/tmp") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 125693)", isOptimized: true, emissionKind: 1, file: !42, enums: !{}, retainedTypes: !{}, subprograms: !39, globals: !40, imports:  !44) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 125693)", isOptimized: true, emissionKind: FullDebug, file: !42, enums: !{}, retainedTypes: !{}, globals: !40, imports:  !44)  !3 = !DISubroutineType(types: !4)  !4 = !{!5}  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = distinct !DISubprogram(name: "foobar", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: !1, type: !7) +!6 = distinct !DISubprogram(name: "foobar", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, file: !1, scope: !1, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{null}  !9 = !DILocalVariable(name: "sp", line: 7, arg: 1, scope: !0, file: !1, type: !10) @@ -109,7 +109,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !36 = !DILocation(line: 9, column: 3, scope: !23, inlinedAt: !32)  !37 = !DILocation(line: 10, column: 3, scope: !23, inlinedAt: !32)  !38 = !DILocation(line: 17, column: 1, scope: !33) -!39 = !{!0, !6}  !40 = !{!19}  !41 = !{!9, !18}  !42 = !DIFile(filename: "nm2.c", directory: "/private/tmp") diff --git a/test/DebugInfo/X86/dbg-value-isel.ll b/test/DebugInfo/X86/dbg-value-isel.ll index ae76beb81409..66a5a6be75be 100644 --- a/test/DebugInfo/X86/dbg-value-isel.ll +++ b/test/DebugInfo/X86/dbg-value-isel.ll @@ -81,12 +81,12 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!22} -!0 = distinct !DISubprogram(name: "__OpenCL_nbt02_kernel", linkageName: "__OpenCL_nbt02_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "__OpenCL_nbt02_kernel", linkageName: "__OpenCL_nbt02_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2, file: !20, scope: !1, type: !3)  !1 = !DIFile(filename: "OCLlLwTXZ.cl", directory: "/tmp") -!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !19, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !21, retainedTypes: !21, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{null, !5} -!5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: !6) +!5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align:64, scope: !2, baseType: !6)  !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint", file: !20, scope: !2, baseType: !7)  !7 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)  !8 = !DILocalVariable(name: "ip", line: 1, arg: 1, scope: !0, file: !1, type: !5) @@ -100,7 +100,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !16 = !DILocation(line: 7, column: 26, scope: !11)  !17 = !DILocation(line: 9, column: 24, scope: !11)  !18 = !DILocation(line: 10, column: 1, scope: !0) -!19 = !{!0}  !20 = !DIFile(filename: "OCLlLwTXZ.cl", directory: "/tmp")  !21 = !{}  !22 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/dbg-value-location.ll b/test/DebugInfo/X86/dbg-value-location.ll index df9b4085bf37..03ba65bc10bc 100644 --- a/test/DebugInfo/X86/dbg-value-location.ll +++ b/test/DebugInfo/X86/dbg-value-location.ll @@ -50,15 +50,15 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!29} -!0 = distinct !DISubprogram(name: "foo", line: 19510, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 19510, file: !26, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "foo", line: 19510, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 19510, file: !26, scope: !1, type: !3)  !1 = !DIFile(filename: "/tmp/f.c", directory: "/tmp") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124753)", isOptimized: true, emissionKind: 0, file: !27, enums: !28, retainedTypes: !28, subprograms: !24, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124753)", isOptimized: true, emissionKind: FullDebug, file: !27, enums: !28, retainedTypes: !28, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{!5}  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = distinct !DISubprogram(name: "bar3", line: 14827, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) -!7 = distinct !DISubprogram(name: "bar2", line: 15397, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) -!8 = distinct !DISubprogram(name: "bar", line: 12382, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !9) +!6 = distinct !DISubprogram(name: "bar3", line: 14827, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !3) +!7 = distinct !DISubprogram(name: "bar2", line: 15397, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !3) +!8 = distinct !DISubprogram(name: "bar", line: 12382, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !9)  !9 = !DISubroutineType(types: !10)  !10 = !{!11}  !11 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) @@ -66,12 +66,11 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !13 = !DILocation(line: 19509, column: 20, scope: !0)  !14 = !DILocation(line: 18091, column: 2, scope: !15, inlinedAt: !17)  !15 = distinct !DILexicalBlock(line: 18086, column: 1, file: !26, scope: !16) -!16 = distinct !DISubprogram(name: "foo_bar", line: 18086, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) +!16 = distinct !DISubprogram(name: "foo_bar", line: 18086, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !3)  !17 = !DILocation(line: 19514, column: 2, scope: !18)  !18 = distinct !DILexicalBlock(line: 19510, column: 1, file: !26, scope: !0)  !22 = !DILocation(line: 18094, column: 2, scope: !15, inlinedAt: !17)  !23 = !DILocation(line: 19524, column: 1, scope: !18) -!24 = !{!0, !6, !7, !8, !16}  !25 = !DIFile(filename: "f.i", directory: "/tmp")  !26 = !DIFile(filename: "/tmp/f.c", directory: "/tmp")  !27 = !DIFile(filename: "f.i", directory: "/tmp") diff --git a/test/DebugInfo/X86/dbg-value-range.ll b/test/DebugInfo/X86/dbg-value-range.ll index 2bb5e021036f..7a9a69a0a1f1 100644 --- a/test/DebugInfo/X86/dbg-value-range.ll +++ b/test/DebugInfo/X86/dbg-value-range.ll @@ -20,9 +20,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!2}  !llvm.module.flags = !{!24} -!0 = distinct !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !22, scope: !1, type: !3, variables: !21) +!0 = distinct !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !22, scope: !1, type: !3, variables: !21)  !1 = !DIFile(filename: "bar.c", directory: "/private/tmp") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 122997)", isOptimized: true, emissionKind: 1, file: !22, enums: !23, retainedTypes: !23, subprograms: !20, imports:  null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 122997)", isOptimized: true, emissionKind: FullDebug, file: !22, enums: !23, retainedTypes: !23, imports:  null)  !3 = !DISubroutineType(types: !4)  !4 = !{!5}  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -37,7 +37,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !14 = !DILocation(line: 6, column: 14, scope: !12)  !18 = !DILocation(line: 7, column: 2, scope: !12)  !19 = !DILocation(line: 8, column: 2, scope: !12) -!20 = !{!0}  !21 = !{!6, !11}  !22 = !DIFile(filename: "bar.c", directory: "/private/tmp")  !23 = !{} diff --git a/test/DebugInfo/X86/dbg-value-regmask-clobber.ll b/test/DebugInfo/X86/dbg-value-regmask-clobber.ll new file mode 100644 index 000000000000..31a065898b13 --- /dev/null +++ b/test/DebugInfo/X86/dbg-value-regmask-clobber.ll @@ -0,0 +1,116 @@ +; RUN: llc < %s | FileCheck %s --check-prefix=ASM +; RUN: llc < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s --check-prefix=DWARF + +; Values in registers should be clobbered by calls, which use a regmask instead +; of individual register def operands. + +; ASM: main: # @main +; ASM: #DEBUG_VALUE: main:argc <- %ECX +; ASM: movl $1, x(%rip) +; ASM: callq clobber +; ASM-NEXT: [[argc_range_end:.Ltmp[0-9]+]]: +; Previously LiveDebugValues would claim argc was still in ECX after the call. +; ASM-NOT: #DEBUG_VALUE: main:argc + +; argc is the first debug location. +; ASM: .Ldebug_loc1: +; ASM-NEXT: .quad   .Lfunc_begin0-.Lfunc_begin0 +; ASM-NEXT: .quad   [[argc_range_end]]-.Lfunc_begin0 +; ASM-NEXT: .short  3                       # Loc expr size +; ASM-NEXT: .byte   82                      # super-register DW_OP_reg2 +; ASM-NEXT: .byte   147                     # DW_OP_piece +; ASM-NEXT: .byte   4                       # 4 + +; argc is the first formal parameter. +; DWARF: .debug_info contents: +; DWARF:  DW_TAG_formal_parameter +; DWARF-NEXT:    DW_AT_location [DW_FORM_sec_offset]   ([[argc_loc_offset:0x.*]]) +; DWARF-NEXT:    DW_AT_name [DW_FORM_strp]     {{.*}} "argc" + +; DWARF: .debug_loc contents: +; DWARF: [[argc_loc_offset]]: Beginning address offset: 0x0000000000000000 +; DWARF-NEXT:                    Ending address offset: 0x0000000000000013 +; DWARF-NEXT:                     Location description: 52 93 04 + +; ModuleID = 't.cpp' +target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc18.0.0" + +@x = common global i32 0, align 4 + +; Function Attrs: nounwind uwtable +define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 !dbg !4 { +entry: +  tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !12, metadata !21), !dbg !22 +  tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !13, metadata !21), !dbg !23 +  store volatile i32 1, i32* @x, align 4, !dbg !24, !tbaa !25 +  tail call void @clobber() #3, !dbg !29 +  store volatile i32 2, i32* @x, align 4, !dbg !30, !tbaa !25 +  %0 = load volatile i32, i32* @x, align 4, !dbg !31, !tbaa !25 +  %tobool = icmp eq i32 %0, 0, !dbg !31 +  br i1 %tobool, label %if.else, label %if.then, !dbg !33 + +if.then:                                          ; preds = %entry +  store volatile i32 3, i32* @x, align 4, !dbg !34, !tbaa !25 +  br label %if.end, !dbg !36 + +if.else:                                          ; preds = %entry +  store volatile i32 4, i32* @x, align 4, !dbg !37, !tbaa !25 +  br label %if.end + +if.end:                                           ; preds = %if.else, %if.then +  ret i32 0, !dbg !39 +} + +declare void @clobber() + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 + +attributes #0 = { nounwind uwtable } +attributes #2 = { nounwind readnone } +attributes #3 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!17, !18, !19} +!llvm.ident = !{!20} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !14) +!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild") +!2 = !{} +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11) +!5 = !DISubroutineType(types: !6) +!6 = !{!7, !7, !8} +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64) +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64) +!10 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!11 = !{!12, !13} +!12 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 4, type: !8) +!13 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 4, type: !7) +!14 = !{!15} +!15 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !16, isLocal: false, isDefinition: true, variable: i32* @x) +!16 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7) +!17 = !{i32 2, !"Dwarf Version", i32 4} +!18 = !{i32 2, !"Debug Info Version", i32 3} +!19 = !{i32 1, !"PIC Level", i32 2} +!20 = !{!"clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)"} +!21 = !DIExpression() +!22 = !DILocation(line: 4, column: 27, scope: !4) +!23 = !DILocation(line: 4, column: 14, scope: !4) +!24 = !DILocation(line: 5, column: 5, scope: !4) +!25 = !{!26, !26, i64 0} +!26 = !{!"int", !27, i64 0} +!27 = !{!"omnipotent char", !28, i64 0} +!28 = !{!"Simple C/C++ TBAA"} +!29 = !DILocation(line: 6, column: 3, scope: !4) +!30 = !DILocation(line: 7, column: 5, scope: !4) +!31 = !DILocation(line: 8, column: 7, scope: !32) +!32 = distinct !DILexicalBlock(scope: !4, file: !1, line: 8, column: 7) +!33 = !DILocation(line: 8, column: 7, scope: !4) +!34 = !DILocation(line: 9, column: 7, scope: !35) +!35 = distinct !DILexicalBlock(scope: !32, file: !1, line: 8, column: 10) +!36 = !DILocation(line: 10, column: 3, scope: !35) +!37 = !DILocation(line: 11, column: 7, scope: !38) +!38 = distinct !DILexicalBlock(scope: !32, file: !1, line: 10, column: 10) +!39 = !DILocation(line: 13, column: 1, scope: !4) diff --git a/test/DebugInfo/X86/dbg-value-terminator.ll b/test/DebugInfo/X86/dbg-value-terminator.ll index 8b8bdec18ab1..2f62ed3a06f1 100644 --- a/test/DebugInfo/X86/dbg-value-terminator.ll +++ b/test/DebugInfo/X86/dbg-value-terminator.ll @@ -7,6 +7,7 @@  ;  ; CHECK-LABEL: test:  ; CHECK: ##DEBUG_VALUE: foo:i +  %a = type { i32, i32 }  define hidden fastcc %a* @test() #1 !dbg !1 { @@ -87,7 +88,7 @@ VEC_edge_base_index.exit7.i:                      ; preds = %"3.i5.i"  "44.i":                                           ; preds = %"42.i"    %2 = load %a*, %a** undef, align 8, !dbg !12    %3 = bitcast %a* %2 to %a*, !dbg !12 -  call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression()), !dbg !12 +  call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression(DW_OP_deref)), !dbg !12    br label %may_unswitch_on.exit, !dbg !12  "45.i":                                           ; preds = %"38.i" @@ -113,8 +114,8 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!22} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version", isOptimized: true, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !18, imports:  null) -!1 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !20, scope: !2, type: !3, variables: !19) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version", isOptimized: true, emissionKind: FullDebug, file: !20, enums: !21, retainedTypes: !21, imports:  null) +!1 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, file: !20, scope: !2, type: !3, variables: !19)  !2 = !DIFile(filename: "a.c", directory: "/private/tmp")  !3 = !DISubroutineType(types: !4)  !4 = !{!5} @@ -126,7 +127,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !10 = !DILocalVariable(name: "a", line: 3, scope: !11, file: !2, type: !9)  !11 = distinct !DILexicalBlock(line: 2, column: 25, file: !20, scope: !1)  !12 = !DILocation(line: 2, column: 13, scope: !1) -!18 = !{!1}  !19 = !{!6, !7, !10}  !20 = !DIFile(filename: "a.c", directory: "/private/tmp")  !21 = !{} diff --git a/test/DebugInfo/X86/dbg_value_direct.ll b/test/DebugInfo/X86/dbg_value_direct.ll index b7f1ec8ccaa3..58560e4c81d4 100644 --- a/test/DebugInfo/X86/dbg_value_direct.ll +++ b/test/DebugInfo/X86/dbg_value_direct.ll @@ -147,11 +147,10 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!22, !27} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "crash.cpp", directory: "/tmp")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "crash.cpp", directory: "/tmp")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !21} diff --git a/test/DebugInfo/X86/debug-dead-local-var.ll b/test/DebugInfo/X86/debug-dead-local-var.ll index 9a2872aeb0a8..eca0395336d9 100644 --- a/test/DebugInfo/X86/debug-dead-local-var.ll +++ b/test/DebugInfo/X86/debug-dead-local-var.ll @@ -11,9 +11,12 @@  ;   return 1;  ; } -; Check that we still have the structure type for X even though we're not -; going to emit a low/high_pc for foo. -; CHECK: DW_TAG_structure_type +; Check that we don't have the structure type for X since its scope has +; been optimized away. +; CHECK-NOT: DW_TAG_structure_type +; CHECK: DW_TAG_subprogram +; CHECK: DW_AT_name {{.*}}"bar" +; CHECK-NOT: DW_TAG_structure_type  ; Function Attrs: nounwind readnone uwtable  define i32 @bar() #0 !dbg !4 { @@ -27,16 +30,15 @@ attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-fra  !llvm.module.flags = !{!18, !19}  !llvm.ident = !{!20} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo")  !2 = !{} -!3 = !{!4, !9} -!4 = distinct !DISubprogram(name: "bar", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "bar", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo")  !6 = !DISubroutineType(types: !7)  !7 = !{!8}  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = distinct !DISubprogram(name: "foo", line: 6, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !10, variables: !12) +!9 = distinct !DISubprogram(name: "foo", line: 6, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !10, variables: !12)  !10 = !DISubroutineType(types: !11)  !11 = !{null}  !12 = !{!13} diff --git a/test/DebugInfo/X86/debug-info-access.ll b/test/DebugInfo/X86/debug-info-access.ll index c9a50395c716..f3ed35b94b92 100644 --- a/test/DebugInfo/X86/debug-info-access.ll +++ b/test/DebugInfo/X86/debug-info-access.ll @@ -106,44 +106,43 @@ attributes #0 = { nounwind ssp uwtable }  !llvm.module.flags = !{!38, !39}  !llvm.ident = !{!40} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !29, globals: !34, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !34, imports: !2)  !1 = !DIFile(filename: "/llvm/tools/clang/test/CodeGenCXX/debug-info-access.cpp", directory: "")  !2 = !{}  !3 = !{!4, !12, !22}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 3, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A")  !5 = !{!6, !8} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "pub_default_static", line: 7, flags: DIFlagStaticMember, file: !1, scope: !"_ZTS1A", baseType: !7) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "pub_default_static", line: 7, flags: DIFlagStaticMember, file: !1, scope: !4, baseType: !7)  !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = !DISubprogram(name: "pub_default", linkageName: "_ZN1A11pub_defaultEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS1A", type: !9) +!8 = !DISubprogram(name: "pub_default", linkageName: "_ZN1A11pub_defaultEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !4, type: !9)  !9 = !DISubroutineType(types: !10)  !10 = !{null, !11} -!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)  !12 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 11, size: 8, align: 8, file: !1, elements: !13, identifier: "_ZTS1B")  !13 = !{!14, !15, !16, !20, !21} -!14 = !DIDerivedType(tag: DW_TAG_inheritance, flags: DIFlagPublic, scope: !"_ZTS1B", baseType: !"_ZTS1A") -!15 = !DIDerivedType(tag: DW_TAG_member, name: "public_static", line: 16, flags: DIFlagPublic | DIFlagStaticMember, file: !1, scope: !"_ZTS1B", baseType: !7) -!16 = !DISubprogram(name: "pub", linkageName: "_ZN1B3pubEv", line: 14, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !"_ZTS1B", type: !17) +!14 = !DIDerivedType(tag: DW_TAG_inheritance, flags: DIFlagPublic, scope: !12, baseType: !4) +!15 = !DIDerivedType(tag: DW_TAG_member, name: "public_static", line: 16, flags: DIFlagPublic | DIFlagStaticMember, file: !1, scope: !12, baseType: !7) +!16 = !DISubprogram(name: "pub", linkageName: "_ZN1B3pubEv", line: 14, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !12, type: !17)  !17 = !DISubroutineType(types: !18)  !18 = !{null, !19} -!19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B") -!20 = !DISubprogram(name: "prot", linkageName: "_ZN1B4protEv", line: 19, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !1, scope: !"_ZTS1B", type: !17) -!21 = !DISubprogram(name: "priv_default", linkageName: "_ZN1B12priv_defaultEv", line: 22, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 22, file: !1, scope: !"_ZTS1B", type: !17) +!19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !12) +!20 = !DISubprogram(name: "prot", linkageName: "_ZN1B4protEv", line: 19, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !1, scope: !12, type: !17) +!21 = !DISubprogram(name: "priv_default", linkageName: "_ZN1B12priv_defaultEv", line: 22, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 22, file: !1, scope: !12, type: !17)  !22 = !DICompositeType(tag: DW_TAG_union_type, name: "U", line: 25, size: 32, align: 32, file: !1, elements: !23, identifier: "_ZTS1U")  !23 = !{!24, !25} -!24 = !DIDerivedType(tag: DW_TAG_member, name: "union_priv", line: 30, size: 32, align: 32, flags: DIFlagPrivate, file: !1, scope: !"_ZTS1U", baseType: !7) -!25 = !DISubprogram(name: "union_pub_default", linkageName: "_ZN1U17union_pub_defaultEv", line: 27, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 27, file: !1, scope: !"_ZTS1U", type: !26) +!24 = !DIDerivedType(tag: DW_TAG_member, name: "union_priv", line: 30, size: 32, align: 32, flags: DIFlagPrivate, file: !1, scope: !22, baseType: !7) +!25 = !DISubprogram(name: "union_pub_default", linkageName: "_ZN1U17union_pub_defaultEv", line: 27, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 27, file: !1, scope: !22, type: !26)  !26 = !DISubroutineType(types: !27)  !27 = !{null, !28} -!28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1U") -!29 = !{!30} -!30 = distinct !DISubprogram(name: "free", linkageName: "_Z4freev", line: 35, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 35, file: !1, scope: !31, type: !32, variables: !2) +!28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !22) +!30 = distinct !DISubprogram(name: "free", linkageName: "_Z4freev", line: 35, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 35, file: !1, scope: !31, type: !32, variables: !2)  !31 = !DIFile(filename: "/llvm/tools/clang/test/CodeGenCXX/debug-info-access.cpp", directory: "")  !32 = !DISubroutineType(types: !33)  !33 = !{null}  !34 = !{!35, !36, !37} -!35 = !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !"_ZTS1A", variable: %struct.A* @a) -!36 = !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !"_ZTS1B", variable: %class.B* @b) -!37 = !DIGlobalVariable(name: "u", line: 39, isLocal: false, isDefinition: true, scope: null, file: !31, type: !"_ZTS1U", variable: %union.U* @u) +!35 = !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !4, variable: %struct.A* @a) +!36 = !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !12, variable: %class.B* @b) +!37 = !DIGlobalVariable(name: "u", line: 39, isLocal: false, isDefinition: true, scope: null, file: !31, type: !22, variable: %union.U* @u)  !38 = !{i32 2, !"Dwarf Version", i32 2}  !39 = !{i32 2, !"Debug Info Version", i32 3}  !40 = !{!"clang version 3.6.0 "} diff --git a/test/DebugInfo/X86/debug-info-block-captured-self.ll b/test/DebugInfo/X86/debug-info-block-captured-self.ll index 1c3dc24b3240..e3cfca19955e 100644 --- a/test/DebugInfo/X86/debug-info-block-captured-self.ll +++ b/test/DebugInfo/X86/debug-info-block-captured-self.ll @@ -80,13 +80,12 @@ define internal void @"__24-[Main initWithContext:]_block_invoke_2"(i8* %.block_  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!108} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !107, enums: !2, retainedTypes: !4, subprograms: !23, globals: !15, imports:  !15) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !107, enums: !2, retainedTypes: !4, globals: !15, imports:  !15)  !1 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/debug-info-block-captured-self.m", directory: "")  !2 = !{!3}  !3 = !DICompositeType(tag: DW_TAG_enumeration_type, line: 20, size: 32, align: 32, file: !107, elements: !4)  !4 = !{}  !15 = !{} -!23 = !{!38, !42}  !27 = !DIDerivedType(tag: DW_TAG_typedef, name: "id", line: 31, file: !107, baseType: !28)  !28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !29)  !29 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_object", file: !107, elements: !30) @@ -95,11 +94,11 @@ define internal void @"__24-[Main initWithContext:]_block_invoke_2"(i8* %.block_  !32 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !33)  !33 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_class", flags: DIFlagFwdDecl, file: !107)  !34 = !DICompositeType(tag: DW_TAG_structure_type, name: "Main", line: 23, flags: DIFlagArtificial | DIFlagObjectPointer, runtimeLang: DW_LANG_ObjC, file: !107) -!38 = distinct !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke", line: 33, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 33, file: !1, scope: !1, type: !39, variables: !15) +!38 = distinct !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke", line: 33, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 33, file: !1, scope: !1, type: !39, variables: !15)  !39 = !DISubroutineType(types: !40)  !40 = !{null, !41, !27}  !41 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) -!42 = distinct !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke_2", line: 35, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 35, file: !1, scope: !1, type: !39, variables: !15) +!42 = distinct !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke_2", line: 35, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 35, file: !1, scope: !1, type: !39, variables: !15)  !84 = !DILocation(line: 33, scope: !38)  !86 = !DILocalVariable(name: "self", line: 41, scope: !38, file: !1, type: !34)  !87 = !DILocation(line: 41, scope: !38) diff --git a/test/DebugInfo/X86/debug-info-blocks.ll b/test/DebugInfo/X86/debug-info-blocks.ll index 8a929491f28d..859eef804bb1 100644 --- a/test/DebugInfo/X86/debug-info-blocks.ll +++ b/test/DebugInfo/X86/debug-info-blocks.ll @@ -270,7 +270,7 @@ attributes #3 = { nounwind }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!56, !57, !58, !59, !110} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !2, imports:  !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports:  !2)  !1 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/<unknown>", directory: "llvm/_build.ninja.Debug")  !2 = !{}  !3 = !{!4} @@ -282,8 +282,7 @@ attributes #3 = { nounwind }  !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "NSObject", line: 21, align: 8, runtimeLang: DW_LANG_ObjC, file: !5, scope: !6, elements: !2)  !10 = !DIDerivedType(tag: DW_TAG_member, name: "ivar", line: 35, size: 32, align: 32, file: !5, scope: !6, baseType: !11)  !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!12 = !{!13, !27, !31, !35, !36, !39} -!13 = distinct !DISubprogram(name: "-[A init]", line: 46, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 46, file: !5, scope: !6, type: !14, variables: !2) +!13 = distinct !DISubprogram(name: "-[A init]", line: 46, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 46, file: !5, scope: !6, type: !14, variables: !2)  !14 = !DISubroutineType(types: !15)  !15 = !{!16, !23, !24}  !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "id", line: 46, file: !5, baseType: !17) @@ -297,19 +296,19 @@ attributes #3 = { nounwind }  !24 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 46, flags: DIFlagArtificial, file: !5, baseType: !25)  !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !26)  !26 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_selector", flags: DIFlagFwdDecl, file: !1) -!27 = distinct !DISubprogram(name: "__9-[A init]_block_invoke", line: 49, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 49, file: !5, scope: !6, type: !28, variables: !2) +!27 = distinct !DISubprogram(name: "__9-[A init]_block_invoke", line: 49, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 49, file: !5, scope: !6, type: !28, variables: !2)  !28 = !DISubroutineType(types: !29)  !29 = !{null, !30}  !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) -!31 = distinct !DISubprogram(name: "__copy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 52, file: !1, scope: !32, type: !33, variables: !2) +!31 = distinct !DISubprogram(name: "__copy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 52, file: !1, scope: !32, type: !33, variables: !2)  !32 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/<unknown>", directory: "llvm/_build.ninja.Debug")  !33 = !DISubroutineType(types: !34)  !34 = !{null, !30, !30} -!35 = distinct !DISubprogram(name: "__destroy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 52, file: !1, scope: !32, type: !28, variables: !2) -!36 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 60, file: !5, scope: !6, type: !37, variables: !2) +!35 = distinct !DISubprogram(name: "__destroy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 52, file: !1, scope: !32, type: !28, variables: !2) +!36 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 60, file: !5, scope: !6, type: !37, variables: !2)  !37 = !DISubroutineType(types: !38)  !38 = !{!11} -!39 = distinct !DISubprogram(name: "run", line: 39, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 40, file: !5, scope: !6, type: !40, variables: !2) +!39 = distinct !DISubprogram(name: "run", line: 39, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 40, file: !5, scope: !6, type: !40, variables: !2)  !40 = !DISubroutineType(types: !41)  !41 = !{null, !42}  !42 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !43) diff --git a/test/DebugInfo/X86/debug-info-packed-struct.ll b/test/DebugInfo/X86/debug-info-packed-struct.ll index 50b68a714ea8..d041cf3bc887 100644 --- a/test/DebugInfo/X86/debug-info-packed-struct.ll +++ b/test/DebugInfo/X86/debug-info-packed-struct.ll @@ -148,7 +148,7 @@ target triple = "x86_64-apple-darwin"  !llvm.module.flags = !{!45, !46}  !llvm.ident = !{!47} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)  !1 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/<stdin>", directory: "/llvm/_build.ninja.release")  !2 = !{}  !3 = !{!4, !18, !25, !35} diff --git a/test/DebugInfo/X86/debug-info-static-member.ll b/test/DebugInfo/X86/debug-info-static-member.ll index a42279b0a4af..cbe51177c0f1 100644 --- a/test/DebugInfo/X86/debug-info-static-member.ll +++ b/test/DebugInfo/X86/debug-info-static-member.ll @@ -59,10 +59,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!34} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, emissionKind: 0, file: !33, enums: !1, retainedTypes: !1, subprograms: !3, globals: !10, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, emissionKind: FullDebug, file: !33, enums: !1, retainedTypes: !1, globals: !10, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !33, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 23, file: !33, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "/usr/local/google/home/blaikie/Development/llvm/src/tools/clang/test/CodeGenCXX/debug-info-static-member.cpp", directory: "/home/blaikie/local/Development/llvm/build/clang/x86-64/Debug/llvm")  !7 = !DISubroutineType(types: !8)  !8 = !{!9} diff --git a/test/DebugInfo/X86/debug-loc-asan.ll b/test/DebugInfo/X86/debug-loc-asan.ll index 2e0135574496..e4449a29281c 100644 --- a/test/DebugInfo/X86/debug-loc-asan.ll +++ b/test/DebugInfo/X86/debug-loc-asan.ll @@ -15,8 +15,12 @@  ; CHECK: #DEBUG_VALUE: bar:y <- [%RDI+0]  ; CHECK: movq %rdi, [[OFFSET:[0-9]+]](%rsp)  ; CHECK-NEXT: [[START_LABEL:.Ltmp[0-9]+]] +; CHECK-NEXT: #DEBUG_VALUE: bar:y <- [complex expression]  ; This location should be valid until the end of the function. +; CHECK:        movq    %rbp, %rsp +; CHECK-NEXT: [[END_LABEL:.Ltmp[0-9]+]]: +  ; CHECK: .Ldebug_loc{{[0-9]+}}:  ; We expect two location ranges for the variable. @@ -27,7 +31,7 @@  ; Then it's addressed via %rsp:  ; CHECK:      .quad [[START_LABEL]]-.Lfunc_begin0 -; CHECK-NEXT: .Lfunc_end0-.Lfunc_begin0 +; CHECK-NEXT: .quad [[END_LABEL]]-.Lfunc_begin0  ; CHECK: DW_OP_breg7  ; CHECK-NEXT: [[OFFSET]]  ; CHECK: DW_OP_deref @@ -164,11 +168,10 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!9, !10}  !llvm.ident = !{!11} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "test.cc", directory: "/llvm_cmake_gcc")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "test.cc", directory: "/llvm_cmake_gcc")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8} diff --git a/test/DebugInfo/X86/debug-loc-empty-entries.ll b/test/DebugInfo/X86/debug-loc-empty-entries.ll deleted file mode 100644 index 776bdbddfb02..000000000000 --- a/test/DebugInfo/X86/debug-loc-empty-entries.ll +++ /dev/null @@ -1,66 +0,0 @@ -; RUN: llc -mtriple=x86_64-apple-macosx <%s | FileCheck %s -; Test that we don't generate empty .debug_loc entries.  Originally, there were -; two empty .debug_loc entries for 'a' in an otherwise empty .debug_loc list. -; -; CHECK:      .section __DWARF,__debug_loc,regular,debug -; CHECK-NEXT: Lsection_debug_loc: -; CHECK-NEXT: .section __DWARF,__debug_abbrev,regular,debug -; -; Test that the variable stuck around. -; CHECK:      .section __DWARF,__debug_info,regular,debug -; CHECK:      DW_TAG_variable -; CHECK-NOT:  DW_AT_location - -; Generated using clang -cc1 with the following args: -; -;   -triple x86_64-apple-macosx -emit-llvm -gdwarf-4 -O1 -; -; From this testcase: -; -;;   void fn1() { -;;     float a = 1; -;;     for (;;) -;;       a = 0; -;;   } - -; Function Attrs: noreturn nounwind readnone -define void @_Z3fn1v() #0 !dbg !4 { -entry: -  tail call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !9, metadata !14), !dbg !15 -  br label %for.cond, !dbg !16 - -for.cond:                                         ; preds = %for.cond, %entry -  tail call void @llvm.dbg.value(metadata float 0.000000e+00, i64 0, metadata !9, metadata !14), !dbg !15 -  br label %for.cond, !dbg !17 -} - -; Function Attrs: nounwind readnone -declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 - -attributes #0 = { noreturn nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { nounwind readnone } - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!11, !12} -!llvm.ident = !{!13} - -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 238517) (llvm/trunk 238524)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) -!1 = !DIFile(filename: "<stdin>", directory: "/Users/dexonsmith/data/llvm/bootstrap/play/delta2/testcase") -!2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "fn1", linkageName: "_Z3fn1v", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !8) -!5 = !DIFile(filename: "t.cpp", directory: "/Users/dexonsmith/data/llvm/bootstrap/play/delta2/testcase") -!6 = !DISubroutineType(types: !7) -!7 = !{null} -!8 = !{!9} -!9 = !DILocalVariable(name: "a", scope: !4, file: !5, line: 2, type: !10) -!10 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) -!11 = !{i32 2, !"Dwarf Version", i32 4} -!12 = !{i32 2, !"Debug Info Version", i32 3} -!13 = !{!"clang version 3.7.0 (trunk 238517) (llvm/trunk 238524)"} -!14 = !DIExpression() -!15 = !DILocation(line: 2, scope: !4) -!16 = !DILocation(line: 3, scope: !4) -!17 = !DILocation(line: 3, scope: !18) -!18 = distinct !DILexicalBlock(scope: !19, file: !5, line: 3) -!19 = distinct !DILexicalBlock(scope: !4, file: !5, line: 3) diff --git a/test/DebugInfo/X86/debug-loc-offset.ll b/test/DebugInfo/X86/debug-loc-offset.ll index d6302a1e4247..8e3e1e97c319 100644 --- a/test/DebugInfo/X86/debug-loc-offset.ll +++ b/test/DebugInfo/X86/debug-loc-offset.ll @@ -116,21 +116,19 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !llvm.module.flags = !{!18, !19}  !llvm.ident = !{!20, !20} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "debug-loc-offset1.cc", directory: "/llvm_cmake_gcc")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "debug-loc-offset1.cc", directory: "/llvm_cmake_gcc")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8}  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: 1, file: !10, enums: !2, retainedTypes: !11, subprograms: !13, globals: !2, imports: !2) +!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !2, retainedTypes: !11, globals: !2, imports: !2)  !10 = !DIFile(filename: "debug-loc-offset2.cc", directory: "/llvm_cmake_gcc")  !11 = !{!12}  !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, flags: DIFlagFwdDecl, file: !10, identifier: "_ZTS1A") -!13 = !{!14} -!14 = distinct !DISubprogram(name: "baz", linkageName: "_Z3baz1A", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !10, scope: !15, type: !16, variables: !2) +!14 = distinct !DISubprogram(name: "baz", linkageName: "_Z3baz1A", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !9, scopeLine: 6, file: !10, scope: !15, type: !16, variables: !2)  !15 = !DIFile(filename: "debug-loc-offset2.cc", directory: "/llvm_cmake_gcc")  !16 = !DISubroutineType(types: !17)  !17 = !{null, !12} @@ -140,7 +138,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !21 = !DILocalVariable(name: "b", line: 1, arg: 1, scope: !4, file: !5, type: !8)  !22 = !DILocation(line: 1, scope: !4)  !23 = !DILocation(line: 2, scope: !4) -!24 = !DILocalVariable(name: "a", line: 6, arg: 1, scope: !14, file: !15, type: !"_ZTS1A") +!24 = !DILocalVariable(name: "a", line: 6, arg: 1, scope: !14, file: !15, type: !12)  !25 = !DILocation(line: 6, scope: !14)  !26 = !DILocalVariable(name: "z", line: 7, scope: !14, file: !15, type: !8)  !27 = !DILocation(line: 7, scope: !14) diff --git a/test/DebugInfo/X86/debug-macro.ll b/test/DebugInfo/X86/debug-macro.ll index b79e2de5ca45..2b3adce4776e 100644 --- a/test/DebugInfo/X86/debug-macro.ll +++ b/test/DebugInfo/X86/debug-macro.ll @@ -40,7 +40,7 @@  !llvm.module.flags = !{!13, !14}  !llvm.ident = !{!15} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, macros: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2, macros: !3)  !1 = !DIFile(filename: "debug-macro.cpp", directory: "/")  !2 = !{}  !3 = !{!4, !5} @@ -58,10 +58,10 @@  !14 = !{i32 1, !"Debug Info Version", i32 3}  !15 = !{!"clang version 3.5.0 "} -!16 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !17, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, macros: !18) +!16 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !17, enums: !2, retainedTypes: !2, globals: !2, imports: !2, macros: !18)  !17 = !DIFile(filename: "debug-macro1.cpp", directory: "/")  !18 = !{!19}  !19 = !DIMacroFile(line: 0, file: !17, nodes: !2) -!20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !21, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) +!20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !21, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !21 = !DIFile(filename: "debug-macro2.cpp", directory: "/") diff --git a/test/DebugInfo/X86/debug-ranges-offset.ll b/test/DebugInfo/X86/debug-ranges-offset.ll index 520f3c45e18c..352624c9df96 100644 --- a/test/DebugInfo/X86/debug-ranges-offset.ll +++ b/test/DebugInfo/X86/debug-ranges-offset.ll @@ -202,11 +202,10 @@ attributes #4 = { builtin }  !llvm.module.flags = !{!16, !17}  !llvm.ident = !{!18} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 207243) (llvm/trunk 207259)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 207243) (llvm/trunk 207259)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "foo.cpp", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{} -!3 = !{!4, !13} -!4 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !8) +!4 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !8)  !5 = !DIFile(filename: "foo.cpp", directory: "/usr/local/google/home/echristo/tmp")  !6 = !DISubroutineType(types: !7)  !7 = !{null} @@ -215,7 +214,7 @@ attributes #4 = { builtin }  !10 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !11)  !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !12)  !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!13 = distinct !DISubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !1, scope: !5, type: !14, variables: !2) +!13 = distinct !DISubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 9, file: !1, scope: !5, type: !14, variables: !2)  !14 = !DISubroutineType(types: !15)  !15 = !{!12}  !16 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/debug_frame.ll b/test/DebugInfo/X86/debug_frame.ll index 563406ccaf90..a1f0b08292b3 100644 --- a/test/DebugInfo/X86/debug_frame.ll +++ b/test/DebugInfo/X86/debug_frame.ll @@ -13,9 +13,9 @@ entry:  !llvm.module.flags = !{!7}  !5 = !{!0} -!0 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 1, file: !6, scope: !1, type: !3)  !1 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/llvm/build") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !6, enums: !{}, retainedTypes: !{}, subprograms: !5) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: FullDebug, file: !6, enums: !{}, retainedTypes: !{})  !3 = !DISubroutineType(types: !4)  !4 = !{null}  !6 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/llvm/build") diff --git a/test/DebugInfo/X86/debugger-tune.ll b/test/DebugInfo/X86/debugger-tune.ll index 19a37199ceb1..3c9288b18c78 100644 --- a/test/DebugInfo/X86/debugger-tune.ll +++ b/test/DebugInfo/X86/debugger-tune.ll @@ -33,7 +33,7 @@  !llvm.module.flags = !{!6, !7}  !llvm.ident = !{!8} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 238808)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 238808)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)  !1 = !DIFile(filename: "debugger-tune.cpp", directory: "/home/probinson/projects/scratch")  !2 = !{}  !3 = !{!4} diff --git a/test/DebugInfo/X86/decl-derived-member.ll b/test/DebugInfo/X86/decl-derived-member.ll index 5751f243521e..730af8562c16 100644 --- a/test/DebugInfo/X86/decl-derived-member.ll +++ b/test/DebugInfo/X86/decl-derived-member.ll @@ -100,42 +100,41 @@ attributes #4 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !llvm.module.flags = !{!30, !31}  !llvm.ident = !{!32} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !28, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !28, imports: !2)  !1 = !DIFile(filename: "decl-derived-member.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4, !8}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 5, size: 64, align: 64, file: !1, elements: !5, identifier: "_ZTS3foo")  !5 = !{!6} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 6, size: 64, align: 64, file: !1, scope: !"_ZTS3foo", baseType: !7) -!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "base_type", line: 4, file: !1, baseType: !"_ZTS4base") +!6 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 6, size: 64, align: 64, file: !1, scope: !4, baseType: !7) +!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "base_type", line: 4, file: !1, baseType: !8)  !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "base", line: 1, flags: DIFlagFwdDecl, file: !1, identifier: "_ZTS4base") -!9 = !{!10, !14, !19, !24, !26} -!10 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !11, type: !12, variables: !2) +!10 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !1, scope: !11, type: !12, variables: !2)  !11 = !DIFile(filename: "decl-derived-member.cpp", directory: "/tmp/dbginfo")  !12 = !DISubroutineType(types: !13)  !13 = !{null} -!14 = distinct !DISubprogram(name: "foo", linkageName: "_ZN3fooC2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS3foo", type: !15, declaration: !18, variables: !2) +!14 = distinct !DISubprogram(name: "foo", linkageName: "_ZN3fooC2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !1, scope: !4, type: !15, declaration: !18, variables: !2)  !15 = !DISubroutineType(types: !16)  !16 = !{null, !17} -!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS3foo") -!18 = !DISubprogram(name: "foo", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS3foo", type: !15) -!19 = distinct !DISubprogram(name: "base", linkageName: "_ZN4baseC2Ev", line: 1, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !"_ZTS4base", type: !20, declaration: !23, variables: !2) +!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) +!18 = !DISubprogram(name: "foo", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !4, type: !15) +!19 = distinct !DISubprogram(name: "base", linkageName: "_ZN4baseC2Ev", line: 1, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !8, type: !20, declaration: !23, variables: !2)  !20 = !DISubroutineType(types: !21)  !21 = !{null, !22} -!22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS4base") -!23 = !DISubprogram(name: "base", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS4base", type: !20) -!24 = distinct !DISubprogram(name: "~foo", linkageName: "_ZN3fooD2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS3foo", type: !15, declaration: !25, variables: !2) -!25 = !DISubprogram(name: "~foo", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS3foo", type: !15) -!26 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !11, type: !27, variables: !2) +!22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8) +!23 = !DISubprogram(name: "base", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !8, type: !20) +!24 = distinct !DISubprogram(name: "~foo", linkageName: "_ZN3fooD2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !1, scope: !4, type: !15, declaration: !25, variables: !2) +!25 = !DISubprogram(name: "~foo", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !4, type: !15) +!26 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, file: !1, scope: !11, type: !27, variables: !2)  !27 = !DISubroutineType(types: !2)  !28 = !{!29} -!29 = !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !"_ZTS3foo", variable: %struct.foo* @f) +!29 = !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4, variable: %struct.foo* @f)  !30 = !{i32 2, !"Dwarf Version", i32 4}  !31 = !{i32 2, !"Debug Info Version", i32 3}  !32 = !{!"clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)"}  !33 = !DILocation(line: 8, column: 5, scope: !10)  !34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !35) -!35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3foo") +!35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)  !36 = !DIExpression()  !37 = !DILocation(line: 0, scope: !14)  !38 = !DILocation(line: 5, column: 8, scope: !14) @@ -145,7 +144,7 @@ attributes #4 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !42 = distinct !DILexicalBlock(line: 5, column: 8, file: !1, scope: !24)  !43 = !DILocation(line: 5, column: 8, scope: !24)  !44 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !19, type: !45) -!45 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4base") +!45 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)  !46 = !DILocation(line: 0, scope: !19)  !47 = !DILocation(line: 1, column: 8, scope: !19)  !48 = !DILocation(line: 0, scope: !26) diff --git a/test/DebugInfo/X86/deleted-bit-piece.ll b/test/DebugInfo/X86/deleted-bit-piece.ll index b069cf8e399c..dace078d6b1a 100644 --- a/test/DebugInfo/X86/deleted-bit-piece.ll +++ b/test/DebugInfo/X86/deleted-bit-piece.ll @@ -28,19 +28,18 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata)  !0 = !{i32 2, !"Dwarf Version", i32 2}  !1 = !{i32 2, !"Debug Info Version", i32 3} -!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !4, retainedTypes: !5, subprograms: !11, globals: !4, imports: !4) +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !4, imports: !4)  !3 = !DIFile(filename: "foo.cpp", directory: "/path/to/dir")  !4 = !{}  !5 = !{!6}  !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 64, align: 64, elements: !7, identifier: "_ZT5Class")  !7 = !{!8, !10} -!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !"_ZT5Class", baseType: !9, size: 32, align: 32) +!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, baseType: !9, size: 32, align: 32)  !9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !"_ZT5Class", baseType: !9, size: 32, align: 32) -!11 = !{!12} -!12 = distinct !DISubprogram(name: "foo", scope: null, file: !3, type: !13, isLocal: false, isDefinition: true, isOptimized: false) +!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, baseType: !9, size: 32, align: 32) +!12 = distinct !DISubprogram(name: "foo", scope: null, file: !3, type: !13, isLocal: false, isDefinition: true, isOptimized: false, unit: !2)  !13 = !DISubroutineType(types: !14)  !14 = !{null} -!15 = !DILocalVariable(name: "v", scope: !12, type: !"_ZT5Class") +!15 = !DILocalVariable(name: "v", scope: !12, type: !6)  !16 = !DIExpression(DW_OP_bit_piece, 32, 32)  !17 = !DILocation(line: 2755, column: 9, scope: !12) diff --git a/test/DebugInfo/X86/discriminator.ll b/test/DebugInfo/X86/discriminator.ll index e9d8fa58c60d..49b2326ac744 100644 --- a/test/DebugInfo/X86/discriminator.ll +++ b/test/DebugInfo/X86/discriminator.ll @@ -41,11 +41,10 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !llvm.module.flags = !{!7, !8}  !llvm.ident = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "discriminator.c", directory: ".")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "discriminator.c", directory: ".")  !6 = !DISubroutineType(types: !2)  !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/discriminator2.ll b/test/DebugInfo/X86/discriminator2.ll new file mode 100644 index 000000000000..208fa241d405 --- /dev/null +++ b/test/DebugInfo/X86/discriminator2.ll @@ -0,0 +1,61 @@ +; RUN: llc -mtriple=i386-unknown-unknown -mcpu=core2 %s -o %t -filetype=obj +; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s +; +; Generated from: +; +; #1 void foo(int, int); +; #2 int bar(); +; #3 void baz() { +; #4   foo/*discriminator 1*/(bar(), +; #5       bar());bar()/*discriminator 1*/; +; #6 } +; +; The intent is to test discriminator 1 generated for both line #4 and #5. +; The instruction sequence in the final binary is: +; line 4 discriminator 0 +; line 5 discriminator 0 +; line 4 discriminator 1 +; line 5 discriminator 1 +; We need to ensure that the discriminators for the last two instructions +; are both 1. + +; Function Attrs: uwtable +define void @_Z3bazv() #0 !dbg !6 { +  %1 = call i32 @_Z3barv(), !dbg !9 +  %2 = call i32 @_Z3barv(), !dbg !10 +  call void @_Z3fooii(i32 %1, i32 %2), !dbg !11 +  %3 = call i32 @_Z3barv(), !dbg !13 +  ret void, !dbg !14 +} + +declare void @_Z3fooii(i32, i32) #1 + +declare i32 @_Z3barv() #1 + +attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} +!llvm.ident = !{!5} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 267219)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.cc", directory: ".") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{!"clang version 3.9.0 (trunk 267219)"} +!6 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !1, file: !1, line: 3, type: !7, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!7 = !DISubroutineType(types: !8) +!8 = !{null} +!9 = !DILocation(line: 4, column: 7, scope: !6) +!10 = !DILocation(line: 5, column: 14, scope: !6) +!11 = !DILocation(line: 4, column: 3, scope: !12) +!12 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 1) +!13 = !DILocation(line: 5, column: 21, scope: !12) +!14 = !DILocation(line: 6, column: 1, scope: !6) + +; CHECK: Address            Line   Column File   ISA Discriminator Flags +; CHECK: ------------------ ------ ------ ------ --- ------------- ------------- +; CHECK: {{.*}}      4      3      1   0             1  {{.*}} +; CHECK: {{.*}}      5     21      1   0             1  {{.*}} diff --git a/test/DebugInfo/X86/discriminator3.ll b/test/DebugInfo/X86/discriminator3.ll new file mode 100644 index 000000000000..e7dd116cb0d2 --- /dev/null +++ b/test/DebugInfo/X86/discriminator3.ll @@ -0,0 +1,74 @@ +; RUN: llc -mtriple=i386-unknown-unknown -mcpu=core2 %s -o %t -filetype=obj +; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s +; +; Generated from: +; +; #1 void foo(int); +; #2 void baz(int i) { +; #3   if (i) {foo(i+1);/*discriminator 1*/} +; #4 } +; +; The intent is to test discriminator 1 generated for all instructions in +; the taken branch. + +; Function Attrs: uwtable +define void @_Z3bazi(i32) #0 !dbg !6 { +  %2 = alloca i32, align 4 +  store i32 %0, i32* %2, align 4 +  call void @llvm.dbg.declare(metadata i32* %2, metadata !10, metadata !11), !dbg !12 +  %3 = load i32, i32* %2, align 4, !dbg !13 +  %4 = icmp ne i32 %3, 0, !dbg !13 +  br i1 %4, label %5, label %8, !dbg !15 + +; <label>:5:                                      ; preds = %1 +  %6 = load i32, i32* %2, align 4, !dbg !16 +  %7 = add nsw i32 %6, 1, !dbg !19 +  call void @_Z3fooi(i32 %7), !dbg !20 +  br label %8, !dbg !21 + +; <label>:8:                                      ; preds = %5, %1 +  ret void, !dbg !22 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 + +declare void @_Z3fooi(i32) #2 + +attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind readnone } +attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} +!llvm.ident = !{!5} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 267518)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.cc", directory: ".") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{!"clang version 3.9.0 (trunk 267518)"} +!6 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazi", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!7 = !DISubroutineType(types: !8) +!8 = !{null, !9} +!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !DILocalVariable(name: "i", arg: 1, scope: !6, file: !1, line: 2, type: !9) +!11 = !DIExpression() +!12 = !DILocation(line: 2, column: 14, scope: !6) +!13 = !DILocation(line: 3, column: 7, scope: !14) +!14 = distinct !DILexicalBlock(scope: !6, file: !1, line: 3, column: 7) +!15 = !DILocation(line: 3, column: 7, scope: !6) +!16 = !DILocation(line: 3, column: 15, scope: !17) +!17 = !DILexicalBlockFile(scope: !18, file: !1, discriminator: 1) +!18 = distinct !DILexicalBlock(scope: !14, file: !1, line: 3, column: 10) +!19 = !DILocation(line: 3, column: 16, scope: !17) +!20 = !DILocation(line: 3, column: 11, scope: !17) +!21 = !DILocation(line: 3, column: 21, scope: !17) +!22 = !DILocation(line: 4, column: 1, scope: !6) + +; CHECK: Address            Line   Column File   ISA Discriminator Flags +; CHECK: ------------------ ------ ------ ------ --- ------------- ------------- +; CHECK: {{.*}}      3     15      1   0             1  +; CHECK: {{.*}}      3     16      1   0             1  +; CHECK: {{.*}}      3     11      1   0             1  diff --git a/test/DebugInfo/X86/dllimport.ll b/test/DebugInfo/X86/dllimport.ll new file mode 100644 index 000000000000..60c3116cf2e7 --- /dev/null +++ b/test/DebugInfo/X86/dllimport.ll @@ -0,0 +1,27 @@ +; RUN: llc -mtriple=i686-pc-windows-msvc -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s + +; CHECK-NOT: DW_AT_location + +target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" +target triple = "i686-pc-windows-msvc" + +@"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4 + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!13, !14} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3) +!1 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src") +!2 = !{} +!3 = !{!4} +!4 = distinct !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, variable: i32* @"\01?id@?$numpunct@D@@0HA", declaration: !7) +!5 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/t.ii", directory: "/usr/local/google/home/majnemer/llvm/src") +!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!7 = !DIDerivedType(tag: DW_TAG_member, name: "id", scope: !8, file: !5, line: 2, baseType: !6, flags: DIFlagStaticMember) +!8 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "numpunct<char>", file: !5, line: 2, size: 8, align: 8, elements: !9, templateParams: !10) +!9 = !{!7} +!10 = !{!11} +!11 = !DITemplateTypeParameter(type: !12) +!12 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!13 = !{i32 2, !"Dwarf Version", i32 3} +!14 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/dw_op_minus.ll b/test/DebugInfo/X86/dw_op_minus.ll index 1c486e06c513..e76f2933fdda 100644 --- a/test/DebugInfo/X86/dw_op_minus.ll +++ b/test/DebugInfo/X86/dw_op_minus.ll @@ -40,11 +40,10 @@ declare void @Capture(i32*)  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!13, !14} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 248518) (llvm/trunk 248512)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 248518) (llvm/trunk 248512)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)  !1 = !DIFile(filename: "1.cc", directory: "/tmp")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, variables: !7) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !7)  !5 = !DISubroutineType(types: !6)  !6 = !{null}  !7 = !{!8} diff --git a/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll b/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll index be0d89433e7c..d9eb0ec84bf9 100644 --- a/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll +++ b/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll @@ -60,21 +60,20 @@ attributes #2 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!19, !26} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (191881)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !17, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (191881)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !17, imports: !2)  !1 = !DIFile(filename: "tmp/debug_ranges/a.cc", directory: "/")  !2 = !{} -!3 = !{!4, !11, !14} -!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !9) +!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !9)  !5 = !DIFile(filename: "tmp/debug_ranges/a.cc", directory: "/")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8}  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !9 = !{!10}  !10 = !DILocalVariable(name: "bar", line: 2, arg: 1, scope: !4, file: !5, type: !8) -!11 = distinct !DISubprogram(name: "foo2", linkageName: "_Z4foo2i", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !12) +!11 = distinct !DISubprogram(name: "foo2", linkageName: "_Z4foo2i", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !12)  !12 = !{!13}  !13 = !DILocalVariable(name: "bar2", line: 3, arg: 1, scope: !11, file: !5, type: !8) -!14 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !15, variables: !2) +!14 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !15, variables: !2)  !15 = !DISubroutineType(types: !16)  !16 = !{!8}  !17 = !{!18} diff --git a/test/DebugInfo/X86/dwarf-aranges.ll b/test/DebugInfo/X86/dwarf-aranges.ll index cb2e87881286..2ec246724fe4 100644 --- a/test/DebugInfo/X86/dwarf-aranges.ll +++ b/test/DebugInfo/X86/dwarf-aranges.ll @@ -62,11 +62,10 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!13, !16} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !8, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !8, imports: !2)  !1 = !DIFile(filename: "test.c", directory: "/home/kayamon")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "some_code", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "some_code", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "test.c", directory: "/home/kayamon")  !6 = !DISubroutineType(types: !7)  !7 = !{null} diff --git a/test/DebugInfo/X86/dwarf-linkage-names.ll b/test/DebugInfo/X86/dwarf-linkage-names.ll index 65cf1914dd40..9e89ee93cc01 100644 --- a/test/DebugInfo/X86/dwarf-linkage-names.ll +++ b/test/DebugInfo/X86/dwarf-linkage-names.ll @@ -53,11 +53,10 @@ attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fp  !llvm.module.flags = !{!11, !12}  !llvm.ident = !{!13} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 244662)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !9) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 244662)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !9)  !1 = !DIFile(filename: "dwarf-linkage-names.cpp", directory: "/home/probinson/projects/scratch")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "bar", linkageName: "_ZN4test3barEv", scope: !5, file: !1, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_ZN4test3barEv", scope: !5, file: !1, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)  !5 = !DINamespace(name: "test", scope: null, file: !1, line: 1)  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/dwarf-public-names.ll b/test/DebugInfo/X86/dwarf-public-names.ll index d850899ce85a..e6cdd7b33682 100644 --- a/test/DebugInfo/X86/dwarf-public-names.ll +++ b/test/DebugInfo/X86/dwarf-public-names.ll @@ -96,10 +96,9 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!38} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !2, globals: !24, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: FullDebug, file: !37, enums: !1, retainedTypes: !1, globals: !24, imports:  !1)  !1 = !{} -!2 = !{!3, !18, !19, !20} -!3 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !4, scope: null, type: !5, declaration: !12, variables: !1) +!3 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 9, file: !4, scope: null, type: !5, declaration: !12, variables: !1)  !4 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")  !5 = !DISubroutineType(types: !6)  !6 = !{null, !7} @@ -114,9 +113,9 @@ attributes #1 = { nounwind readnone }  !15 = !DISubroutineType(types: !16)  !16 = !{!11}  !17 = !{} ; previously: invalid DW_TAG_base_type -!18 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !4, scope: null, type: !15, declaration: !14, variables: !1) -!19 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !4, scope: !4, type: !15, variables: !1) -!20 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !4, scope: !21, type: !22, variables: !1) +!18 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 13, file: !4, scope: null, type: !15, declaration: !14, variables: !1) +!19 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 19, file: !4, scope: !4, type: !15, variables: !1) +!20 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 24, file: !4, scope: !21, type: !22, variables: !1)  !21 = !DINamespace(name: "ns", line: 23, file: !4, scope: null)  !22 = !DISubroutineType(types: !23)  !23 = !{null} diff --git a/test/DebugInfo/X86/dwarf-pubnames-split.ll b/test/DebugInfo/X86/dwarf-pubnames-split.ll index a8e4cc6e433a..fcec66cc76b4 100644 --- a/test/DebugInfo/X86/dwarf-pubnames-split.ll +++ b/test/DebugInfo/X86/dwarf-pubnames-split.ll @@ -24,11 +24,10 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9, !11} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 189287) (llvm/trunk 189296)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 189287) (llvm/trunk 189296)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/earlydup-crash.ll b/test/DebugInfo/X86/earlydup-crash.ll index 73626597d23b..aa6f88f08fdf 100644 --- a/test/DebugInfo/X86/earlydup-crash.ll +++ b/test/DebugInfo/X86/earlydup-crash.ll @@ -46,9 +46,9 @@ declare void @foobar(i32)  !llvm.module.flags = !{!47}  !0 = !DILocalVariable(name: "frname_len", line: 517, scope: !1, file: !3, type: !38)  !1 = distinct !DILexicalBlock(line: 515, column: 0, file: !44, scope: !2) -!2 = distinct !DISubprogram(name: "framework_construct_pathname", line: 515, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !44, scope: null, type: !5) +!2 = distinct !DISubprogram(name: "framework_construct_pathname", line: 515, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !4, file: !44, scope: null, type: !5)  !3 = !DIFile(filename: "darwin-c.c", directory: "/Users/espindola/llvm/build-llvm-gcc/gcc/../../llvm-gcc-4.2/gcc/config") -!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !44, enums: !46, retainedTypes: !46, subprograms: !45) +!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !44, enums: !46, retainedTypes: !46)  !5 = !DISubroutineType(types: !6)  !6 = !{!7, !9, !11}  !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !44, scope: !3, baseType: !8) @@ -89,6 +89,5 @@ declare void @foobar(i32)  !42 = !DIFile(filename: "types.h", directory: "/usr/include/sys")  !43 = !DIFile(filename: "stddef.h", directory: "/Users/espindola/llvm/build-llvm-gcc/./prev-gcc/include")  !44 = !DIFile(filename: "darwin-c.c", directory: "/Users/espindola/llvm/build-llvm-gcc/gcc/../../llvm-gcc-4.2/gcc/config") -!45 = !{!2}  !46 = !{}  !47 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/elf-names.ll b/test/DebugInfo/X86/elf-names.ll index 2c8571927627..83c3245cd988 100644 --- a/test/DebugInfo/X86/elf-names.ll +++ b/test/DebugInfo/X86/elf-names.ll @@ -62,10 +62,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!54} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 167506) (llvm/trunk 167505)", isOptimized: true, emissionKind: 0, file: !53, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 167506) (llvm/trunk 167505)", isOptimized: true, emissionKind: FullDebug, file: !53, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5, !31} -!5 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2Ev", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !6, scope: null, type: !7, declaration: !17, variables: !27) +!5 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2Ev", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 12, file: !6, scope: null, type: !7, declaration: !17, variables: !27)  !6 = !DIFile(filename: "foo.cpp", directory: "/usr/local/google/home/echristo")  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} @@ -81,12 +80,12 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !20 = !DISubprogram(name: "D", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: !10, type: !21)  !21 = !DISubroutineType(types: !22)  !22 = !{null, !9, !23} -!23 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !24) +!23 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, baseType: !24)  !24 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !10)  !27 = !{!29}  !29 = !DILocalVariable(name: "this", line: 12, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !5, file: !6, type: !30)  !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) -!31 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2ERKS_", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 19, file: !6, scope: null, type: !21, declaration: !20, variables: !32) +!31 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2ERKS_", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 19, file: !6, scope: null, type: !21, declaration: !20, variables: !32)  !32 = !{!34, !35}  !34 = !DILocalVariable(name: "this", line: 19, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, file: !6, type: !30)  !35 = !DILocalVariable(name: "d", line: 19, arg: 2, scope: !31, file: !6, type: !23) diff --git a/test/DebugInfo/X86/empty-and-one-elem-array.ll b/test/DebugInfo/X86/empty-and-one-elem-array.ll index 550a231f7699..d844718f313a 100644 --- a/test/DebugInfo/X86/empty-and-one-elem-array.ll +++ b/test/DebugInfo/X86/empty-and-one-elem-array.ll @@ -63,10 +63,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!33} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: FullDebug, file: !32, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "func", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !6, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "func", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 11, file: !6, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "test.c", directory: "/Volumes/Sandbox/llvm")  !7 = !DISubroutineType(types: !8)  !8 = !{!9} diff --git a/test/DebugInfo/X86/empty-array.ll b/test/DebugInfo/X86/empty-array.ll index bad080cb7254..e927f9f58703 100644 --- a/test/DebugInfo/X86/empty-array.ll +++ b/test/DebugInfo/X86/empty-array.ll @@ -27,7 +27,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!21} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) diff --git a/test/DebugInfo/X86/empty.ll b/test/DebugInfo/X86/empty.ll index 695e9ca6ed3f..e156e3bbe5e2 100644 --- a/test/DebugInfo/X86/empty.ll +++ b/test/DebugInfo/X86/empty.ll @@ -19,7 +19,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!5} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: 0, file: !4, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: FullDebug, file: !4, enums: !2, retainedTypes: !2, globals: !2)  !2 = !{}  !3 = !DIFile(filename: "empty.c", directory: "/home/nlewycky")  !4 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") diff --git a/test/DebugInfo/X86/ending-run.ll b/test/DebugInfo/X86/ending-run.ll index efb85aad73b6..88826e0b06bc 100644 --- a/test/DebugInfo/X86/ending-run.ll +++ b/test/DebugInfo/X86/ending-run.ll @@ -29,10 +29,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!20} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153921) (llvm/trunk 153916)", isOptimized: false, emissionKind: 0, file: !19, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153921) (llvm/trunk 153916)", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "callee", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !19, scope: !6, type: !7) +!5 = distinct !DISubprogram(name: "callee", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 7, file: !19, scope: !6, type: !7)  !6 = !DIFile(filename: "ending-run.c", directory: "/Users/echristo/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !9} diff --git a/test/DebugInfo/X86/enum-class.ll b/test/DebugInfo/X86/enum-class.ll index fda0b4943a9d..eaf43d2b8340 100644 --- a/test/DebugInfo/X86/enum-class.ll +++ b/test/DebugInfo/X86/enum-class.ll @@ -8,7 +8,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!23} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157269) (llvm/trunk 157264)", isOptimized: false, emissionKind: 0, file: !22, enums: !1, retainedTypes: !15, subprograms: !15, globals: !17, imports:  !15) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157269) (llvm/trunk 157264)", isOptimized: false, emissionKind: FullDebug, file: !22, enums: !1, retainedTypes: !15, globals: !17, imports:  !15)  !1 = !{!3, !8, !12}  !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "A", line: 1, size: 32, align: 32, file: !4, baseType: !5, elements: !6)  !4 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp") diff --git a/test/DebugInfo/X86/enum-fwd-decl.ll b/test/DebugInfo/X86/enum-fwd-decl.ll index ec862d10a704..c01f513e2638 100644 --- a/test/DebugInfo/X86/enum-fwd-decl.ll +++ b/test/DebugInfo/X86/enum-fwd-decl.ll @@ -6,7 +6,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 165274) (llvm/trunk 165272)", isOptimized: false, emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 165274) (llvm/trunk 165272)", isOptimized: false, emissionKind: FullDebug, file: !8, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "e", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i16* @e) diff --git a/test/DebugInfo/X86/externaltyperef.ll b/test/DebugInfo/X86/externaltyperef.ll index c344d5f068c3..7d895597fc99 100644 --- a/test/DebugInfo/X86/externaltyperef.ll +++ b/test/DebugInfo/X86/externaltyperef.ll @@ -32,19 +32,19 @@ target triple = "x86_64-apple-macosx10.10.0"  !llvm.module.flags = !{!13, !14, !15}  !llvm.ident = !{!16} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 242039) (llvm/trunk 242046)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, globals: !5, imports: !11) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 242039) (llvm/trunk 242046)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !5, imports: !11)  !1 = !DIFile(filename: "test.cpp", directory: "/")  !2 = !{}  !3 = !{!4, !9}  !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTS1A")  !5 = !{!6}  !6 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: %class.A** @a) -!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A", size: 64, align: 64) +!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)  !8 = !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTS1B")  !9 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTSN1N1BE")  !10 = !DINamespace(name: "N", scope: null, file: !1, line: 1)  !11 = !{!12} -!12 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !"_ZTSN1N1BE", line: 4) +!12 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !9, line: 4)  !13 = !{i32 2, !"Dwarf Version", i32 2}  !14 = !{i32 2, !"Debug Info Version", i32 3}  !15 = !{i32 1, !"PIC Level", i32 2} diff --git a/test/DebugInfo/X86/fission-cu.ll b/test/DebugInfo/X86/fission-cu.ll index d52333ce6d97..96bb6e227bc8 100644 --- a/test/DebugInfo/X86/fission-cu.ll +++ b/test/DebugInfo/X86/fission-cu.ll @@ -8,7 +8,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, splitDebugFilename: "baz.dwo", emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, splitDebugFilename: "baz.dwo", emissionKind: FullDebug, file: !8, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @a) @@ -33,6 +33,7 @@  ; CHECK: .debug_abbrev.dwo contents:  ; CHECK: Abbrev table for offset: 0x00000000  ; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes +; CHECK: DW_AT_GNU_dwo_name  DW_FORM_GNU_str_index  ; CHECK: DW_AT_producer  DW_FORM_GNU_str_index  ; CHECK: DW_AT_language  DW_FORM_data2  ; CHECK: DW_AT_name      DW_FORM_GNU_str_index @@ -64,38 +65,41 @@  ; Check that the rest of the compile units have information.  ; CHECK: .debug_info.dwo contents:  ; CHECK: DW_TAG_compile_unit -; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)") +; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] ( indexed (00000000) string = "baz.dwo") +; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000001) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")  ; CHECK: DW_AT_language [DW_FORM_data2]        (DW_LANG_C99) -; CHECK: DW_AT_name [DW_FORM_GNU_str_index]    ( indexed (00000001) string = "baz.c") +; CHECK: DW_AT_name [DW_FORM_GNU_str_index]    ( indexed (00000002) string = "baz.c")  ; CHECK-NOT: DW_AT_low_pc  ; CHECK-NOT: DW_AT_stmt_list  ; CHECK-NOT: DW_AT_comp_dir  ; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8]  (0x1f1f859683d49324)  ; CHECK: DW_TAG_variable -; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     ( indexed (00000002) string = "a") +; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     ( indexed (00000003) string = "a")  ; CHECK: DW_AT_type [DW_FORM_ref4]       (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]})  ; CHECK: DW_AT_external [DW_FORM_flag_present]   (true)  ; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)  ; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)  ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x2> fb 00 )  ; CHECK: [[TYPE]]: DW_TAG_base_type -; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     ( indexed (00000003) string = "int") +; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     ( indexed (00000004) string = "int")  ; CHECK: .debug_str contents:  ; CHECK: 0x00000000: "baz.dwo"  ; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp"  ; CHECK: .debug_str.dwo contents: -; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)" -; CHECK: 0x00000035: "baz.c" -; CHECK: 0x0000003b: "a" -; CHECK: 0x0000003d: "int" +; CHECK: 0x00000000: "baz.dwo" +; CHECK: 0x00000008: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)" +; CHECK: 0x0000003d: "baz.c" +; CHECK: 0x00000043: "a" +; CHECK: 0x00000045: "int"  ; CHECK: .debug_str_offsets.dwo contents:  ; CHECK: 0x00000000: 00000000 -; CHECK: 0x00000004: 00000035 -; CHECK: 0x00000008: 0000003b -; CHECK: 0x0000000c: 0000003d +; CHECK: 0x00000004: 00000008 +; CHECK: 0x00000008: 0000003d +; CHECK: 0x0000000c: 00000043 +; CHECK: 0x00000010: 00000045  ; Object file checks  ; For x86-64-linux we should have this set of relocations for the debug info section diff --git a/test/DebugInfo/X86/fission-hash.ll b/test/DebugInfo/X86/fission-hash.ll index 84568a92e154..7273e4c675c5 100644 --- a/test/DebugInfo/X86/fission-hash.ll +++ b/test/DebugInfo/X86/fission-hash.ll @@ -9,7 +9,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!3, !4} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 188230) (llvm/trunk 188234)", isOptimized: false, splitDebugFilename: "foo.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 188230) (llvm/trunk 188234)", isOptimized: false, splitDebugFilename: "foo.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{}  !3 = !{i32 2, !"Dwarf Version", i32 3} diff --git a/test/DebugInfo/X86/fission-inline.ll b/test/DebugInfo/X86/fission-inline.ll index af7dd95e5b84..85c594c118a2 100644 --- a/test/DebugInfo/X86/fission-inline.ll +++ b/test/DebugInfo/X86/fission-inline.ll @@ -92,26 +92,25 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !llvm.module.flags = !{!22, !23}  !llvm.ident = !{!24} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, splitDebugFilename: "fission-inline.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !18) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, splitDebugFilename: "fission-inline.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !18)  !1 = !DIFile(filename: "fission-inline.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS3foo")  !5 = !{!6} -!6 = !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ez", line: 4, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !"_ZTS3foo", type: !7) +!6 = !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ez", line: 4, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !4, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{null, null} -!9 = !{!10, !11} -!10 = distinct !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ez", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 15, file: !1, scope: !"_ZTS3foo", type: !7, declaration: !6, variables: !2) -!11 = distinct !DISubprogram(name: "f2<int>", linkageName: "_ZN3foo2f2IiEEvv", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !"_ZTS3foo", type: !12, templateParams: !14, declaration: !17, variables: !2) +!10 = distinct !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ez", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 15, file: !1, scope: !4, type: !7, declaration: !6, variables: !2) +!11 = distinct !DISubprogram(name: "f2<int>", linkageName: "_ZN3foo2f2IiEEvv", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !1, scope: !4, type: !12, templateParams: !14, declaration: !17, variables: !2)  !12 = !DISubroutineType(types: !13)  !13 = !{null}  !14 = !{!15}  !15 = !DITemplateTypeParameter(name: "T", type: !16)  !16 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!17 = !DISubprogram(name: "f2<int>", linkageName: "_ZN3foo2f2IiEEvv", line: 10, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !"_ZTS3foo", type: !12, templateParams: !14) +!17 = !DISubprogram(name: "f2<int>", linkageName: "_ZN3foo2f2IiEEvv", line: 10, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !4, type: !12, templateParams: !14)  !18 = !{!19} -!19 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 19, scope: !20, entity: !"_ZTS3foo") +!19 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 19, scope: !20, entity: !4)  !20 = distinct !DILexicalBlock(line: 16, column: 13, file: !1, scope: !21)  !21 = distinct !DILexicalBlock(line: 16, column: 7, file: !1, scope: !10)  !22 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/fission-ranges.ll b/test/DebugInfo/X86/fission-ranges.ll index 9c9fd7d6e6fe..3c05f223ee79 100644 --- a/test/DebugInfo/X86/fission-ranges.ll +++ b/test/DebugInfo/X86/fission-ranges.ll @@ -153,15 +153,14 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!26, !43} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191700) (llvm/trunk 191710)", isOptimized: true, splitDebugFilename: "small.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191700) (llvm/trunk 191710)", isOptimized: true, splitDebugFilename: "small.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "small.c", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{} -!3 = !{!4, !8} -!4 = distinct !DISubprogram(name: "bar", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "bar", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "small.c", directory: "/usr/local/google/home/echristo/tmp")  !6 = !DISubroutineType(types: !7)  !7 = !{null} -!8 = distinct !DISubprogram(name: "foo", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !9, variables: !12) +!8 = distinct !DISubprogram(name: "foo", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !9, variables: !12)  !9 = !DISubroutineType(types: !10)  !10 = !{null, !11}  !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/float_const.ll b/test/DebugInfo/X86/float_const.ll index cd94f74dcbe3..06bd0cd75ec3 100644 --- a/test/DebugInfo/X86/float_const.ll +++ b/test/DebugInfo/X86/float_const.ll @@ -31,14 +31,13 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!15, !16, !17}  !llvm.ident = !{!18} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 227686)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !6, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 227686)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "foo.c", directory: "")  !2 = !{}  !3 = !{!4}  !4 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !5)  !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !{!7} -!7 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 1, file: !8, scope: !9, type: !10, variables: !12) +!7 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: true, unit: !0, scopeLine: 1, file: !8, scope: !9, type: !10, variables: !12)  !8 = !DIFile(filename: "foo.c", directory: "")  !9 = !DIFile(filename: "foo.c", directory: "")  !10 = !DISubroutineType(types: !11) diff --git a/test/DebugInfo/X86/float_const_loclist.ll b/test/DebugInfo/X86/float_const_loclist.ll new file mode 100644 index 000000000000..b03a91de3341 --- /dev/null +++ b/test/DebugInfo/X86/float_const_loclist.ll @@ -0,0 +1,85 @@ +; RUN: llc %s -stop-after=livedebugvalues -o - | FileCheck --check-prefix=SANITY %s +; RUN: llc < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s +; Test debug_loc support for floating point constants. +; +; Created from clang -O1: +;   void barrier(); +;   void foo() { +;     float f; +;     long double ld; +;     barrier(); +;     f = 3.14; +;     ld = 3.14; +;     barrier(); +;   } +; +; SANITY: CALL{{.*}} @barrier +; SANITY: DBG_VALUE x86_fp80 0xK4000C8F5C28F5C28F800 +; SANITY: DBG_VALUE float 0x40091EB860000000 +; SANITY: TAILJMP{{.*}} @barrier +; +; CHECK: .debug_info contents: +; CHECK: DW_TAG_variable +; CHECK-NEXT:  DW_AT_location {{.*}} (0x[[LD:.*]]) +; CHECK-NEXT:  DW_AT_name {{.*}}"ld" +; CHECK: DW_TAG_variable +; CHECK-NEXT:  DW_AT_location {{.*}} (0x[[F:.*]]) +; CHECK-NEXT:  DW_AT_name {{.*}}"f" +; +; CHECK: .debug_loc contents: +; CHECK: [[LD]]: Beginning address offset: [[START:.*]] +; CHECK:            Ending address offset: [[END:.*]] +; CHECK: Location description: 10 80 f0 a3 e1 f5 d1 f0 fa c8 01 93 08 10 80 80 01 9d 10 40 +;                   constu 0xc8f5c28f5c28f800, piece 8, constu 0x00004000, bit-piece 16 64 +; CHECK: [[F]]: Beginning address offset: [[START]] +; CHECK:           Ending address offset: [[END]] +; CHECK:            Location description: 10 c3 eb a3 82 04 +;                                         constu ... +source_filename = "test.c" +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +; Function Attrs: nounwind ssp uwtable +define void @foo() #0 !dbg !4 { +entry: +  tail call void (...) @barrier() #3, !dbg !16 +  tail call void @llvm.dbg.value(metadata float 0x40091EB860000000, i64 0, metadata !8, metadata !17), !dbg !18 +  tail call void @llvm.dbg.value(metadata x86_fp80 0xK4000C8F5C28F5C28F800, i64 0, metadata !10, metadata !17), !dbg !19 +  tail call void (...) @barrier() #3, !dbg !20 +  ret void, !dbg !21 +} + +declare void @barrier(...) + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 + +attributes #0 = { nounwind ssp uwtable } +attributes #2 = { nounwind readnone } +attributes #3 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!12, !13, !14} +!llvm.ident = !{!15} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/25448338") +!2 = !{} +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: true, unit: !0, variables: !7) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{!8, !10} +!8 = !DILocalVariable(name: "f", scope: !4, file: !1, line: 5, type: !9) +!9 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) +!10 = !DILocalVariable(name: "ld", scope: !4, file: !1, line: 6, type: !11) +!11 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float) +!12 = !{i32 2, !"Dwarf Version", i32 2} +!13 = !{i32 2, !"Debug Info Version", i32 3} +!14 = !{i32 1, !"PIC Level", i32 2} +!15 = !{!"clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)"} +!16 = !DILocation(line: 7, column: 3, scope: !4) +!17 = !DIExpression() +!18 = !DILocation(line: 5, column: 9, scope: !4) +!19 = !DILocation(line: 6, column: 15, scope: !4) +!20 = !DILocation(line: 10, column: 3, scope: !4) +!21 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/test/DebugInfo/X86/formal_parameter.ll b/test/DebugInfo/X86/formal_parameter.ll index 89be50bbd4a3..53ac5f3c6332 100644 --- a/test/DebugInfo/X86/formal_parameter.ll +++ b/test/DebugInfo/X86/formal_parameter.ll @@ -59,11 +59,10 @@ attributes #3 = { nounwind }  !llvm.module.flags = !{!11, !12}  !llvm.ident = !{!13} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "formal_parameter.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !9) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !9)  !5 = !DIFile(filename: "formal_parameter.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8} diff --git a/test/DebugInfo/X86/frame-register.ll b/test/DebugInfo/X86/frame-register.ll index e7f48597b348..0c972b70703e 100644 --- a/test/DebugInfo/X86/frame-register.ll +++ b/test/DebugInfo/X86/frame-register.ll @@ -33,16 +33,15 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!12, !13}  !llvm.ident = !{!14} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "x.c", directory: "")  !2 = !{} -!3 = !{!4, !9} -!4 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "x.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8}  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = distinct !DISubprogram(name: "main", line: 8, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 9, file: !1, scope: !5, type: !10, variables: !2) +!9 = distinct !DISubprogram(name: "main", line: 8, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 9, file: !1, scope: !5, type: !10, variables: !2)  !10 = !DISubroutineType(types: !11)  !11 = !{!8}  !12 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/generate-odr-hash.ll b/test/DebugInfo/X86/generate-odr-hash.ll index 51f33e2730ab..a2ee2b9d3e72 100644 --- a/test/DebugInfo/X86/generate-odr-hash.ll +++ b/test/DebugInfo/X86/generate-odr-hash.ll @@ -219,7 +219,7 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!43, !44}  !llvm.ident = !{!45} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "bar.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !21, globals: !38, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "bar.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !38, imports: !2)  !1 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4, !6, !14, !17} @@ -230,23 +230,22 @@ attributes #1 = { nounwind readnone }  !8 = !DINamespace(name: "capybara", line: 11, file: !1, scope: !9)  !9 = !DINamespace(name: "echidna", line: 10, file: !1, scope: null)  !10 = !{!11, !13} -!11 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 14, size: 32, align: 32, flags: DIFlagPrivate, file: !1, scope: !"_ZTSN7echidna8capybara8mongoose6fluffyE", baseType: !12) +!11 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 14, size: 32, align: 32, flags: DIFlagPrivate, file: !1, scope: !6, baseType: !12)  !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 15, size: 32, align: 32, offset: 32, flags: DIFlagPrivate, file: !1, scope: !"_ZTSN7echidna8capybara8mongoose6fluffyE", baseType: !12) +!13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 15, size: 32, align: 32, offset: 32, flags: DIFlagPrivate, file: !1, scope: !6, baseType: !12)  !14 = !DICompositeType(tag: DW_TAG_structure_type, name: "wombat", line: 31, size: 64, align: 32, file: !1, elements: !15, identifier: "_ZTS6wombat")  !15 = !{!16} -!16 = !DIDerivedType(tag: DW_TAG_member, name: "a_b", line: 35, size: 64, align: 32, file: !1, scope: !"_ZTS6wombat", baseType: !"_ZTSN6wombatUt_E") -!17 = !DICompositeType(tag: DW_TAG_structure_type, line: 32, size: 64, align: 32, file: !1, scope: !"_ZTS6wombat", elements: !18, identifier: "_ZTSN6wombatUt_E") +!16 = !DIDerivedType(tag: DW_TAG_member, name: "a_b", line: 35, size: 64, align: 32, file: !1, scope: !14, baseType: !17) +!17 = !DICompositeType(tag: DW_TAG_structure_type, line: 32, size: 64, align: 32, file: !1, scope: !14, elements: !18, identifier: "_ZTSN6wombatUt_E")  !18 = !{!19, !20} -!19 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 33, size: 32, align: 32, file: !1, scope: !"_ZTSN6wombatUt_E", baseType: !12) -!20 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 34, size: 32, align: 32, offset: 32, file: !1, scope: !"_ZTSN6wombatUt_E", baseType: !12) -!21 = !{!22, !26, !27, !36} -!22 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !23, type: !24, variables: !2) +!19 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 33, size: 32, align: 32, file: !1, scope: !17, baseType: !12) +!20 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 34, size: 32, align: 32, offset: 32, file: !1, scope: !17, baseType: !12) +!22 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !1, scope: !23, type: !24, variables: !2)  !23 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo")  !24 = !DISubroutineType(types: !25)  !25 = !{null} -!26 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 29, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 29, file: !1, scope: !23, type: !24, variables: !2) -!27 = distinct !DISubprogram(name: "walrus", linkageName: "_ZN12_GLOBAL__N_16walrusC2Ev", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !1, scope: !28, type: !32, declaration: !31, variables: !2) +!26 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 29, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 29, file: !1, scope: !23, type: !24, variables: !2) +!27 = distinct !DISubprogram(name: "walrus", linkageName: "_ZN12_GLOBAL__N_16walrusC2Ev", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 25, file: !1, scope: !28, type: !32, declaration: !31, variables: !2)  !28 = !DICompositeType(tag: DW_TAG_structure_type, name: "walrus", line: 24, size: 8, align: 8, file: !1, scope: !29, elements: !30)  !29 = !DINamespace(line: 23, file: !1, scope: null)  !30 = !{!31} @@ -254,7 +253,7 @@ attributes #1 = { nounwind readnone }  !32 = !DISubroutineType(types: !33)  !33 = !{null, !34}  !34 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !28) -!36 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, scopeLine: 25, file: !1, scope: !23, type: !37, variables: !2) +!36 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, unit: !0, scopeLine: 25, file: !1, scope: !23, type: !37, variables: !2)  !37 = !DISubroutineType(types: !2)  !38 = !{!39, !40, !41, !42}  !39 = !DIGlobalVariable(name: "b", line: 3, isLocal: false, isDefinition: true, scope: null, file: !23, type: !4, variable: %struct.bar* @b) diff --git a/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll b/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll index 20bb1b3f145f..2368ad360caf 100644 --- a/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll +++ b/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll @@ -68,15 +68,14 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!13, !14}  !llvm.ident = !{!15} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !7, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "ghost-sdnode-dbgvalues.c", directory: "/tmp")  !2 = !{}  !3 = !{!4}  !4 = !DIDerivedType(tag: DW_TAG_typedef, name: "int16_t", line: 30, file: !5, baseType: !6)  !5 = !DIFile(filename: "/usr/include/sys/_types/_int16_t.h", directory: "/tmp")  !6 = !DIBasicType(tag: DW_TAG_base_type, name: "short", size: 16, align: 16, encoding: DW_ATE_signed) -!7 = !{!8} -!8 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !9, type: !10, variables: !2) +!8 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !9, type: !10, variables: !2)  !9 = !DIFile(filename: "ghost-sdnode-dbgvalues.c", directory: "/tmp")  !10 = !DISubroutineType(types: !11)  !11 = !{!12, !12} diff --git a/test/DebugInfo/X86/gnu-public-names-empty.ll b/test/DebugInfo/X86/gnu-public-names-empty.ll index 4bd33df10dce..b04f7af64908 100644 --- a/test/DebugInfo/X86/gnu-public-names-empty.ll +++ b/test/DebugInfo/X86/gnu-public-names-empty.ll @@ -12,7 +12,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!3, !4} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191846) (llvm/trunk 191866)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191846) (llvm/trunk 191866)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{}  !3 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/gnu-public-names.ll b/test/DebugInfo/X86/gnu-public-names.ll index 584c879c064a..026e08661057 100644 --- a/test/DebugInfo/X86/gnu-public-names.ll +++ b/test/DebugInfo/X86/gnu-public-names.ll @@ -300,42 +300,41 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!48, !49}  !llvm.ident = !{!50} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !19, globals: !31, imports: !44) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !31, imports: !44)  !1 = !DIFile(filename: "gnu-public-names.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4, !15}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !1, line: 1, size: 8, align: 8, elements: !5, identifier: "_ZTS1C")  !5 = !{!6, !8, !12} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", scope: !"_ZTS1C", file: !1, line: 4, baseType: !7, flags: DIFlagStaticMember) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", scope: !4, file: !1, line: 4, baseType: !7, flags: DIFlagStaticMember)  !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !"_ZTS1C", file: !1, line: 2, type: !9, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false) +!8 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !4, file: !1, line: 2, type: !9, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)  !9 = !DISubroutineType(types: !10)  !10 = !{null, !11} -!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1C", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!12 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !"_ZTS1C", file: !1, line: 3, type: !13, isLocal: false, isDefinition: false, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false) +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) +!12 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !4, file: !1, line: 3, type: !13, isLocal: false, isDefinition: false, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false)  !13 = !DISubroutineType(types: !14)  !14 = !{!7}  !15 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", scope: !16, file: !1, line: 29, size: 32, align: 32, elements: !17, identifier: "_ZTSN2ns1DE")  !16 = !DINamespace(name: "ns", scope: null, file: !1, line: 23)  !17 = !{!18} -!18 = !DIDerivedType(tag: DW_TAG_member, name: "A", scope: !"_ZTSN2ns1DE", file: !1, line: 30, baseType: !7, size: 32, align: 32) -!19 = !{!20, !21, !22, !23, !26, !30} -!20 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !"_ZTS1C", file: !1, line: 9, type: !9, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, declaration: !8, variables: !2) -!21 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !"_ZTS1C", file: !1, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, declaration: !12, variables: !2) -!22 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !1, file: !1, line: 19, type: !13, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!23 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !16, file: !1, line: 24, type: !24, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!18 = !DIDerivedType(tag: DW_TAG_member, name: "A", scope: !15, file: !1, line: 30, baseType: !7, size: 32, align: 32) +!20 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !4, file: !1, line: 9, type: !9, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !8, variables: !2) +!21 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !4, file: !1, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !12, variables: !2) +!22 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !1, file: !1, line: 19, type: !13, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!23 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !16, file: !1, line: 24, type: !24, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)  !24 = !DISubroutineType(types: !25)  !25 = !{null} -!26 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !1, file: !1, line: 40, type: !27, isLocal: false, isDefinition: true, scopeLine: 40, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!26 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !1, file: !1, line: 40, type: !27, isLocal: false, isDefinition: true, scopeLine: 40, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)  !27 = !DISubroutineType(types: !28)  !28 = !{!29}  !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64) -!30 = distinct !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !1, file: !1, line: 57, type: !13, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!30 = distinct !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !1, file: !1, line: 57, type: !13, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)  !31 = !{!32, !33, !34, !35, !36, !37, !39, !41}  !32 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !0, file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, variable: i32* @_ZN1C22static_member_variableE, declaration: !6) -!33 = !DIGlobalVariable(name: "global_variable", scope: !0, file: !1, line: 17, type: !"_ZTS1C", isLocal: false, isDefinition: true, variable: %struct.C* @global_variable) +!33 = !DIGlobalVariable(name: "global_variable", scope: !0, file: !1, line: 17, type: !4, isLocal: false, isDefinition: true, variable: %struct.C* @global_variable)  !34 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !16, file: !1, line: 27, type: !7, isLocal: false, isDefinition: true, variable: i32* @_ZN2ns25global_namespace_variableE) -!35 = !DIGlobalVariable(name: "d", linkageName: "_ZN2ns1dE", scope: !16, file: !1, line: 31, type: !"_ZTSN2ns1DE", isLocal: false, isDefinition: true, variable: %"struct.ns::D"* @_ZN2ns1dE) +!35 = !DIGlobalVariable(name: "d", linkageName: "_ZN2ns1dE", scope: !16, file: !1, line: 31, type: !15, isLocal: false, isDefinition: true, variable: %"struct.ns::D"* @_ZN2ns1dE)  !36 = !DIGlobalVariable(name: "z", scope: !26, file: !1, line: 41, type: !7, isLocal: true, isDefinition: true, variable: i32* @_ZZ2f3vE1z)  !37 = !DIGlobalVariable(name: "i", linkageName: "_ZN12_GLOBAL__N_11iE", scope: !38, file: !1, line: 37, type: !7, isLocal: true, isDefinition: true, variable: i32* @_ZN12_GLOBAL__N_11iE)  !38 = !DINamespace(scope: null, file: !1, line: 36) @@ -352,7 +351,7 @@ attributes #1 = { nounwind readnone }  !49 = !{i32 2, !"Debug Info Version", i32 3}  !50 = !{!"clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)"}  !51 = !DILocalVariable(name: "this", arg: 1, scope: !20, type: !52, flags: DIFlagArtificial | DIFlagObjectPointer) -!52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1C", size: 64, align: 64) +!52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)  !53 = !DIExpression()  !54 = !DILocation(line: 0, scope: !20)  !55 = !DILocation(line: 10, scope: !20) diff --git a/test/DebugInfo/X86/header.ll b/test/DebugInfo/X86/header.ll index 1b210d0b90a2..5cc3fc8d85ee 100644 --- a/test/DebugInfo/X86/header.ll +++ b/test/DebugInfo/X86/header.ll @@ -5,7 +5,7 @@  ; CHECK:       .text  ; CHECK-NEXT: .file	"<stdin>"  ; CHECK-NEXT: .globl	f -; CHECK-NEXT: .align	16, 0x90 +; CHECK-NEXT: .p2align	4, 0x90  ; CHECK-NEXT: .type	f,@function  ; CHECK-NEXT: f:                                      # @f @@ -17,11 +17,10 @@ define void @f() !dbg !4 {  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!7, !8} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "/foo/test.c", directory: "/foo")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)  !5 = !DISubroutineType(types: !6)  !6 = !{null}  !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/inline-asm-locs.ll b/test/DebugInfo/X86/inline-asm-locs.ll new file mode 100644 index 000000000000..632aa0be6232 --- /dev/null +++ b/test/DebugInfo/X86/inline-asm-locs.ll @@ -0,0 +1,64 @@ +; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -filetype=asm | FileCheck %s + +; Generated from: +; asm( +;       ".file 1 \"A.asm\"\n" +;       ".file 2 \"B.asm\"\n" +;       ".loc  1 111\n" +;       ".text\n" +;       ".globl _bar\n" +;       "_bar:\n" +;       ".loc 2 222\n" +;       "\tret\n" +;     ); +;   +; void bar(); +;   +; void foo() { +;   bar(); +; } + +; CHECK: .file 1 "A.asm" +; CHECK: .file 2 "B.asm" +; CHECK: .loc  1 111 +; CHECK: .loc  2 222 +; CHECK: .file 3 "test.c" +; CHECK: .loc  3 14 0   + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx" + +module asm ".file 1 \22A.asm\22" +module asm ".file 2 \22B.asm\22" +module asm ".loc  1 111" +module asm ".text" +module asm ".globl _bar" +module asm "_bar:" +module asm ".loc 2 222" +module asm "\09ret" + +; Function Attrs: nounwind ssp uwtable +define void @foo() !dbg !4 { +entry: +  call void (...) @bar(), !dbg !11 +  ret void, !dbg !12 +} + +declare void @bar(...) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8, !9} +!llvm.ident = !{!10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 256963)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/22690666") +!2 = !{} +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 14, type: !5, isLocal: false, isDefinition: true, scopeLine: 14, isOptimized: false, unit: !0, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 2, !"Dwarf Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"PIC Level", i32 2} +!10 = !{!"clang version 3.8.0 (trunk 256963)"} +!11 = !DILocation(line: 15, column: 3, scope: !4) +!12 = !DILocation(line: 16, column: 1, scope: !4) diff --git a/test/DebugInfo/X86/inline-member-function.ll b/test/DebugInfo/X86/inline-member-function.ll index 712a20c3a4a8..bdf0667cb060 100644 --- a/test/DebugInfo/X86/inline-member-function.ll +++ b/test/DebugInfo/X86/inline-member-function.ll @@ -65,23 +65,22 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!20, !21}  !llvm.ident = !{!22} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !18, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !18, imports: !2)  !1 = !DIFile(filename: "inline.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS3foo")  !5 = !{!6} -!6 = !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS3foo", type: !7) +!6 = !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !10, !9}  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS3foo") -!12 = !{!13, !17} -!13 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !14, type: !15, variables: !2) +!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) +!13 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 7, file: !1, scope: !14, type: !15, variables: !2)  !14 = !DIFile(filename: "inline.cpp", directory: "/tmp/dbginfo")  !15 = !DISubroutineType(types: !16)  !16 = !{!9} -!17 = distinct !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS3foo", type: !7, declaration: !6, variables: !2) +!17 = distinct !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !4, type: !7, declaration: !6, variables: !2)  !18 = !{!19}  !19 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: null, file: !14, type: !9, variable: i32* @i)  !20 = !{i32 2, !"Dwarf Version", i32 4} @@ -89,7 +88,7 @@ attributes #1 = { nounwind readnone }  !22 = !{!"clang version 3.5.0 "}  !23 = !DILocation(line: 8, scope: !13)  !24 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !25) -!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3foo") +!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)  !26 = !DILocation(line: 0, scope: !17, inlinedAt: !23)  !27 = !DILocalVariable(name: "x", line: 2, arg: 2, scope: !17, file: !14, type: !9)  !28 = !DILocation(line: 2, scope: !17, inlinedAt: !23) diff --git a/test/DebugInfo/X86/inline-seldag-test.ll b/test/DebugInfo/X86/inline-seldag-test.ll index 62b946611f4f..ca4fab30aa2d 100644 --- a/test/DebugInfo/X86/inline-seldag-test.ll +++ b/test/DebugInfo/X86/inline-seldag-test.ll @@ -48,15 +48,14 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!12, !13}  !llvm.ident = !{!14} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "inline-seldag-test.c", directory: "/tmp/dbginfo")  !2 = !{} -!3 = !{!4, !8} -!4 = distinct !DISubprogram(name: "func", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "func", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "inline-seldag-test.c", directory: "/tmp/dbginfo")  !6 = !DISubroutineType(types: !7)  !7 = !{null} -!8 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !9, variables: !2) +!8 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !9, variables: !2)  !9 = !DISubroutineType(types: !10)  !10 = !{!11, !11}  !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/inlined-formal-parameter.ll b/test/DebugInfo/X86/inlined-formal-parameter.ll index 49c1747d7d6d..78dc905f5e4b 100644 --- a/test/DebugInfo/X86/inlined-formal-parameter.ll +++ b/test/DebugInfo/X86/inlined-formal-parameter.ll @@ -48,14 +48,13 @@ attributes #3 = { nounwind }  !llvm.module.flags = !{!13, !14, !15}  !llvm.ident = !{!16} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "t.c", directory: "/path/to/dir")  !2 = !{} -!3 = !{!4, !7} -!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !2) +!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, variables: !2)  !5 = !DISubroutineType(types: !6)  !6 = !{null} -!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !11) +!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)  !8 = !DISubroutineType(types: !9)  !9 = !{null, !10}  !10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/inlined-indirect-value.ll b/test/DebugInfo/X86/inlined-indirect-value.ll index d203650d05c5..ea5d88a43742 100644 --- a/test/DebugInfo/X86/inlined-indirect-value.ll +++ b/test/DebugInfo/X86/inlined-indirect-value.ll @@ -49,15 +49,14 @@ select.end:                                       ; preds = %entry, %select.mid  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!13, !14} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !9, imports: !2)  !1 = !DIFile(filename: "inline-break.c", directory: "/build/dir")  !2 = !{} -!3 = !{!4, !8} -!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, unit: !0, variables: !2)  !5 = !DISubroutineType(types: !6)  !6 = !{!7}  !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: true, variables: !2) +!8 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !2)  !9 = !{!10, !12}  !10 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !11, isLocal: false, isDefinition: true, variable: i32* @x)  !11 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7) diff --git a/test/DebugInfo/X86/instcombine-instrinsics.ll b/test/DebugInfo/X86/instcombine-instrinsics.ll index f4f7e1403d32..accce575ce0b 100644 --- a/test/DebugInfo/X86/instcombine-instrinsics.ll +++ b/test/DebugInfo/X86/instcombine-instrinsics.ll @@ -54,11 +54,10 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!8, !9}  !llvm.ident = !{!10} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "instcombine_intrinsics.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "init", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "init", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "instcombine_intrinsics.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null} diff --git a/test/DebugInfo/X86/isel-cse-line.ll b/test/DebugInfo/X86/isel-cse-line.ll new file mode 100644 index 000000000000..dfb058bea5b0 --- /dev/null +++ b/test/DebugInfo/X86/isel-cse-line.ll @@ -0,0 +1,100 @@ +; RUN: llc -filetype=asm -fast-isel=false -O0 < %s | FileCheck %s +; +; Generated by: +; clang -emit-llvm -S -g test.cpp + +; typedef double         fp_t; +; typedef unsigned long  int_t; +; +; int_t glb_start      = 17; +; int_t glb_end        = 42; +; +; int main() +; { +;   int_t start = glb_start; +;   int_t end   = glb_end; +; +;   fp_t dbl_start = (fp_t) start; +;   fp_t dbl_end   = (fp_t) end; +; +;   return 0; +; } + +; SelectionDAG performs CSE on constant pool loads. Make sure line numbers +; from such nodes are not propagated. Doing so results in oscillating line numbers. + +; CHECK: .loc 1 12 +; CHECK: .loc 1 13 +; CHECK-NOT: .loc 1 12 + +; ModuleID = 't.cpp' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@glb_start = global i64 17, align 8 +@glb_end = global i64 42, align 8 + +; Function Attrs: norecurse nounwind uwtable +define i32 @main() !dbg !14 { +  %1 = alloca i32, align 4 +  %2 = alloca i64, align 8 +  %3 = alloca i64, align 8 +  %4 = alloca double, align 8 +  %5 = alloca double, align 8 +  store i32 0, i32* %1, align 4 +  call void @llvm.dbg.declare(metadata i64* %2, metadata !18, metadata !19), !dbg !20 +  %6 = load i64, i64* @glb_start, align 8, !dbg !21 +  store i64 %6, i64* %2, align 8, !dbg !20 +  call void @llvm.dbg.declare(metadata i64* %3, metadata !22, metadata !19), !dbg !23 +  %7 = load i64, i64* @glb_end, align 8, !dbg !24 +  store i64 %7, i64* %3, align 8, !dbg !23 +  call void @llvm.dbg.declare(metadata double* %4, metadata !25, metadata !19), !dbg !26 +  %8 = load i64, i64* %2, align 8, !dbg !27 +  %9 = uitofp i64 %8 to double, !dbg !27 +  store double %9, double* %4, align 8, !dbg !26 +  call void @llvm.dbg.declare(metadata double* %5, metadata !28, metadata !19), !dbg !29 +  %10 = load i64, i64* %3, align 8, !dbg !30 +  %11 = uitofp i64 %10 to double, !dbg !30 +  store double %11, double* %5, align 8, !dbg !29 +  ret i32 0, !dbg !31 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!11, !12} +!llvm.ident = !{!13} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 268246)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !6) +!1 = !DIFile(filename: "/home/wpieb/test/D12094.cpp", directory: "/home/wpieb/build/llvm/trunk/llvm-RelWithDebInfo") +!2 = !{} +!3 = !{!4} +!4 = !DIDerivedType(tag: DW_TAG_typedef, name: "fp_t", file: !1, line: 1, baseType: !5) +!5 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) +!6 = !{!7, !10} +!7 = distinct !DIGlobalVariable(name: "glb_start", scope: !0, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i64* @glb_start) +!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "int_t", file: !1, line: 2, baseType: !9) +!9 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) +!10 = distinct !DIGlobalVariable(name: "glb_end", scope: !0, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, variable: i64* @glb_end) +!11 = !{i32 2, !"Dwarf Version", i32 4} +!12 = !{i32 2, !"Debug Info Version", i32 3} +!13 = !{!"clang version 3.9.0 (trunk 268246)"} +!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !15, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!15 = !DISubroutineType(types: !16) +!16 = !{!17} +!17 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!18 = !DILocalVariable(name: "start", scope: !14, file: !1, line: 9, type: !8) +!19 = !DIExpression() +!20 = !DILocation(line: 9, column: 9, scope: !14) +!21 = !DILocation(line: 9, column: 17, scope: !14) +!22 = !DILocalVariable(name: "end", scope: !14, file: !1, line: 10, type: !8) +!23 = !DILocation(line: 10, column: 9, scope: !14) +!24 = !DILocation(line: 10, column: 17, scope: !14) +!25 = !DILocalVariable(name: "dbl_start", scope: !14, file: !1, line: 12, type: !4) +!26 = !DILocation(line: 12, column: 8, scope: !14) +!27 = !DILocation(line: 12, column: 27, scope: !14) +!28 = !DILocalVariable(name: "dbl_end", scope: !14, file: !1, line: 13, type: !4) +!29 = !DILocation(line: 13, column: 8, scope: !14) +!30 = !DILocation(line: 13, column: 27, scope: !14) +!31 = !DILocation(line: 15, column: 3, scope: !14) diff --git a/test/DebugInfo/X86/lexical-block-file-inline.ll b/test/DebugInfo/X86/lexical-block-file-inline.ll new file mode 100644 index 000000000000..d956efee1eed --- /dev/null +++ b/test/DebugInfo/X86/lexical-block-file-inline.ll @@ -0,0 +1,161 @@ +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info - | FileCheck %s + +;; This test checks that Inlined DILexicalBlockFile with local decl entry +;; is skipped and only one DW_TAG_lexical_block is generated. +;; This test is special because it contains DILexicalBlockFile that has a +;; DILexicalBlockFile as a parent scope. +;; +;; This test was generated by running following command: +;; clang -cc1 -O0 -debug-info-kind=limited -dwarf-version=4 -emit-llvm test.cpp +;; Where test.cpp +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;namespace N {} +;; __attribute__((always_inline)) int bar() { +;;  { +;;    int y; +;;#line 1 "test.h" +;;    using namespace N; +;;    while (y < 0) return 2; +;;    return 0; +;;  } +;;} +;;int foo() {   +;;  return bar(); +;;} +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Concrete "bar" function +; CHECK:    DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:      DW_AT_abstract_origin {{.*}} {[[Offset_bar:0x[0-9abcdef]+]]} +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:      DW_TAG_lexical_block +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:        DW_TAG_variable +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:        DW_TAG_imported_module + +;; Abstract "bar" function +; CHECK:    [[Offset_bar]]: DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:      DW_AT_name {{.*}} "bar" +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:      DW_AT_inline +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:      DW_TAG_lexical_block +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:        DW_TAG_variable +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:        DW_TAG_imported_module + +; CHECK:    DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:      DW_AT_name {{.*}} "foo" +; CHECK-NOT: {{NULL}} + +;; Inlined "bar" function +; CHECK:      DW_TAG_inlined_subroutine +; CHECK-NEXT:   DW_AT_abstract_origin {{.*}} {[[Offset_bar]]} +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:        DW_TAG_lexical_block +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:          DW_TAG_variable +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK:          DW_TAG_imported_module + + +; Function Attrs: alwaysinline nounwind +define i32 @_Z3barv() #0 !dbg !4 { +entry: +  %retval = alloca i32, align 4 +  %y = alloca i32, align 4 +  call void @llvm.dbg.declare(metadata i32* %y, metadata !18, metadata !19), !dbg !20 +  br label %while.cond, !dbg !21 + +while.cond:                                       ; preds = %entry +  %0 = load i32, i32* %y, align 4, !dbg !22 +  %cmp = icmp slt i32 %0, 0, !dbg !22 +  br i1 %cmp, label %while.body, label %while.end, !dbg !22 + +while.body:                                       ; preds = %while.cond +  store i32 2, i32* %retval, align 4, !dbg !24 +  br label %return, !dbg !24 + +while.end:                                        ; preds = %while.cond +  store i32 0, i32* %retval, align 4, !dbg !26 +  br label %return, !dbg !26 + +return:                                           ; preds = %while.end, %while.body +  %1 = load i32, i32* %retval, align 4, !dbg !27 +  ret i32 %1, !dbg !27 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 + +; Function Attrs: nounwind +define i32 @_Z3foov() #2 !dbg !8 { +entry: +  %retval.i = alloca i32, align 4 +  %y.i = alloca i32, align 4 +  call void @llvm.dbg.declare(metadata i32* %y.i, metadata !18, metadata !19), !dbg !29 +  %0 = load i32, i32* %y.i, align 4, !dbg !31 +  %cmp.i = icmp slt i32 %0, 0, !dbg !31 +  br i1 %cmp.i, label %while.body.i, label %while.end.i, !dbg !31 + +while.body.i:                                     ; preds = %entry +  store i32 2, i32* %retval.i, align 4, !dbg !32 +  br label %_Z3barv.exit, !dbg !32 + +while.end.i:                                      ; preds = %entry +  store i32 0, i32* %retval.i, align 4, !dbg !33 +  br label %_Z3barv.exit, !dbg !33 + +_Z3barv.exit:                                     ; preds = %while.end.i, %while.body.i +  %1 = load i32, i32* %retval.i, align 4, !dbg !34 +  ret i32 %1, !dbg !35 +} + +attributes #0 = { alwaysinline nounwind } +attributes #1 = { nounwind readnone } +attributes #2 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!15, !16} +!llvm.ident = !{!17} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 264349)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, imports: !10) +!1 = !DIFile(filename: "test.cpp", directory: "/") +!2 = !{} +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !9, file: !9, line: 6, type: !5, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) +!9 = !DIFile(filename: "test.h", directory: "/") +!10 = !{!11} +!11 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !12, entity: !14, line: 1) +!12 = !DILexicalBlockFile(scope: !13, file: !9, discriminator: 0) +!13 = distinct !DILexicalBlock(scope: !4, file: !1, line: 3) +!14 = !DINamespace(name: "N", scope: null, file: !1, line: 1) +!15 = !{i32 2, !"Dwarf Version", i32 4} +!16 = !{i32 2, !"Debug Info Version", i32 3} +!17 = !{!"clang version 3.9.0 (trunk 264349)"} +!18 = !DILocalVariable(name: "y", scope: !13, file: !1, line: 4, type: !7) +!19 = !DIExpression() +!20 = !DILocation(line: 4, scope: !13) +!21 = !DILocation(line: 2, scope: !12) +!22 = !DILocation(line: 2, scope: !23) +!23 = !DILexicalBlockFile(scope: !12, file: !9, discriminator: 1) +!24 = !DILocation(line: 2, scope: !25) +!25 = !DILexicalBlockFile(scope: !12, file: !9, discriminator: 2) +!26 = !DILocation(line: 3, scope: !12) +!27 = !DILocation(line: 5, scope: !28) +!28 = !DILexicalBlockFile(scope: !4, file: !9, discriminator: 0) +!29 = !DILocation(line: 4, scope: !13, inlinedAt: !30) +!30 = distinct !DILocation(line: 7, scope: !8) +!31 = !DILocation(line: 2, scope: !23, inlinedAt: !30) +!32 = !DILocation(line: 2, scope: !25, inlinedAt: !30) +!33 = !DILocation(line: 3, scope: !12, inlinedAt: !30) +!34 = !DILocation(line: 5, scope: !28, inlinedAt: !30) +!35 = !DILocation(line: 7, scope: !8) diff --git a/test/DebugInfo/X86/lexical_block.ll b/test/DebugInfo/X86/lexical_block.ll index 5fdfcdfe269b..cf594d6b6ff8 100644 --- a/test/DebugInfo/X86/lexical_block.ll +++ b/test/DebugInfo/X86/lexical_block.ll @@ -48,11 +48,10 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!8, !9}  !llvm.ident = !{!10} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "lexical_block.cpp", directory: "/tmp/dbginfo")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "b", linkageName: "_Z1bv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "b", linkageName: "_Z1bv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "lexical_block.cpp", directory: "/tmp/dbginfo")  !6 = !DISubroutineType(types: !7)  !7 = !{null} diff --git a/test/DebugInfo/X86/line-info.ll b/test/DebugInfo/X86/line-info.ll index bdd91db9eecb..d1258533feca 100644 --- a/test/DebugInfo/X86/line-info.ll +++ b/test/DebugInfo/X86/line-info.ll @@ -38,17 +38,16 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!19} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports:  !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports:  !2)  !1 = !DIFile(filename: "list0.c", directory: "/usr/local/google/home/blaikie/dev/scratch")  !2 = !{} -!3 = !{!4, !10} -!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !5, scope: !6, type: !7, variables: !2)  !5 = !DIFile(filename: "./list0.h", directory: "/usr/local/google/home/blaikie/dev/scratch")  !6 = !DIFile(filename: "./list0.h", directory: "/usr/local/google/home/blaikie/dev/scratch")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !9}  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !11, type: !12, variables: !2) +!10 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !11, type: !12, variables: !2)  !11 = !DIFile(filename: "list0.c", directory: "/usr/local/google/home/blaikie/dev/scratch")  !12 = !DISubroutineType(types: !13)  !13 = !{!9} diff --git a/test/DebugInfo/X86/linkage-name.ll b/test/DebugInfo/X86/linkage-name.ll index 4408d5132c46..295b898b4489 100644 --- a/test/DebugInfo/X86/linkage-name.ll +++ b/test/DebugInfo/X86/linkage-name.ll @@ -27,10 +27,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!29} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 152691) (llvm/trunk 152692)", isOptimized: false, emissionKind: 0, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !18, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 152691) (llvm/trunk 152692)", isOptimized: false, emissionKind: FullDebug, file: !28, enums: !1, retainedTypes: !1, globals: !18, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !6, scope: null, type: !7, declaration: !13) +!5 = distinct !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !6, scope: null, type: !7, declaration: !13)  !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !10, !9} diff --git a/test/DebugInfo/X86/live-debug-values.ll b/test/DebugInfo/X86/live-debug-values.ll index 615d498041bb..eca301017ae0 100644 --- a/test/DebugInfo/X86/live-debug-values.ll +++ b/test/DebugInfo/X86/live-debug-values.ll @@ -31,7 +31,9 @@  ; and BB#4.  ; CHECK:       .LBB0_5:  ; CHECK-NEXT:  #DEBUG_VALUE: main:n <- %EBX -; CHECK-NEXT:  #DEBUG_VALUE: main:argv <- %RSI +;   Other register values have been clobbered. +; CHECK-NOT:   #DEBUG_VALUE: +; CHECK:         movl    %ecx, m(%rip)  ; ModuleID = 'LiveDebugValues.c'  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -102,11 +104,10 @@ attributes #4 = { nounwind }  !llvm.module.flags = !{!17, !18}  !llvm.ident = !{!19} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !15) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !15)  !1 = !DIFile(filename: "LiveDebugValues.c", directory: "/home/vt/julia/test/tvvikram")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !11) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)  !5 = !DISubroutineType(types: !6)  !6 = !{!7, !7, !8}  !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/low-pc-cu.ll b/test/DebugInfo/X86/low-pc-cu.ll index f98da6f5ae28..984bb096f07f 100644 --- a/test/DebugInfo/X86/low-pc-cu.ll +++ b/test/DebugInfo/X86/low-pc-cu.ll @@ -32,11 +32,10 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !llvm.module.flags = !{!8, !9}  !llvm.ident = !{!10} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "z", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "z", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo")  !6 = !DISubroutineType(types: !7)  !7 = !{null} diff --git a/test/DebugInfo/X86/memberfnptr.ll b/test/DebugInfo/X86/memberfnptr.ll index 9b1c57dd7442..bb6dca9eab9a 100644 --- a/test/DebugInfo/X86/memberfnptr.ll +++ b/test/DebugInfo/X86/memberfnptr.ll @@ -24,20 +24,20 @@ declare void @_ZN1A3fooEv(%struct.A*)  !llvm.module.flags = !{!14, !15, !16}  !llvm.ident = !{!17} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !10, imports: !2)  !1 = !DIFile(filename: "memberfnptr.cpp", directory: "")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A")  !5 = !{!6} -!6 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEv", line: 2, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS1A", type: !7) +!6 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEv", line: 2, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7)  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} -!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)  !10 = !{!11}  !11 = !DIGlobalVariable(name: "p", line: 5, isLocal: false, isDefinition: true, scope: null, file: !12, type: !13, variable: { i64, i64 }* @p)  !12 = !DIFile(filename: "memberfnptr.cpp", directory: "") -!13 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, size: 64, baseType: !7, extraData: !"_ZTS1A") +!13 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, size: 64, baseType: !7, extraData: !4)  !14 = !{i32 2, !"Dwarf Version", i32 2}  !15 = !{i32 2, !"Debug Info Version", i32 3}  !16 = !{i32 1, !"PIC Level", i32 2} diff --git a/test/DebugInfo/X86/mi-print.ll b/test/DebugInfo/X86/mi-print.ll index 086e88deffb0..f77c314ddae6 100644 --- a/test/DebugInfo/X86/mi-print.ll +++ b/test/DebugInfo/X86/mi-print.ll @@ -31,17 +31,16 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!13, !14, !15}  !llvm.ident = !{!16} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 233919) (llvm/trunk 233920)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 233919) (llvm/trunk 233920)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "t.c", directory: "/Users/dexonsmith/data/llvm/debug-info/test/DebugInfo/X86")  !2 = !{} -!3 = !{!4, !10} -!4 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !8) +!4 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !8)  !5 = !DISubroutineType(types: !6)  !6 = !{!7, !7}  !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !8 = !{!9}  !9 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !1, line: 2, type: !7) -!10 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !11) +!10 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)  !11 = !{!12}  !12 = !DILocalVariable(name: "x", arg: 1, scope: !10, file: !1, line: 1, type: !7)  !13 = !{i32 2, !"Dwarf Version", i32 2} diff --git a/test/DebugInfo/X86/misched-dbg-value.ll b/test/DebugInfo/X86/misched-dbg-value.ll index e85e241c589f..96d59809bd72 100644 --- a/test/DebugInfo/X86/misched-dbg-value.ll +++ b/test/DebugInfo/X86/misched-dbg-value.ll @@ -103,7 +103,7 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!83} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 175015)", isOptimized: true, emissionKind: 1, file: !82, enums: !1, retainedTypes: !10, subprograms: !11, globals: !29, imports:  !10) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 175015)", isOptimized: true, emissionKind: FullDebug, file: !82, enums: !1, retainedTypes: !10, globals: !29, imports:  !10)  !1 = !{!2}  !2 = !DICompositeType(tag: DW_TAG_enumeration_type, line: 128, size: 32, align: 32, file: !82, elements: !4)  !3 = !DIFile(filename: "dry.c", directory: "/Users/manmanren/test-Nov/rdar_13183203/test2") @@ -114,8 +114,7 @@ attributes #1 = { nounwind readnone }  !8 = !DIEnumerator(name: "Ident4", value: 10002) ; [ DW_TAG_enumerator ] [Ident4 :: 10002]  !9 = !DIEnumerator(name: "Ident5", value: 10003) ; [ DW_TAG_enumerator ] [Ident5 :: 10003]  !10 = !{} -!11 = !{!12} -!12 = distinct !DISubprogram(name: "Proc8", line: 180, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 185, file: !82, scope: !3, type: !13, variables: !22) +!12 = distinct !DISubprogram(name: "Proc8", line: 180, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 185, file: !82, scope: !3, type: !13, variables: !22)  !13 = !DISubroutineType(types: !14)  !14 = !{null, !15, !17, !21, !21}  !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16) diff --git a/test/DebugInfo/X86/missing-file-line.ll b/test/DebugInfo/X86/missing-file-line.ll index 19064579af36..629124d67650 100644 --- a/test/DebugInfo/X86/missing-file-line.ll +++ b/test/DebugInfo/X86/missing-file-line.ll @@ -36,11 +36,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1  !llvm.module.flags = !{!7, !8}  !llvm.ident = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "file.c", directory: "/dir")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: false, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: false, unit: !0, variables: !2)  !5 = !DISubroutineType(types: !6)  !6 = !{null}  !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/mixed-nodebug-cu.ll b/test/DebugInfo/X86/mixed-nodebug-cu.ll new file mode 100644 index 000000000000..bd078b75d381 --- /dev/null +++ b/test/DebugInfo/X86/mixed-nodebug-cu.ll @@ -0,0 +1,48 @@ +; RUN: llc %s -o %t -filetype=obj +; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s +; CHECK: DW_TAG_compile_unit +; CHECK:   DW_TAG_subprogram +; CHECK:     DW_AT_name{{.*}}"f" +; CHECK-NOT: DW_TAG_compile_unit +; +; created from +;   void f() {} // compile with -g +;   void g() {} // compile with -Rpass=inline +; and llvm-linking the result. + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +; Function Attrs: nounwind ssp uwtable +define void @f() #0 !dbg !4 { +entry: +  ret void, !dbg !15 +} + +; Function Attrs: nounwind ssp uwtable +define void @g() #0 !dbg !9 { +entry: +  ret void, !dbg !16 +} + +attributes #0 = { nounwind ssp uwtable } + +!llvm.dbg.cu = !{!0, !7} +!llvm.ident = !{!11, !11} +!llvm.module.flags = !{!12, !13, !14} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm") +!2 = !{} +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2) +!9 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !7, variables: !2) +!10 = !DISubroutineType(types: !2) +!11 = !{!"clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)"} +!12 = !{i32 2, !"Dwarf Version", i32 2} +!13 = !{i32 2, !"Debug Info Version", i32 3} +!14 = !{i32 1, !"PIC Level", i32 2} +!15 = !DILocation(line: 1, column: 12, scope: !4) +!16 = !DILocation(line: 1, column: 12, scope: !9) diff --git a/test/DebugInfo/X86/multiple-aranges.ll b/test/DebugInfo/X86/multiple-aranges.ll index 17a475d59345..b07d7183b19b 100644 --- a/test/DebugInfo/X86/multiple-aranges.ll +++ b/test/DebugInfo/X86/multiple-aranges.ll @@ -44,14 +44,14 @@ target triple = "x86_64-unknown-linux-gnu"  !llvm.dbg.cu = !{!0, !7}  !llvm.module.flags = !{!12, !13} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !3, imports: !2)  !1 = !DIFile(filename: "test1.c", directory: "/home/kayamon")  !2 = !{}  !3 = !{!4}  !4 = !DIGlobalVariable(name: "kittens", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: i32* @kittens)  !5 = !DIFile(filename: "test1.c", directory: "/home/kayamon")  !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!7 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !8, enums: !2, retainedTypes: !2, subprograms: !2, globals: !9, imports: !2) +!7 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !8, enums: !2, retainedTypes: !2, globals: !9, imports: !2)  !8 = !DIFile(filename: "test2.c", directory: "/home/kayamon")  !9 = !{!10}  !10 = !DIGlobalVariable(name: "rainbows", line: 1, isLocal: false, isDefinition: true, scope: null, file: !11, type: !6, variable: i32* @rainbows) diff --git a/test/DebugInfo/X86/multiple-at-const-val.ll b/test/DebugInfo/X86/multiple-at-const-val.ll index 97db71952905..052d905af801 100644 --- a/test/DebugInfo/X86/multiple-at-const-val.ll +++ b/test/DebugInfo/X86/multiple-at-const-val.ll @@ -32,7 +32,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!1803} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 174207)", isOptimized: true, emissionKind: 0, file: !1802, enums: !1, retainedTypes: !955, subprograms: !956, globals: !1786, imports:  !955) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 174207)", isOptimized: true, emissionKind: FullDebug, file: !1802, enums: !1, retainedTypes: !955, globals: !1786, imports:  !955)  !1 = !{!26}  !4 = !DINamespace(name: "std", line: 48, scope: !5)  !5 = !DIFile(filename: "os_base.h", directory: "/privite/tmp") @@ -53,8 +53,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !78 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !79)  !79 = !DIDerivedType(tag: DW_TAG_typedef, name: "ostate", line: 327, file: !1801, scope: !49, baseType: !26)  !955 = !{} -!956 = !{!960} -!960 = distinct !DISubprogram(name: "main", line: 73, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 73, file: !1802, scope: null, type: !54, variables: !955) +!960 = distinct !DISubprogram(name: "main", line: 73, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 73, file: !1802, scope: null, type: !54, variables: !955)  !961 = !DIFile(filename: "student2.cpp", directory: "/privite/tmp")  !1786 = !{!1800}  !1800 = !DIGlobalVariable(name: "badbit", linkageName: "badbit", line: 331, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !78, variable: i32 1, declaration: !77) diff --git a/test/DebugInfo/X86/nodebug_with_debug_loc.ll b/test/DebugInfo/X86/nodebug_with_debug_loc.ll index 4ccf22bdc5aa..c6d3e64ea011 100644 --- a/test/DebugInfo/X86/nodebug_with_debug_loc.ll +++ b/test/DebugInfo/X86/nodebug_with_debug_loc.ll @@ -58,8 +58,8 @@ entry:  for.body:                                         ; preds = %for.body, %entry    %iter.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]    call void @llvm.lifetime.start(i64 4, i8* %0), !dbg !26 -  call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !16, metadata !DIExpression()) #3, !dbg !26 -  call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !27, metadata !DIExpression()) #3, !dbg !29 +  call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !16, metadata !DIExpression(DW_OP_deref)) #3, !dbg !26 +  call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)) #3, !dbg !29    call void @_Z4sinkPKv(i8* undef) #3, !dbg !29    call void @_Z4sinkPKv(i8* %0) #3, !dbg !30    call void @llvm.lifetime.end(i64 4, i8* %0), !dbg !31 @@ -97,27 +97,26 @@ attributes #3 = { nounwind }  !llvm.module.flags = !{!23, !24}  !llvm.ident = !{!25} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !10, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "<stdin>", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "string", line: 7, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS6string")  !5 = !DIFile(filename: "repro.cpp", directory: "/tmp/dbginfo")  !6 = !{!7} -!7 = !DIDerivedType(tag: DW_TAG_member, name: "mem", line: 8, size: 32, align: 32, file: !5, scope: !"_ZTS6string", baseType: !8) +!7 = !DIDerivedType(tag: DW_TAG_member, name: "mem", line: 8, size: 32, align: 32, file: !5, scope: !4, baseType: !8)  !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !9)  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!10 = !{!11, !17} -!11 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !5, scope: !12, type: !13, variables: !15) +!11 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 14, file: !5, scope: !12, type: !13, variables: !15)  !12 = !DIFile(filename: "repro.cpp", directory: "/tmp/dbginfo")  !13 = !DISubroutineType(types: !14)  !14 = !{null}  !15 = !{!16} -!16 = !DILocalVariable(name: "str2", line: 15, scope: !11, file: !12, type: !"_ZTS6string") -!17 = distinct !DISubprogram(name: "s2", linkageName: "_Z2s2P6string", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !12, type: !18, variables: !21) +!16 = !DILocalVariable(name: "str2", line: 15, scope: !11, file: !12, type: !4) +!17 = distinct !DISubprogram(name: "s2", linkageName: "_Z2s2P6string", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 13, file: !5, scope: !12, type: !18, variables: !21)  !18 = !DISubroutineType(types: !19)  !19 = !{null, !20} -!20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"_ZTS6string") +!20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !4)  !21 = !{!22}  !22 = !DILocalVariable(name: "lhs", line: 13, arg: 1, scope: !17, file: !12, type: !20)  !23 = !{i32 2, !"Dwarf Version", i32 4} @@ -130,7 +129,7 @@ attributes #3 = { nounwind }  !30 = !DILocation(line: 17, scope: !11)  !31 = !DILocation(line: 18, scope: !11)  !32 = !{!33, !34, i64 0} -!33 = !{!"_ZTS6string", !34, i64 0} +!33 = !{!4, !34, i64 0}  !34 = !{!"any pointer", !35, i64 0}  !35 = !{!"omnipotent char", !36, i64 0}  !36 = !{!"Simple C/C++ TBAA"} diff --git a/test/DebugInfo/X86/nondefault-subrange-array.ll b/test/DebugInfo/X86/nondefault-subrange-array.ll index fc82fa560a40..ee5f2d9fe737 100644 --- a/test/DebugInfo/X86/nondefault-subrange-array.ll +++ b/test/DebugInfo/X86/nondefault-subrange-array.ll @@ -30,7 +30,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!21} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) diff --git a/test/DebugInfo/X86/nophysreg.ll b/test/DebugInfo/X86/nophysreg.ll index ddf014b43b77..7f0c5fcc3ff4 100644 --- a/test/DebugInfo/X86/nophysreg.ll +++ b/test/DebugInfo/X86/nophysreg.ll @@ -88,25 +88,25 @@ while.cond.loopexit:                              ; preds = %while.body4, %while  while.body:                                       ; preds = %entry, %while.cond.loopexit    store i32 0, i32* %ref.tmp, align 4, !dbg !41, !tbaa !42 -  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !36), !dbg !46 +  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !46    call void @_Z4funcRKiS0_(i32* dereferenceable(4) %x, i32* dereferenceable(4) %ref.tmp), !dbg !47    %call29 = call i32 @_Z4condv(), !dbg !48    %tobool310 = icmp eq i32 %call29, 0, !dbg !48    br i1 %tobool310, label %while.cond.loopexit, label %while.body4, !dbg !49  while.body4:                                      ; preds = %while.body, %while.body4 -  call void @llvm.dbg.value(metadata i8* %y, i64 0, metadata !23, metadata !36), !dbg !50 +  call void @llvm.dbg.value(metadata i8* %y, i64 0, metadata !23, metadata !DIExpression(DW_OP_deref)), !dbg !50    call void @_Z4funcPv(i8* %y), !dbg !51 -  call void @llvm.dbg.value(metadata i8* %j, i64 0, metadata !26, metadata !36), !dbg !52 +  call void @llvm.dbg.value(metadata i8* %j, i64 0, metadata !26, metadata !DIExpression(DW_OP_deref)), !dbg !52    call void @_Z4funcPv(i8* %j), !dbg !53 -  call void @llvm.dbg.value(metadata i8* %I, i64 0, metadata !27, metadata !36), !dbg !54 +  call void @llvm.dbg.value(metadata i8* %I, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)), !dbg !54    call void @_Z4funcPv(i8* %I), !dbg !55    store i32 0, i32* %ref.tmp5, align 4, !dbg !56, !tbaa !42    store i32 0, i32* %ref.tmp6, align 4, !dbg !57, !tbaa !42    call void @_Z4funcRKiS0_(i32* dereferenceable(4) %ref.tmp5, i32* dereferenceable(4) %ref.tmp6), !dbg !58    call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !28, metadata !36), !dbg !59    call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !28, metadata !33), !dbg !59 -  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !36), !dbg !46 +  call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !46    call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !60, metadata !33), !dbg !62    call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !60, metadata !35), !dbg !62    call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !60, metadata !36), !dbg !62 @@ -136,24 +136,23 @@ attributes #3 = { ssp uwtable }  !llvm.module.flags = !{!29, !30, !31}  !llvm.ident = !{!32} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227088) (llvm/trunk 227091)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !10, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227088) (llvm/trunk 227091)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "test.cpp", directory: "")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 128, align: 64, file: !1, elements: !5, identifier: "_ZTS1A")  !5 = !{!6, !9} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "m1", line: 2, size: 64, align: 64, file: !1, scope: !"_ZTS1A", baseType: !7) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "m1", line: 2, size: 64, align: 64, file: !1, scope: !4, baseType: !7)  !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DIDerivedType(tag: DW_TAG_member, name: "m2", line: 3, size: 32, align: 32, offset: 64, file: !1, scope: !"_ZTS1A", baseType: !8) -!10 = !{!11, !17} -!11 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f21A", line: 7, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !12, type: !13, variables: !15) +!9 = !DIDerivedType(tag: DW_TAG_member, name: "m2", line: 3, size: 32, align: 32, offset: 64, file: !1, scope: !4, baseType: !8) +!11 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f21A", line: 7, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 7, file: !1, scope: !12, type: !13, variables: !15)  !12 = !DIFile(filename: "test.cpp", directory: "")  !13 = !DISubroutineType(types: !14) -!14 = !{null, !"_ZTS1A"} +!14 = !{null, !4}  !15 = !{!16} -!16 = !DILocalVariable(name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !"_ZTS1A") -!17 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 12, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !1, scope: !12, type: !18, variables: !20) +!16 = !DILocalVariable(name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !4) +!17 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 12, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 12, file: !1, scope: !12, type: !18, variables: !20)  !18 = !DISubroutineType(types: !19)  !19 = !{null}  !20 = !{!21, !23, !26, !27, !28} @@ -164,7 +163,7 @@ attributes #3 = { ssp uwtable }  !25 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)  !26 = !DILocalVariable(name: "j", line: 19, scope: !24, file: !12, type: !25)  !27 = !DILocalVariable(name: "I", line: 21, scope: !24, file: !12, type: !25) -!28 = !DILocalVariable(name: "g", line: 24, scope: !24, file: !12, type: !"_ZTS1A") +!28 = !DILocalVariable(name: "g", line: 24, scope: !24, file: !12, type: !4)  !29 = !{i32 2, !"Dwarf Version", i32 2}  !30 = !{i32 2, !"Debug Info Version", i32 3}  !31 = !{i32 1, !"PIC Level", i32 2} @@ -196,7 +195,7 @@ attributes #3 = { ssp uwtable }  !57 = !DILocation(line: 23, column: 15, scope: !24)  !58 = !DILocation(line: 23, column: 7, scope: !24)  !59 = !DILocation(line: 24, column: 9, scope: !24) -!60 = !DILocalVariable(name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !"_ZTS1A") +!60 = !DILocalVariable(name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !4)  !61 = distinct !DILocation(line: 26, column: 7, scope: !24)  !62 = !DILocation(line: 7, column: 42, scope: !11, inlinedAt: !61)  !63 = !DILocation(line: 7, column: 48, scope: !11, inlinedAt: !61) diff --git a/test/DebugInfo/X86/objc-fwd-decl.ll b/test/DebugInfo/X86/objc-fwd-decl.ll index 30024dc414b5..af12e16a800d 100644 --- a/test/DebugInfo/X86/objc-fwd-decl.ll +++ b/test/DebugInfo/X86/objc-fwd-decl.ll @@ -12,7 +12,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9, !10, !11, !12, !14} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.1 (trunk 152054 trunk 152094)", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.1 (trunk 152054 trunk 152094)", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !13, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %0** @a) diff --git a/test/DebugInfo/X86/objc-property-void.ll b/test/DebugInfo/X86/objc-property-void.ll index 190d5fe00e7f..4fcc2429208d 100644 --- a/test/DebugInfo/X86/objc-property-void.ll +++ b/test/DebugInfo/X86/objc-property-void.ll @@ -72,7 +72,7 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!17, !18, !19, !20, !21, !22}  !llvm.ident = !{!23} -!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "-", directory: "")  !2 = !{}  !3 = !{!4} @@ -81,8 +81,7 @@ attributes #1 = { nounwind readnone }  !6 = !DIFile(filename: "<stdin>", directory: "")  !7 = !{!8}  !8 = !DIObjCProperty(name: "foo", line: 2, attributes: 2117, file: !6) -!9 = !{!10} -!10 = distinct !DISubprogram(name: "-[Foo foo]", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !6, type: !11, variables: !2) +!10 = distinct !DISubprogram(name: "-[Foo foo]", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !5, scope: !6, type: !11, variables: !2)  !11 = !DISubroutineType(types: !12)  !12 = !{null, !13, !14}  !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) diff --git a/test/DebugInfo/X86/op_deref.ll b/test/DebugInfo/X86/op_deref.ll index 535c7390a54c..bfec43757d1d 100644 --- a/test/DebugInfo/X86/op_deref.ll +++ b/test/DebugInfo/X86/op_deref.ll @@ -80,10 +80,9 @@ declare void @llvm.stackrestore(i8*) nounwind  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!29} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156005) (llvm/trunk 156000)", isOptimized: false, emissionKind: 1, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156005) (llvm/trunk 156000)", isOptimized: false, emissionKind: FullDebug, file: !28, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "testVLAwithSize", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !28, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "testVLAwithSize", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !28, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "bar.c", directory: "/Users/echristo/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} diff --git a/test/DebugInfo/X86/parameters.ll b/test/DebugInfo/X86/parameters.ll index 1d71efc0719d..38c40dfd6c48 100644 --- a/test/DebugInfo/X86/parameters.ll +++ b/test/DebugInfo/X86/parameters.ll @@ -25,15 +25,19 @@  ; CHECK: debug_info contents  ; 0x74 is DW_OP_breg4, showing that the parameter is accessed indirectly  ; (with a zero offset) from the register parameter -; CHECK: DW_AT_location{{.*}}(<0x0{{.}}> 74 00 +; CHECK: DW_AT_location [DW_FORM_data4]	([[F_LOC:0x[0-9]*]])  ; CHECK-NOT: DW_TAG  ; CHECK: DW_AT_name{{.*}} = "f" - +;  ; CHECK: DW_AT_location{{.*}}([[G_LOC:0x[0-9]*]])  ; CHECK-NOT: DW_TAG  ; CHECK: DW_AT_name{{.*}} = "g" +;  ; CHECK: debug_loc contents -; CHECK-NEXT: [[G_LOC]]: Beginning +; CHECK:         [[F_LOC]]: Beginning +; CHECK-NEXT:               Ending +; CHECK-NEXT: Location description: 74 00 +; CHECK:         [[G_LOC]]: Beginning  ; CHECK-NEXT:               Ending  ; CHECK-NEXT: Location description: 74 00 @@ -82,11 +86,10 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!21, !33} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "pass.cpp", directory: "/tmp")  !2 = !{} -!3 = !{!4, !17} -!4 = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DINamespace(name: "pr14763", line: 1, file: !1, scope: null)  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8} @@ -98,7 +101,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8)  !14 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !15)  !15 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) -!17 = distinct !DISubprogram(name: "func2", linkageName: "_ZN7pr147635func2EbNS_3fooE", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 12, file: !1, scope: !5, type: !18, variables: !2) +!17 = distinct !DISubprogram(name: "func2", linkageName: "_ZN7pr147635func2EbNS_3fooE", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 12, file: !1, scope: !5, type: !18, variables: !2)  !18 = !DISubroutineType(types: !19)  !19 = !{null, !20, !8}  !20 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) diff --git a/test/DebugInfo/X86/pieces-1.ll b/test/DebugInfo/X86/pieces-1.ll index 9d4f5265b3c2..cc6c33022a00 100644 --- a/test/DebugInfo/X86/pieces-1.ll +++ b/test/DebugInfo/X86/pieces-1.ll @@ -50,11 +50,10 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!17, !18}  !llvm.ident = !{!19} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "pieces.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !15) +!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !15)  !5 = !DIFile(filename: "pieces.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !9} diff --git a/test/DebugInfo/X86/pieces-2.ll b/test/DebugInfo/X86/pieces-2.ll index 8a43f452d32b..66eea6bf5d4d 100644 --- a/test/DebugInfo/X86/pieces-2.ll +++ b/test/DebugInfo/X86/pieces-2.ll @@ -17,10 +17,15 @@  ;  ;  ; CHECK: DW_TAG_variable [4] -;                                                  rax, piece 0x00000004 -; CHECK-NEXT: DW_AT_location [DW_FORM_block1]{{.*}}50 93 04 +; CHECK-NEXT:   DW_AT_location [DW_FORM_data4]        ([[LOC:.*]])  ; CHECK-NEXT:  DW_AT_name {{.*}}"i1"  ; +; CHECK: .debug_loc +; CHECK: [[LOC]]: Beginning address offset: 0x0000000000000004 +; CHECK-NEXT:        Ending address offset: 0x0000000000000005 +;                                           rax, piece 0x00000004 +; CHECK-NEXT:         Location description: 50 93 04 +;  ; ModuleID = '/Volumes/Data/llvm/test/DebugInfo/X86/sroasplit-1.ll'  target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"  target triple = "x86_64-apple-macosx10.9.0" @@ -57,11 +62,10 @@ attributes #2 = { nounwind }  !llvm.module.flags = !{!22, !23}  !llvm.ident = !{!24} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "sroasplit-1.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "sroasplit-1.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !9} diff --git a/test/DebugInfo/X86/pieces-3.ll b/test/DebugInfo/X86/pieces-3.ll index 7a93e393b25f..d6bea3f365c0 100644 --- a/test/DebugInfo/X86/pieces-3.ll +++ b/test/DebugInfo/X86/pieces-3.ll @@ -16,19 +16,27 @@  ;    }  ;  ; CHECK: DW_TAG_formal_parameter [3] -; CHECK-NEXT:   DW_AT_location [DW_FORM_data4]        ([[LOC:.*]]) +; CHECK-NEXT:   DW_AT_location [DW_FORM_data4]        ([[LOC1:.*]])  ; CHECK-NEXT:   DW_AT_name {{.*}}"outer"  ; CHECK: DW_TAG_variable -;                                                 rsi, piece 0x00000004 -; CHECK-NEXT:   DW_AT_location [DW_FORM_block1]       {{.*}} 54 93 04 +; CHECK-NEXT:   DW_AT_location [DW_FORM_data4]        ([[LOC2:.*]])  ; CHECK-NEXT:   "i1"  ;  ; CHECK: .debug_loc -; CHECK: [[LOC]]: -; CHECK: Beginning address offset: 0x0000000000000000 -; CHECK:    Ending address offset: 0x0000000000000008 -; rdi, piece 0x00000008, piece 0x00000004, rsi, piece 0x00000004 -; CHECK: Location description: 55 93 08 93 04 54 93 04  +; CHECK: [[LOC1]]: Beginning address offset: 0x0000000000000000 +; CHECK-NEXT:         Ending address offset: 0x0000000000000004 +;             rdi, piece 0x00000008, piece 0x00000004, rsi, piece 0x00000004 +; CHECK-NEXT: Location description: 55 93 08 93 04 54 93 04 +; This location is split into two ranges with identical locations +; because it comes from a DBG_VALUE %RSI followed by a DBG_VALUE %ESI. +; CHECK:           Beginning address offset: 0x0000000000000004 +; CHECK-NEXT:         Ending address offset: 0x0000000000000008 +; CHECK-NEXT: Location description: 55 93 08 93 04 54 93 04 +; CHECK: [[LOC2]]: Beginning address offset: 0x0000000000000004 +; CHECK-NEXT:         Ending address offset: 0x0000000000000008 +;                                     rsi, piece 0x00000004 +; CHECK-NEXT:   Location description: 54 93 04 +  ;  ; ModuleID = '/Volumes/Data/llvm/test/DebugInfo/X86/sroasplit-2.ll'  target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" @@ -67,11 +75,10 @@ attributes #2 = { nounwind }  !llvm.module.flags = !{!21, !22}  !llvm.ident = !{!23} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "sroasplit-2.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "sroasplit-2.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !9} diff --git a/test/DebugInfo/X86/pointer-type-size.ll b/test/DebugInfo/X86/pointer-type-size.ll index cc43c7604c08..e26ea2ea648b 100644 --- a/test/DebugInfo/X86/pointer-type-size.ll +++ b/test/DebugInfo/X86/pointer-type-size.ll @@ -11,7 +11,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!14} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 147882)", isOptimized: false, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 147882)", isOptimized: false, emissionKind: FullDebug, file: !13, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "crass", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.crass* @crass) diff --git a/test/DebugInfo/X86/pr11300.ll b/test/DebugInfo/X86/pr11300.ll index c6124687b2c4..c1536a458e3e 100644 --- a/test/DebugInfo/X86/pr11300.ll +++ b/test/DebugInfo/X86/pr11300.ll @@ -38,10 +38,9 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!33} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 0, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: FullDebug, file: !32, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5, !20} -!5 = distinct !DISubprogram(name: "zed", linkageName: "_Z3zedP3foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !6, scope: !6, type: !7) +!5 = distinct !DISubprogram(name: "zed", linkageName: "_Z3zedP3foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 4, file: !6, scope: !6, type: !7)  !6 = !DIFile(filename: "/home/espindola/llvm/test.cc", directory: "/home/espindola/tmpfs/build")  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} @@ -52,7 +51,7 @@ entry:  !13 = !DISubroutineType(types: !14)  !14 = !{null, !15}  !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !10) -!20 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !6, scope: null, type: !13, declaration: !12) +!20 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !6, scope: null, type: !13, declaration: !12)  !23 = !DILocalVariable(name: "x", line: 4, arg: 1, scope: !5, file: !6, type: !9)  !24 = !DILocation(line: 4, column: 15, scope: !5)  !25 = !DILocation(line: 4, column: 20, scope: !26) diff --git a/test/DebugInfo/X86/pr12831.ll b/test/DebugInfo/X86/pr12831.ll index 89f599838977..99decb6d5e94 100644 --- a/test/DebugInfo/X86/pr12831.ll +++ b/test/DebugInfo/X86/pr12831.ll @@ -78,10 +78,9 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!162} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 ", isOptimized: false, emissionKind: 0, file: !161, enums: !1, retainedTypes: !1, subprograms: !3, globals: !128) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 ", isOptimized: false, emissionKind: FullDebug, file: !161, enums: !1, retainedTypes: !1, globals: !128)  !1 = !{} -!3 = !{!5, !106, !107, !126, !127} -!5 = distinct !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !6, scope: null, type: !7, declaration: !103, variables: !1) +!5 = distinct !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 19, file: !6, scope: null, type: !7, declaration: !103, variables: !1)  !6 = !DIFile(filename: "BPLFunctionWriter2.ii", directory: "/home/peter/crashdelta")  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} @@ -156,8 +155,8 @@ entry:  !99 = !DISubroutineType(types: !100)  !100 = !{null}  !103 = !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 17, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, scopeLine: 17, file: !6, scope: !10, type: !7) -!106 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: null, type: !59, templateParams: !82, declaration: !58, variables: !1) -!107 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !108, templateParams: !111, declaration: !113, variables: !1) +!106 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !6, scope: null, type: !59, templateParams: !82, declaration: !58, variables: !1) +!107 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !108, templateParams: !111, declaration: !113, variables: !1)  !108 = !DISubroutineType(types: !109)  !109 = !{null, !110}  !110 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !61) @@ -172,8 +171,8 @@ entry:  !119 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !26)  !120 = !{!121}  !121 = !DITemplateTypeParameter(name: "_Tp", type: !26) -!126 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: null, type: !23, templateParams: !47, declaration: !22, variables: !1) -!127 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !117, templateParams: !120, declaration: !116, variables: !1) +!126 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !6, scope: null, type: !23, templateParams: !47, declaration: !22, variables: !1) +!127 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !117, templateParams: !120, declaration: !116, variables: !1)  !128 = !{!130}  !130 = !DIGlobalVariable(name: "__stored_locally", linkageName: "__stored_locally", line: 2, isLocal: true, isDefinition: true, scope: !114, file: !6, type: !131, variable: i1 1)  !131 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !132) diff --git a/test/DebugInfo/X86/pr13303.ll b/test/DebugInfo/X86/pr13303.ll index a369b4259583..4d2ebf334a66 100644 --- a/test/DebugInfo/X86/pr13303.ll +++ b/test/DebugInfo/X86/pr13303.ll @@ -15,10 +15,9 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!13} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 160143)", isOptimized: false, emissionKind: 0, file: !12, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 160143)", isOptimized: false, emissionKind: FullDebug, file: !12, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !12, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 1, file: !12, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "PR13303.c", directory: "/home/probinson")  !7 = !DISubroutineType(types: !8)  !8 = !{!9} diff --git a/test/DebugInfo/X86/pr19307.ll b/test/DebugInfo/X86/pr19307.ll index 39a800704b19..ab37ae573456 100644 --- a/test/DebugInfo/X86/pr19307.ll +++ b/test/DebugInfo/X86/pr19307.ll @@ -14,7 +14,7 @@  ; Location of "range" string is spilled from %rdx to stack and is  ; addressed via %rbp.  ; CHECK: movq %rdx, {{[-0-9]+}}(%rbp) -; CHECK-NEXT: [[START_LABEL:.Ltmp[0-9]+]] +; CHECK-NEXT: [[START_LABEL:.Ltmp[0-9]+]]:  ; This location should be valid until the end of the function.  ; Verify that we have proper range in debug_loc section: @@ -84,7 +84,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !llvm.module.flags = !{!42, !43}  !llvm.ident = !{!44} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !2, imports: !21) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !21)  !1 = !DIFile(filename: "pr19307.cc", directory: "/llvm_cmake_gcc")  !2 = !{}  !3 = !{!4, !6, !8} @@ -96,14 +96,13 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !9 = !DIFile(filename: "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.tcc", directory: "/llvm_cmake_gcc")  !10 = !DINamespace(name: "std", line: 153, file: !11, scope: null)  !11 = !DIFile(filename: "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu/bits/c++config.h", directory: "/llvm_cmake_gcc") -!12 = !{!13} -!13 = distinct !DISubprogram(name: "parse_range", linkageName: "_Z11parse_rangeRyS_Ss", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !14, type: !15, variables: !2) +!13 = distinct !DISubprogram(name: "parse_range", linkageName: "_Z11parse_rangeRyS_Ss", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 4, file: !1, scope: !14, type: !15, variables: !2)  !14 = !DIFile(filename: "pr19307.cc", directory: "/llvm_cmake_gcc")  !15 = !DISubroutineType(types: !16)  !16 = !{null, !17, !17, !19}  !17 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !18)  !18 = !DIBasicType(tag: DW_TAG_base_type, name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) -!19 = !DIDerivedType(tag: DW_TAG_typedef, name: "string", line: 65, file: !20, scope: !10, baseType: !"_ZTSSs") +!19 = !DIDerivedType(tag: DW_TAG_typedef, name: "string", line: 65, file: !20, scope: !10, baseType: !8)  !20 = !DIFile(filename: "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stringfwd.h", directory: "/llvm_cmake_gcc")  !21 = !{!22, !26, !29, !33, !38, !41}  !22 = !DIImportedEntity(tag: DW_TAG_imported_module, line: 57, scope: !23, entity: !25) @@ -112,7 +111,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !25 = !DINamespace(name: "__debug", line: 49, file: !24, scope: !10)  !26 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 66, scope: !10, entity: !27)  !27 = !DIDerivedType(tag: DW_TAG_typedef, name: "mbstate_t", line: 106, file: !5, baseType: !28) -!28 = !DIDerivedType(tag: DW_TAG_typedef, name: "__mbstate_t", line: 95, file: !5, baseType: !"_ZTS11__mbstate_t") +!28 = !DIDerivedType(tag: DW_TAG_typedef, name: "__mbstate_t", line: 95, file: !5, baseType: !4)  !29 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 141, scope: !10, entity: !30)  !30 = !DIDerivedType(tag: DW_TAG_typedef, name: "wint_t", line: 141, file: !31, baseType: !32)  !31 = !DIFile(filename: "/llvm_cmake_gcc/bin/../lib/clang/3.5.0/include/stddef.h", directory: "/llvm_cmake_gcc") @@ -125,7 +124,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n  !38 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 43, scope: !34, entity: !39)  !39 = !DIDerivedType(tag: DW_TAG_typedef, name: "ptrdiff_t", line: 156, file: !11, scope: !10, baseType: !40)  !40 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) -!41 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 55, scope: !10, entity: !"_ZTS5lconv") +!41 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 55, scope: !10, entity: !6)  !42 = !{i32 2, !"Dwarf Version", i32 4}  !43 = !{i32 2, !"Debug Info Version", i32 3}  !44 = !{!"clang version 3.5.0 (209308)"} diff --git a/test/DebugInfo/X86/pr28270.ll b/test/DebugInfo/X86/pr28270.ll new file mode 100644 index 000000000000..56e036787aa5 --- /dev/null +++ b/test/DebugInfo/X86/pr28270.ll @@ -0,0 +1,151 @@ +; RUN: llc < %s + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +%class.A = type { i8 } +%class.B = type { i8 } + +@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 +@.str.1 = private unnamed_addr constant [6 x i8] c"false\00", align 1 + +define void @_Z11PrintVectorv() local_unnamed_addr #0 !dbg !6 { +entry: +  %agg.tmp.i.i = alloca %class.A, align 1 +  %text.i = alloca %class.A, align 1 +  %v = alloca %class.B, align 1 +  %0 = getelementptr inbounds %class.B, %class.B* %v, i64 0, i32 0, !dbg !40 +  call void @llvm.lifetime.start(i64 1, i8* %0) #4, !dbg !40 +  %1 = getelementptr inbounds %class.A, %class.A* %text.i, i64 0, i32 0, !dbg !41 +  %2 = getelementptr inbounds %class.A, %class.A* %agg.tmp.i.i, i64 0, i32 0, !dbg !59 +  br label %for.cond, !dbg !65 + +for.cond:                                         ; preds = %for.cond, %entry +  call void @llvm.dbg.value(metadata %class.B* %v, i64 0, metadata !29, metadata !66), !dbg !67 +  %call = call double @_ZN1BixEj(%class.B* nonnull %v, i32 undef), !dbg !68 +  call void @llvm.dbg.value(metadata double %call, i64 0, metadata !49, metadata !69), !dbg !70 +  call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !52, metadata !69), !dbg !71 +  call void @llvm.dbg.value(metadata %class.A* undef, i64 0, metadata !54, metadata !69), !dbg !72 +  call void @llvm.lifetime.start(i64 1, i8* %1) #4, !dbg !41 +  %tobool.i = fcmp une double %call, 0.000000e+00, !dbg !73 +  %cond.i = select i1 %tobool.i, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), !dbg !73 +  call void @llvm.dbg.value(metadata %class.A* %text.i, i64 0, metadata !55, metadata !66), !dbg !74 +  call void @llvm.lifetime.start(i64 1, i8* %2), !dbg !59 +  call void @llvm.dbg.value(metadata %class.A* %text.i, i64 0, metadata !62, metadata !69), !dbg !59 +  call void @llvm.dbg.value(metadata i8* %cond.i, i64 0, metadata !63, metadata !69), !dbg !75 +  call void @_ZN1AC1EPKc(%class.A* nonnull %agg.tmp.i.i, i8* %cond.i), !dbg !76 +  call void @_ZN1A5m_fn1ES_(%class.A* nonnull %text.i), !dbg !77 +  call void @llvm.lifetime.end(i64 1, i8* %2), !dbg !79 +  call void @llvm.lifetime.end(i64 1, i8* %1) #4, !dbg !80 +  br label %for.cond, !dbg !81, !llvm.loop !82 +} + +; Function Attrs: argmemonly nounwind +declare void @llvm.lifetime.start(i64, i8* nocapture) #1 + +declare double @_ZN1BixEj(%class.B*, i32) local_unnamed_addr #2 + +; Function Attrs: argmemonly nounwind +declare void @llvm.lifetime.end(i64, i8* nocapture) #1 + +declare void @_ZN1A5m_fn1ES_(%class.A*) local_unnamed_addr #2 + +declare void @_ZN1AC1EPKc(%class.A*, i8*) unnamed_addr #2 + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3 + +attributes #0 = { noreturn uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { argmemonly nounwind } +attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #3 = { nounwind readnone } +attributes #4 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} +!llvm.ident = !{!5} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 273450) (llvm/trunk 273521)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "/usr/local/google/home/niravd/bug_28270.c", directory: "/usr/local/google/home/niravd/build/llvm/build_debug") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{!"clang version 3.9.0 (trunk 273450) (llvm/trunk 273521)"} +!6 = distinct !DISubprogram(name: "PrintVector", linkageName: "_Z11PrintVectorv", scope: !1, file: !1, line: 18, type: !7, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !9) +!7 = !DISubroutineType(types: !8) +!8 = !{null} +!9 = !{!10, !25, !27, !28, !29, !38} +!10 = !DILocalVariable(name: "_text", scope: !6, file: !1, line: 19, type: !11) +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64) +!12 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !13, identifier: "_ZTS1A") +!13 = !{!14, !21, !22} +!14 = !DISubprogram(name: "A", scope: !12, file: !1, line: 2, type: !15, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true) +!15 = !DISubroutineType(types: !16) +!16 = !{null, !17, !18} +!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) +!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64, align: 64) +!19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !20) +!20 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!21 = !DISubprogram(name: "operator+=", linkageName: "_ZN1ApLEPKc", scope: !12, file: !1, line: 5, type: !15, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true) +!22 = !DISubprogram(name: "m_fn1", linkageName: "_ZN1A5m_fn1ES_", scope: !12, file: !1, line: 6, type: !23, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true) +!23 = !DISubroutineType(types: !24) +!24 = !{null, !17, !12} +!25 = !DILocalVariable(name: "opts", scope: !6, file: !1, line: 20, type: !26) +!26 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!27 = !DILocalVariable(name: "indent", scope: !6, file: !1, line: 20, type: !26) +!28 = !DILocalVariable(name: "type", scope: !6, file: !1, line: 20, type: !26) +!29 = !DILocalVariable(name: "v", scope: !6, file: !1, line: 21, type: !30) +!30 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !1, line: 9, size: 8, align: 8, elements: !31, identifier: "_ZTS1B") +!31 = !{!32} +!32 = !DISubprogram(name: "operator[]", linkageName: "_ZN1BixEj", scope: !30, file: !1, line: 11, type: !33, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true) +!33 = !DISubroutineType(types: !34) +!34 = !{!35, !36, !37} +!35 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) +!36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !30, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) +!37 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) +!38 = !DILocalVariable(name: "i", scope: !39, file: !1, line: 22, type: !26) +!39 = distinct !DILexicalBlock(scope: !6, file: !1, line: 22, column: 3) +!40 = !DILocation(line: 21, column: 3, scope: !6) +!41 = !DILocation(line: 14, column: 3, scope: !42, inlinedAt: !56) +!42 = distinct !DISubprogram(name: "Print<double>", linkageName: "_Z5PrintIdEvT_iiPiiP1A", scope: !1, file: !1, line: 13, type: !43, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !46, variables: !48) +!43 = !DISubroutineType(types: !44) +!44 = !{null, !35, !26, !26, !45, !26, !11} +!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !26, size: 64, align: 64) +!46 = !{!47} +!47 = !DITemplateTypeParameter(name: "T", type: !35) +!48 = !{!49, !50, !51, !52, !53, !54, !55} +!49 = !DILocalVariable(name: "p1", arg: 1, scope: !42, file: !1, line: 13, type: !35) +!50 = !DILocalVariable(arg: 2, scope: !42, file: !1, line: 13, type: !26) +!51 = !DILocalVariable(arg: 3, scope: !42, file: !1, line: 13, type: !26) +!52 = !DILocalVariable(arg: 4, scope: !42, file: !1, line: 13, type: !45) +!53 = !DILocalVariable(arg: 5, scope: !42, file: !1, line: 13, type: !26) +!54 = !DILocalVariable(name: "p6", arg: 6, scope: !42, file: !1, line: 13, type: !11) +!55 = !DILocalVariable(name: "text", scope: !42, file: !1, line: 14, type: !12) +!56 = distinct !DILocation(line: 23, column: 5, scope: !57) +!57 = !DILexicalBlockFile(scope: !58, file: !1, discriminator: 1) +!58 = distinct !DILexicalBlock(scope: !39, file: !1, line: 22, column: 3) +!59 = !DILocation(line: 0, scope: !60, inlinedAt: !64) +!60 = distinct !DISubprogram(name: "operator+=", linkageName: "_ZN1ApLEPKc", scope: !12, file: !1, line: 5, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !21, variables: !61) +!61 = !{!62, !63} +!62 = !DILocalVariable(name: "this", arg: 1, scope: !60, type: !11, flags: DIFlagArtificial | DIFlagObjectPointer) +!63 = !DILocalVariable(name: "p1", arg: 2, scope: !60, file: !1, line: 5, type: !18) +!64 = distinct !DILocation(line: 15, column: 8, scope: !42, inlinedAt: !56) +!65 = !DILocation(line: 22, column: 8, scope: !39) +!66 = !DIExpression(DW_OP_deref) +!67 = !DILocation(line: 21, column: 5, scope: !6) +!68 = !DILocation(line: 23, column: 11, scope: !58) +!69 = !DIExpression() +!70 = !DILocation(line: 13, column: 36, scope: !42, inlinedAt: !56) +!71 = !DILocation(line: 13, column: 55, scope: !42, inlinedAt: !56) +!72 = !DILocation(line: 13, column: 65, scope: !42, inlinedAt: !56) +!73 = !DILocation(line: 15, column: 11, scope: !42, inlinedAt: !56) +!74 = !DILocation(line: 14, column: 5, scope: !42, inlinedAt: !56) +!75 = !DILocation(line: 5, column: 31, scope: !60, inlinedAt: !64) +!76 = !DILocation(line: 5, column: 43, scope: !60, inlinedAt: !64) +!77 = !DILocation(line: 5, column: 37, scope: !78, inlinedAt: !64) +!78 = !DILexicalBlockFile(scope: !60, file: !1, discriminator: 1) +!79 = !DILocation(line: 5, column: 48, scope: !60, inlinedAt: !64) +!80 = !DILocation(line: 16, column: 1, scope: !42, inlinedAt: !56) +!81 = !DILocation(line: 22, column: 3, scope: !57) +!82 = distinct !{!82, !83} +!83 = !DILocation(line: 22, column: 3, scope: !6) diff --git a/test/DebugInfo/X86/processes-relocations.ll b/test/DebugInfo/X86/processes-relocations.ll index e138eaaae6d8..e8d365ea3974 100644 --- a/test/DebugInfo/X86/processes-relocations.ll +++ b/test/DebugInfo/X86/processes-relocations.ll @@ -13,7 +13,7 @@  !llvm.module.flags = !{!3, !4}  !llvm.ident = !{!5} -!0 = distinct !DICompileUnit(file: !1, language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, emissionKind: 1) +!0 = distinct !DICompileUnit(file: !1, language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, enums: !2, retainedTypes: !2, globals: !2, imports: !2, emissionKind: FullDebug)  !1 = !DIFile(filename: "empty.c", directory: "/a")  !2 = !{}  !3 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/prologue-stack.ll b/test/DebugInfo/X86/prologue-stack.ll index b3447d344e14..1faeaa1275f3 100644 --- a/test/DebugInfo/X86/prologue-stack.ll +++ b/test/DebugInfo/X86/prologue-stack.ll @@ -21,10 +21,9 @@ declare i32 @callme(i32)  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!14} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 164980) (llvm/trunk 164979)", isOptimized: false, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 164980) (llvm/trunk 164979)", isOptimized: false, emissionKind: FullDebug, file: !13, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "isel_line_test2", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !13, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "isel_line_test2", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 4, file: !13, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "bar.c", directory: "/usr/local/google/home/echristo/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{!9} diff --git a/test/DebugInfo/X86/ref_addr_relocation.ll b/test/DebugInfo/X86/ref_addr_relocation.ll index fd074a3a2d91..c6bf3cec67f6 100644 --- a/test/DebugInfo/X86/ref_addr_relocation.ll +++ b/test/DebugInfo/X86/ref_addr_relocation.ll @@ -58,7 +58,7 @@  !llvm.dbg.cu = !{!0, !9}  !llvm.module.flags = !{!14, !15} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !6, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !6, imports: !2)  !1 = !DIFile(filename: "tu1.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")  !2 = !{}  !3 = !{!4} @@ -67,7 +67,7 @@  !6 = !{!7}  !7 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !8, type: !4, variable: %struct.foo* @f)  !8 = !DIFile(filename: "tu1.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr") -!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: 0, file: !10, enums: !2, retainedTypes: !3, subprograms: !2, globals: !11, imports: !2) +!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !2, retainedTypes: !3, globals: !11, imports: !2)  !10 = !DIFile(filename: "tu2.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")  !11 = !{!12}  !12 = !DIGlobalVariable(name: "g", line: 2, isLocal: false, isDefinition: true, scope: null, file: !13, type: !4, variable: %struct.foo* @g) diff --git a/test/DebugInfo/X86/reference-argument.ll b/test/DebugInfo/X86/reference-argument.ll index 9433b8785311..52e9290eaccd 100644 --- a/test/DebugInfo/X86/reference-argument.ll +++ b/test/DebugInfo/X86/reference-argument.ll @@ -1,8 +1,9 @@ -; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=all - | FileCheck %s  ; ModuleID = 'aggregate-indirect-arg.cpp'  ; extracted from debuginfo-tests/aggregate-indirect-arg.cpp  ; v should be a pointer. +; CHECK:  .debug_info contents:  ; CHECK:   DW_TAG_subprogram  ; CHECK:     DW_AT_specification {{.*}} "_ZN1A3fooE4SVal"  ; CHECK-NOT: DW_TAG_subprogram @@ -10,9 +11,11 @@  ; CHECK:       DW_AT_name {{.*}} "this"  ; CHECK-NOT:   DW_TAG_subprogram  ; CHECK:     DW_TAG_formal_parameter -;                                                    rsi+0 -; CHECK-NEXT:  DW_AT_location [DW_FORM_block1]      (<0x02> 74 00{{ *}}) +; CHECK-NEXT:  DW_AT_location [DW_FORM_data4]	(0x00000000)  ; CHECK-NEXT:  DW_AT_name {{.*}} "v" +; CHECK: .debug_loc contents: +;                                rsi+0 +; CHECK:   Location description: 74 00  target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"  target triple = "x86_64-apple-macosx10.9.0" @@ -41,11 +44,10 @@ declare void @_ZN4SValD2Ev(%class.SVal* %this)  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!47, !68} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "aggregate-indirect-arg.cpp", directory: "")  !2 = !{} -!3 = !{!4, !29, !33, !34, !35} -!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barR4SVal", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barR4SVal", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "aggregate-indirect-arg.cpp", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8} @@ -67,13 +69,13 @@ declare void @_ZN4SValD2Ev(%class.SVal* %this)  !25 = !{null, !19, !26}  !26 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !27)  !27 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9) -!29 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !1, scope: !5, type: !30, variables: !2) +!29 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 25, file: !1, scope: !5, type: !30, variables: !2)  !30 = !DISubroutineType(types: !31)  !31 = !{!32}  !32 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!33 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD1Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2) -!34 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD2Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2) -!35 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1A3fooE4SVal", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 22, file: !1, scope: null, type: !36, declaration: !41, variables: !2) +!33 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD1Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2) +!34 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD2Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2) +!35 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1A3fooE4SVal", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 22, file: !1, scope: null, type: !36, declaration: !41, variables: !2)  !36 = !DISubroutineType(types: !37)  !37 = !{null, !38, !9}  !38 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !39) diff --git a/test/DebugInfo/X86/rvalue-ref.ll b/test/DebugInfo/X86/rvalue-ref.ll index c72a3aa2c04d..91686e56ad21 100644 --- a/test/DebugInfo/X86/rvalue-ref.ll +++ b/test/DebugInfo/X86/rvalue-ref.ll @@ -23,14 +23,13 @@ declare i32 @printf(i8*, ...)  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!17} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157054) (llvm/trunk 157060)", isOptimized: false, emissionKind: 0, file: !16, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157054) (llvm/trunk 157060)", isOptimized: false, emissionKind: FullDebug, file: !16, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooOi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !16, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooOi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !16, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{null, !9} -!9 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !10) +!9 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, size: 64, align: 64, baseType: !10)  !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !11 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !5, file: !6, type: !9)  !12 = !DILocation(line: 4, column: 17, scope: !5) diff --git a/test/DebugInfo/X86/safestack-byval.ll b/test/DebugInfo/X86/safestack-byval.ll index f1f6b6c1d911..42e94698818c 100644 --- a/test/DebugInfo/X86/safestack-byval.ll +++ b/test/DebugInfo/X86/safestack-byval.ll @@ -1,7 +1,7 @@  ; Test dwarf codegen for DILocalVariable of a byval function argument that  ; points to neither an argument nor an alloca. This kind of IR is generated by  ; SafeStack for unsafe byval arguments. -; RUN: llc -mtriple=x86_64-unknown-unknown -stop-after expand-isel-pseudos %s -o /dev/null | FileCheck %s +; RUN: llc -mtriple=x86_64-unknown-unknown -stop-after expand-isel-pseudos %s -o - | FileCheck %s  ; This was built by compiling the following source with SafeStack and  ; simplifying the result a little. @@ -57,24 +57,23 @@ attributes #2 = { argmemonly nounwind }  !llvm.module.flags = !{!19, !20}  !llvm.ident = !{!21} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 254107) (llvm/trunk 254109)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 254107) (llvm/trunk 254109)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3)  !1 = !DIFile(filename: "../llvm/1.cc", directory: "/tmp/build")  !2 = !{}  !3 = !{!4}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 4, size: 3200, align: 32, elements: !5, identifier: "_ZTS1S")  !5 = !{!6} -!6 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !"_ZTS1S", file: !1, line: 5, baseType: !7, size: 3200, align: 32) +!6 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !4, file: !1, line: 5, baseType: !7, size: 3200, align: 32)  !7 = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 3200, align: 32, elements: !9)  !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !9 = !{!10}  !10 = !DISubrange(count: 100) -!11 = !{!12} -!12 = distinct !DISubprogram(name: "f", linkageName: "_Z1f1Sm", scope: !1, file: !1, line: 8, type: !13, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, variables: !16) +!12 = distinct !DISubprogram(name: "f", linkageName: "_Z1f1Sm", scope: !1, file: !1, line: 8, type: !13, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !16)  !13 = !DISubroutineType(types: !14) -!14 = !{!8, !"_ZTS1S", !15} +!14 = !{!8, !4, !15}  !15 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)  !16 = !{!17, !18} -!17 = !DILocalVariable(name: "zzz", arg: 1, scope: !12, file: !1, line: 8, type: !"_ZTS1S") +!17 = !DILocalVariable(name: "zzz", arg: 1, scope: !12, file: !1, line: 8, type: !4)  !18 = !DILocalVariable(name: "len", arg: 2, scope: !12, file: !1, line: 8, type: !15)  !19 = !{i32 2, !"Dwarf Version", i32 4}  !20 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/single-dbg_value.ll b/test/DebugInfo/X86/single-dbg_value.ll new file mode 100644 index 000000000000..0275c37d24e7 --- /dev/null +++ b/test/DebugInfo/X86/single-dbg_value.ll @@ -0,0 +1,70 @@ +; RUN: %llc_dwarf -stop-after=livedebugvalues -o - %s \ +; RUN:   | FileCheck %s --check-prefix=SANITY +; RUN: %llc_dwarf -march=x86-64 -o - %s -filetype=obj \ +; RUN:   | llvm-dwarfdump -debug-dump=all - | FileCheck %s +; +; CHECK: .debug_info contents: +; CHECK: DW_TAG_variable +; CHECK-NEXT:   DW_AT_location [DW_FORM_data4] +; CHECK-NEXT:   DW_AT_name{{.*}}"a" +; CHECK: .debug_loc contents: +;                               rax, piece 0x00000004 +; CHECK:  Location description: 50 93 04 +; SANITY: DBG_VALUE +; SANITY-NOT: DBG_VALUE +; ModuleID = 'test.ll' +; Compiled with -O: +;   void h(int); +;   int g(); +;   void f() { +;     h(0); +;     int a = g(); +;     h(a); +;   } +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx" + +; Function Attrs: nounwind ssp uwtable +define void @f() #0 !dbg !4 { +entry: +  tail call void @h(i32 0) #2, !dbg !14 +  %call = tail call i32 (...) @g() #2, !dbg !15 +  tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !8, metadata !16), !dbg !17 +  tail call void @h(i32 %call) #2, !dbg !18 +  ret void, !dbg !19 +} + +declare void @h(i32) + +declare i32 @g(...) + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 + +attributes #0 = { nounwind ssp uwtable "no-frame-pointer-elim"="true" } +attributes #1 = { nounwind readnone } +attributes #2 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!10, !11, !12} +!llvm.ident = !{!13} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm") +!2 = !{} +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !7) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{!8} +!8 = !DILocalVariable(name: "a", scope: !4, file: !1, line: 5, type: !9) +!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !{i32 2, !"Dwarf Version", i32 2} +!11 = !{i32 2, !"Debug Info Version", i32 3} +!12 = !{i32 1, !"PIC Level", i32 2} +!13 = !{!"clang version 3.9.0 "} +!14 = !DILocation(line: 4, column: 3, scope: !4) +!15 = !DILocation(line: 5, column: 11, scope: !4) +!16 = !DIExpression() +!17 = !DILocation(line: 5, column: 7, scope: !4) +!18 = !DILocation(line: 6, column: 3, scope: !4) +!19 = !DILocation(line: 7, column: 1, scope: !4) diff --git a/test/DebugInfo/X86/sret.ll b/test/DebugInfo/X86/sret.ll index 45af28217419..84d671934889 100644 --- a/test/DebugInfo/X86/sret.ll +++ b/test/DebugInfo/X86/sret.ll @@ -263,11 +263,11 @@ attributes #7 = { builtin nounwind }  !llvm.module.flags = !{!64, !65}  !llvm.ident = !{!66} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)", isOptimized: false, splitDebugFilename: "sret.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !48, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)", isOptimized: false, splitDebugFilename: "sret.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "sret.cpp", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{}  !3 = !{!4, !37} -!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 128, align: 64, file: !1, elements: !5, vtableHolder: !"_ZTS1A", identifier: "_ZTS1A") +!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 128, align: 64, file: !1, elements: !5, vtableHolder: !4, identifier: "_ZTS1A")  !5 = !{!6, !13, !14, !19, !25, !29, !33}  !6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !1, scope: !7, baseType: !8)  !7 = !DIFile(filename: "sret.cpp", directory: "/usr/local/google/home/echristo/tmp") @@ -276,55 +276,54 @@ attributes #7 = { builtin nounwind }  !10 = !DISubroutineType(types: !11)  !11 = !{!12}  !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!13 = !DIDerivedType(tag: DW_TAG_member, name: "m_int", line: 13, size: 32, align: 32, offset: 64, flags: DIFlagProtected, file: !1, scope: !"_ZTS1A", baseType: !12) -!14 = !DISubprogram(name: "A", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !"_ZTS1A", type: !15) +!13 = !DIDerivedType(tag: DW_TAG_member, name: "m_int", line: 13, size: 32, align: 32, offset: 64, flags: DIFlagProtected, file: !1, scope: !4, baseType: !12) +!14 = !DISubprogram(name: "A", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !4, type: !15)  !15 = !DISubroutineType(types: !16)  !16 = !{null, !17, !12} -!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") -!19 = !DISubprogram(name: "A", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS1A", type: !20) +!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) +!19 = !DISubprogram(name: "A", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !4, type: !20)  !20 = !DISubroutineType(types: !21)  !21 = !{null, !17, !22} -!22 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !23) -!23 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS1A") -!25 = !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1A", type: !26) +!22 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, baseType: !23) +!23 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4) +!25 = !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !4, type: !26)  !26 = !DISubroutineType(types: !27)  !27 = !{!22, !17, !22} -!29 = !DISubprogram(name: "~A", line: 8, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, containingType: !"_ZTS1A") +!29 = !DISubprogram(name: "~A", line: 8, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !4, type: !30, containingType: !4)  !30 = !DISubroutineType(types: !31)  !31 = !{null, !17} -!33 = !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 10, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !"_ZTS1A", type: !34) +!33 = !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 10, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !4, type: !34)  !34 = !DISubroutineType(types: !35)  !35 = !{!12, !17}  !37 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 38, size: 8, align: 8, file: !1, elements: !38, identifier: "_ZTS1B")  !38 = !{!39, !44} -!39 = !DISubprogram(name: "B", line: 41, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 41, file: !1, scope: !"_ZTS1B", type: !40) +!39 = !DISubprogram(name: "B", line: 41, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 41, file: !1, scope: !37, type: !40)  !40 = !DISubroutineType(types: !41)  !41 = !{null, !42} -!42 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B") -!44 = !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 43, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 43, file: !1, scope: !"_ZTS1B", type: !45) +!42 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !37) +!44 = !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 43, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 43, file: !1, scope: !37, type: !45)  !45 = !DISubroutineType(types: !46)  !46 = !{!4, !42} -!48 = !{!49, !50, !51, !52, !53, !54, !61, !62, !63} -!49 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !1, scope: !"_ZTS1A", type: !15, declaration: !14, variables: !2) -!50 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2ERKS_", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !1, scope: !"_ZTS1A", type: !20, declaration: !19, variables: !2) -!51 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 28, file: !1, scope: !"_ZTS1A", type: !26, declaration: !25, variables: !2) -!52 = distinct !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 33, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 34, file: !1, scope: !"_ZTS1A", type: !34, declaration: !33, variables: !2) -!53 = distinct !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 47, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 48, file: !1, scope: !"_ZTS1B", type: !45, declaration: !44, variables: !2) -!54 = distinct !DISubprogram(name: "main", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 54, file: !1, scope: !7, type: !55, variables: !2) +!49 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 18, file: !1, scope: !4, type: !15, declaration: !14, variables: !2) +!50 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2ERKS_", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 23, file: !1, scope: !4, type: !20, declaration: !19, variables: !2) +!51 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 28, file: !1, scope: !4, type: !26, declaration: !25, variables: !2) +!52 = distinct !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 33, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 34, file: !1, scope: !4, type: !34, declaration: !33, variables: !2) +!53 = distinct !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 47, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 48, file: !1, scope: !37, type: !45, declaration: !44, variables: !2) +!54 = distinct !DISubprogram(name: "main", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 54, file: !1, scope: !7, type: !55, variables: !2)  !55 = !DISubroutineType(types: !56)  !56 = !{!12, !12, !57}  !57 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !58)  !58 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !59)  !59 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !60)  !60 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!61 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD0Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, declaration: !29, variables: !2) -!62 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 41, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 41, file: !1, scope: !"_ZTS1B", type: !40, declaration: !39, variables: !2) -!63 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, declaration: !29, variables: !2) +!61 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD0Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !1, scope: !4, type: !30, declaration: !29, variables: !2) +!62 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 41, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 41, file: !1, scope: !37, type: !40, declaration: !39, variables: !2) +!63 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !1, scope: !4, type: !30, declaration: !29, variables: !2)  !64 = !{i32 2, !"Dwarf Version", i32 4}  !65 = !{i32 1, !"Debug Info Version", i32 3}  !66 = !{!"clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)"}  !67 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !49, type: !68) -!68 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!68 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)  !69 = !DILocation(line: 0, scope: !49)  !70 = !DILocalVariable(name: "i", line: 16, arg: 2, scope: !49, file: !7, type: !12)  !71 = !DILocation(line: 16, scope: !49) @@ -346,7 +345,7 @@ attributes #7 = { builtin nounwind }  !87 = !DILocation(line: 0, scope: !52)  !88 = !DILocation(line: 35, scope: !52)  !89 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !53, type: !90) -!90 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B") +!90 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !37)  !91 = !DILocation(line: 0, scope: !53)  !92 = !DILocation(line: 49, scope: !53)  !93 = !DILocalVariable(name: "a", line: 49, scope: !53, file: !7, type: !4) diff --git a/test/DebugInfo/X86/sroasplit-1.ll b/test/DebugInfo/X86/sroasplit-1.ll index 11895a7f083e..1c73e7f10ace 100644 --- a/test/DebugInfo/X86/sroasplit-1.ll +++ b/test/DebugInfo/X86/sroasplit-1.ll @@ -65,11 +65,10 @@ attributes #2 = { nounwind }  !llvm.module.flags = !{!22, !23}  !llvm.ident = !{!24} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !3, globals: !{}, imports: !{}) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !{}, retainedTypes: !{}, globals: !{}, imports: !{})  !1 = !DIFile(filename: "sroasplit-1.c", directory: "")  !2 = !DIExpression() -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !{}) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !{})  !5 = !DIFile(filename: "sroasplit-1.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !9} diff --git a/test/DebugInfo/X86/sroasplit-2.ll b/test/DebugInfo/X86/sroasplit-2.ll index bea1b26df285..80a05d95dd04 100644 --- a/test/DebugInfo/X86/sroasplit-2.ll +++ b/test/DebugInfo/X86/sroasplit-2.ll @@ -71,11 +71,10 @@ attributes #2 = { nounwind }  !llvm.module.flags = !{!21, !22}  !llvm.ident = !{!23} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !3, globals: !{}, imports: !{}) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !{}, retainedTypes: !{}, globals: !{}, imports: !{})  !1 = !DIFile(filename: "sroasplit-2.c", directory: "")  !2 = !DIExpression() -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !{}) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !{})  !5 = !DIFile(filename: "sroasplit-2.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !9} diff --git a/test/DebugInfo/X86/sroasplit-3.ll b/test/DebugInfo/X86/sroasplit-3.ll index 7a39beb137d8..197994fd3ad5 100644 --- a/test/DebugInfo/X86/sroasplit-3.ll +++ b/test/DebugInfo/X86/sroasplit-3.ll @@ -41,11 +41,10 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!12, !13, !14}  !llvm.ident = !{!15} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm/_build.ninja.debug")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm/_build.ninja.debug")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !9} diff --git a/test/DebugInfo/X86/sroasplit-4.ll b/test/DebugInfo/X86/sroasplit-4.ll index 2abf6e1ec9b4..76cd7da02bc0 100644 --- a/test/DebugInfo/X86/sroasplit-4.ll +++ b/test/DebugInfo/X86/sroasplit-4.ll @@ -109,24 +109,23 @@ attributes #3 = { nounwind }  !llvm.module.flags = !{!21, !22}  !llvm.ident = !{!23} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)  !1 = !DIFile(filename: "<stdin>", directory: "")  !2 = !{}  !3 = !{!4, !10}  !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "p", line: 3, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS1p")  !5 = !DIFile(filename: "pr22393.cc", directory: "")  !6 = !{!7, !9} -!7 = !DIDerivedType(tag: DW_TAG_member, name: "s", line: 4, size: 64, align: 64, file: !5, scope: !"_ZTS1p", baseType: !8) +!7 = !DIDerivedType(tag: DW_TAG_member, name: "s", line: 4, size: 64, align: 64, file: !5, scope: !4, baseType: !8)  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) -!9 = !DIDerivedType(tag: DW_TAG_member, name: "t", line: 5, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS1p", baseType: !8) +!9 = !DIDerivedType(tag: DW_TAG_member, name: "t", line: 5, size: 64, align: 64, offset: 64, file: !5, scope: !4, baseType: !8)  !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "r", line: 8, size: 320, align: 64, file: !5, elements: !11, identifier: "_ZTS1r")  !11 = !{!12, !14, !15} -!12 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 9, size: 32, align: 32, file: !5, scope: !"_ZTS1r", baseType: !13) +!12 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 9, size: 32, align: 32, file: !5, scope: !10, baseType: !13)  !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!14 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 10, size: 128, align: 64, offset: 64, file: !5, scope: !"_ZTS1r", baseType: !"_ZTS1p") -!15 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 11, size: 128, align: 64, offset: 192, file: !5, scope: !"_ZTS1r", baseType: !"_ZTS1p") -!16 = !{!17} -!17 = distinct !DISubprogram(name: "test", linkageName: "_Z4testv", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !5, scope: !18, type: !19, variables: !2) +!14 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 10, size: 128, align: 64, offset: 64, file: !5, scope: !10, baseType: !4) +!15 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 11, size: 128, align: 64, offset: 192, file: !5, scope: !10, baseType: !4) +!17 = distinct !DISubprogram(name: "test", linkageName: "_Z4testv", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 18, file: !5, scope: !18, type: !19, variables: !2)  !18 = !DIFile(filename: "pr22393.cc", directory: "")  !19 = !DISubroutineType(types: !20)  !20 = !{!13} @@ -137,10 +136,10 @@ attributes #3 = { nounwind }  !25 = distinct !DILexicalBlock(line: 19, column: 0, file: !5, scope: !17)  !26 = !DILocation(line: 19, scope: !17)  !27 = !DILocation(line: 20, scope: !25) -!28 = !DILocalVariable(name: "y", line: 21, scope: !17, file: !18, type: !"_ZTS1p") +!28 = !DILocalVariable(name: "y", line: 21, scope: !17, file: !18, type: !4)  !29 = !DIExpression()  !30 = !DILocation(line: 21, scope: !17) -!31 = !DILocalVariable(name: "r", line: 22, scope: !17, file: !18, type: !"_ZTS1r") +!31 = !DILocalVariable(name: "r", line: 22, scope: !17, file: !18, type: !10)  !32 = !DILocation(line: 22, scope: !17)  !33 = !DILocation(line: 23, scope: !17)  !34 = !DILocation(line: 24, scope: !17) diff --git a/test/DebugInfo/X86/sroasplit-5.ll b/test/DebugInfo/X86/sroasplit-5.ll index 059cb19e92e2..71f72f206ca3 100644 --- a/test/DebugInfo/X86/sroasplit-5.ll +++ b/test/DebugInfo/X86/sroasplit-5.ll @@ -66,11 +66,10 @@ attributes #2 = { nounwind }  !llvm.module.flags = !{!13, !14}  !llvm.ident = !{!15} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "<stdin>", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "src_reg_for_float", line: 7, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, variables: !2) +!4 = distinct !DISubprogram(name: "src_reg_for_float", line: 7, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 7, file: !5, scope: !6, type: !7, variables: !2)  !5 = !DIFile(filename: "pr22495.c", directory: "")  !6 = !DIFile(filename: "pr22495.c", directory: "")  !7 = !DISubroutineType(types: !8) diff --git a/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll b/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll index a366853ad205..527f577134c0 100644 --- a/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll +++ b/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll @@ -81,17 +81,15 @@ entry:  !llvm.dbg.cu = !{!0, !10}  !llvm.module.flags = !{!25} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3", isOptimized: false, emissionKind: 1, file: !23, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3", isOptimized: false, emissionKind: FullDebug, file: !23, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "test", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !23, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "test", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !23, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "simple.c", directory: "/private/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{!9, !9}  !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 172862)", isOptimized: false, emissionKind: 1, file: !24, enums: !1, retainedTypes: !1, subprograms: !11, globals: !1, imports:  !1) -!11 = !{!13} -!13 = distinct !DISubprogram(name: "fn", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !24, scope: !14, type: !7, variables: !1) +!10 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 172862)", isOptimized: false, emissionKind: FullDebug, file: !24, enums: !1, retainedTypes: !1, globals: !1, imports:  !1) +!13 = distinct !DISubprogram(name: "fn", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !10, scopeLine: 1, file: !24, scope: !14, type: !7, variables: !1)  !14 = !DIFile(filename: "simple2.c", directory: "/private/tmp")  !15 = !DILocalVariable(name: "a", line: 2, arg: 1, scope: !5, file: !6, type: !9)  !16 = !DILocation(line: 2, scope: !5) diff --git a/test/DebugInfo/X86/stmt-list.ll b/test/DebugInfo/X86/stmt-list.ll index 393e1b50ea8a..f37c4aff91d5 100644 --- a/test/DebugInfo/X86/stmt-list.ll +++ b/test/DebugInfo/X86/stmt-list.ll @@ -14,9 +14,9 @@ entry:  !llvm.module.flags = !{!7}  !5 = !{!0} -!0 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 1, file: !6, scope: !1, type: !3)  !1 = !DIFile(filename: "test2.c", directory: "/home/espindola/llvm") -!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !6, enums: !{}, retainedTypes: !{}, subprograms: !5) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: FullDebug, file: !6, enums: !{}, retainedTypes: !{})  !3 = !DISubroutineType(types: !4)  !4 = !{null}  !6 = !DIFile(filename: "test2.c", directory: "/home/espindola/llvm") diff --git a/test/DebugInfo/X86/stringpool.ll b/test/DebugInfo/X86/stringpool.ll index 9030ae02e534..970871c16d63 100644 --- a/test/DebugInfo/X86/stringpool.ll +++ b/test/DebugInfo/X86/stringpool.ll @@ -6,7 +6,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!9} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143009)", isOptimized: true, emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143009)", isOptimized: true, emissionKind: FullDebug, file: !8, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "yyyy", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @yyyy) diff --git a/test/DebugInfo/X86/struct-loc.ll b/test/DebugInfo/X86/struct-loc.ll index 2236cd087d54..b5da5332b369 100644 --- a/test/DebugInfo/X86/struct-loc.ll +++ b/test/DebugInfo/X86/struct-loc.ll @@ -14,7 +14,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!12} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, emissionKind: 0, file: !11, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, emissionKind: FullDebug, file: !11, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "f", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.foo* @f) diff --git a/test/DebugInfo/X86/subrange-type.ll b/test/DebugInfo/X86/subrange-type.ll index 7a81bac56d0d..cde894f765bd 100644 --- a/test/DebugInfo/X86/subrange-type.ll +++ b/test/DebugInfo/X86/subrange-type.ll @@ -21,10 +21,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!18} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171472) (llvm/trunk 171487)", isOptimized: false, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171472) (llvm/trunk 171487)", isOptimized: false, emissionKind: FullDebug, file: !17, enums: !1, retainedTypes: !1, globals: !1, imports:  !1)  !1 = !{} -!3 = !{!5} -!5 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !6, type: !7, variables: !1) +!5 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: !6, type: !7, variables: !1)  !6 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp")  !7 = !DISubroutineType(types: !8)  !8 = !{!9} diff --git a/test/DebugInfo/X86/subreg.ll b/test/DebugInfo/X86/subreg.ll index 3b95532ff52c..5e837edfd2bf 100644 --- a/test/DebugInfo/X86/subreg.ll +++ b/test/DebugInfo/X86/subreg.ll @@ -22,9 +22,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon  !9 = !{!1}  !0 = !DILocalVariable(name: "zzz", line: 3, arg: 1, scope: !1, file: !2, type: !6) -!1 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !10, scope: !2, type: !4) +!1 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, scopeLine: 3, file: !10, scope: !2, type: !4)  !2 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/tmpfs/build") -!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 1, file: !10, enums: !{}, retainedTypes: !{}, subprograms: !9, imports:  null) +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !{}, retainedTypes: !{}, imports:  null)  !4 = !DISubroutineType(types: !5)  !5 = !{null}  !6 = !DIBasicType(tag: DW_TAG_base_type, name: "short", size: 16, align: 16, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/subregisters.ll b/test/DebugInfo/X86/subregisters.ll index 9dcb09f0869d..d40be0d9e3c1 100644 --- a/test/DebugInfo/X86/subregisters.ll +++ b/test/DebugInfo/X86/subregisters.ll @@ -6,8 +6,13 @@  ;  ; rdar://problem/16015314  ; -; CHECK:  DW_AT_location [DW_FORM_block1]       (<0x03> 54 93 04 ) -; CHECK:  DW_AT_name [DW_FORM_strp]{{.*}} "a" +; CHECK:  .debug_info contents: +; CHECK:  DW_TAG_variable +; CHECK-NEXT:  DW_AT_location [DW_FORM_data4]	(0x00000000) +; CHECK-NEXT:  DW_AT_name [DW_FORM_strp]{{.*}} "a" +; CHECK: .debug_loc contents: +;                                    rsi, piece 0x00000004 +; CHECK:       Location description: 54 93 04   ;  ; struct bar {  ;   int a; @@ -78,11 +83,10 @@ attributes #4 = { nounwind }  !llvm.module.flags = !{!22, !23}  !llvm.ident = !{!24} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "subregisters.c", directory: "")  !2 = !{} -!3 = !{!4, !17} -!4 = distinct !DISubprogram(name: "doSomething", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !14) +!4 = distinct !DISubprogram(name: "doSomething", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !14)  !5 = !DIFile(filename: "subregisters.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8} @@ -95,7 +99,7 @@ attributes #4 = { nounwind }  !14 = !{!15, !16}  !15 = !DILocalVariable(name: "b", line: 10, arg: 1, scope: !4, file: !5, type: !8)  !16 = !DILocalVariable(name: "a", line: 12, scope: !4, file: !5, type: !12) -!17 = distinct !DISubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 17, file: !1, scope: !5, type: !18, variables: !20) +!17 = distinct !DISubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 17, file: !1, scope: !5, type: !18, variables: !20)  !18 = !DISubroutineType(types: !19)  !19 = !{!12}  !20 = !{!21} diff --git a/test/DebugInfo/X86/template.ll b/test/DebugInfo/X86/template.ll index d7ce08437ca6..337f2380cbfa 100644 --- a/test/DebugInfo/X86/template.ll +++ b/test/DebugInfo/X86/template.ll @@ -89,7 +89,7 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !llvm.module.flags = !{!33, !34}  !llvm.ident = !{!35} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224394) (llvm/trunk 224384)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !30, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224394) (llvm/trunk 224384)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !30, imports: !2)  !1 = !DIFile(filename: "template.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4, !8} @@ -97,13 +97,12 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !5 = !{!6}  !6 = !DITemplateTypeParameter(type: !7)  !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "nested", line: 2, size: 8, align: 8, file: !1, scope: !"_ZTS6y_implIiE", elements: !2, identifier: "_ZTSN6y_implIiE6nestedE") -!9 = !{!10, !14, !28} -!10 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 3, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !11, type: !12, variables: !2) +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "nested", line: 2, size: 8, align: 8, file: !1, scope: !4, elements: !2, identifier: "_ZTSN6y_implIiE6nestedE") +!10 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 3, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !11, type: !12, variables: !2)  !11 = !DIFile(filename: "template.cpp", directory: "/tmp/dbginfo")  !12 = !DISubroutineType(types: !13)  !13 = !{null} -!14 = distinct !DISubprogram(name: "func<3, &glbl, y_impl, nullptr, 1, 2>", linkageName: "_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !11, type: !15, templateParams: !17, variables: !2) +!14 = distinct !DISubprogram(name: "func<3, &glbl, y_impl, nullptr, 1, 2>", linkageName: "_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !11, type: !15, templateParams: !17, variables: !2)  !15 = !DISubroutineType(types: !16)  !16 = !{!7}  !17 = !{!18, !19, !21, !22, !24} @@ -117,11 +116,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !25 = !{!26, !27}  !26 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, type: !7, value: i32 1)  !27 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, type: !7, value: i32 2) -!28 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_template.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !11, type: !29, variables: !2) +!28 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_template.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, file: !1, scope: !11, type: !29, variables: !2)  !29 = !DISubroutineType(types: !2)  !30 = !{!31, !32}  !31 = !DIGlobalVariable(name: "glbl", line: 3, isLocal: false, isDefinition: true, scope: null, file: !11, type: !7, variable: i32* @glbl) -!32 = !DIGlobalVariable(name: "n", line: 4, isLocal: false, isDefinition: true, scope: null, file: !11, type: !"_ZTSN6y_implIiE6nestedE", variable: %"struct.y_impl<int>::nested"* @n) +!32 = !DIGlobalVariable(name: "n", line: 4, isLocal: false, isDefinition: true, scope: null, file: !11, type: !8, variable: %"struct.y_impl<int>::nested"* @n)  !33 = !{i32 2, !"Dwarf Version", i32 4}  !34 = !{i32 2, !"Debug Info Version", i32 3}  !35 = !{!"clang version 3.6.0 (trunk 224394) (llvm/trunk 224384)"} diff --git a/test/DebugInfo/X86/tls.ll b/test/DebugInfo/X86/tls.ll index 633096ba956e..5533c4588d38 100644 --- a/test/DebugInfo/X86/tls.ll +++ b/test/DebugInfo/X86/tls.ll @@ -111,11 +111,10 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe  !llvm.module.flags = !{!15, !16}  !llvm.ident = !{!17} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "-.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !12, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "-.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !12, imports: !2)  !1 = !DIFile(filename: "tls.cpp", directory: "/tmp/dbginfo")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "func<&glbl>", linkageName: "_Z4funcIXadL_Z4glblEEEiv", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, templateParams: !9, variables: !2) +!4 = distinct !DISubprogram(name: "func<&glbl>", linkageName: "_Z4funcIXadL_Z4glblEEEiv", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6, templateParams: !9, variables: !2)  !5 = !DIFile(filename: "tls.cpp", directory: "/tmp/dbginfo")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/type_units_with_addresses.ll b/test/DebugInfo/X86/type_units_with_addresses.ll index 10a41972d9f2..f75e32a601e7 100644 --- a/test/DebugInfo/X86/type_units_with_addresses.ll +++ b/test/DebugInfo/X86/type_units_with_addresses.ll @@ -112,7 +112,7 @@  !llvm.module.flags = !{!34, !35}  !llvm.ident = !{!36} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, splitDebugFilename: "tu.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !27, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, splitDebugFilename: "tu.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !27, imports: !2)  !1 = !DIFile(filename: "tu.cpp", directory: "/tmp/dbginfo")  !2 = !{}  !3 = !{!4, !9, !12, !13, !17, !18, !19, !23, !24} @@ -123,18 +123,18 @@  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)  !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S2", line: 11, size: 8, align: 8, file: !1, elements: !10, identifier: "_ZTS2S2")  !10 = !{!11} -!11 = !DIDerivedType(tag: DW_TAG_member, name: "s2_1", line: 12, size: 8, align: 8, file: !1, scope: !"_ZTS2S2", baseType: !"_ZTS4S2_1IXadL_Z1iEEE") +!11 = !DIDerivedType(tag: DW_TAG_member, name: "s2_1", line: 12, size: 8, align: 8, file: !1, scope: !9, baseType: !12)  !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "S2_1<&i>", line: 9, size: 8, align: 8, file: !1, elements: !2, templateParams: !5, identifier: "_ZTS4S2_1IXadL_Z1iEEE")  !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "S3", line: 22, size: 16, align: 8, file: !1, elements: !14, identifier: "_ZTS2S3")  !14 = !{!15, !16} -!15 = !DIDerivedType(tag: DW_TAG_member, name: "s3_1", line: 23, size: 8, align: 8, file: !1, scope: !"_ZTS2S3", baseType: !"_ZTS4S3_1IXadL_Z1iEEE") -!16 = !DIDerivedType(tag: DW_TAG_member, name: "s3_2", line: 24, size: 8, align: 8, offset: 8, file: !1, scope: !"_ZTS2S3", baseType: !"_ZTS4S3_2") +!15 = !DIDerivedType(tag: DW_TAG_member, name: "s3_1", line: 23, size: 8, align: 8, file: !1, scope: !13, baseType: !17) +!16 = !DIDerivedType(tag: DW_TAG_member, name: "s3_2", line: 24, size: 8, align: 8, offset: 8, file: !1, scope: !13, baseType: !18)  !17 = !DICompositeType(tag: DW_TAG_structure_type, name: "S3_1<&i>", line: 18, size: 8, align: 8, file: !1, elements: !2, templateParams: !5, identifier: "_ZTS4S3_1IXadL_Z1iEEE")  !18 = !DICompositeType(tag: DW_TAG_structure_type, name: "S3_2", line: 20, size: 8, align: 8, file: !1, elements: !2, identifier: "_ZTS4S3_2")  !19 = !DICompositeType(tag: DW_TAG_structure_type, name: "S4", line: 34, size: 16, align: 8, file: !1, elements: !20, identifier: "_ZTS2S4")  !20 = !{!21, !22} -!21 = !DIDerivedType(tag: DW_TAG_member, name: "s4_1", line: 35, size: 8, align: 8, file: !1, scope: !"_ZTS2S4", baseType: !"_ZTS4S4_1") -!22 = !DIDerivedType(tag: DW_TAG_member, name: "s4_2", line: 36, size: 8, align: 8, offset: 8, file: !1, scope: !"_ZTS2S4", baseType: !"_ZTS4S4_2IXadL_Z1iEEE") +!21 = !DIDerivedType(tag: DW_TAG_member, name: "s4_1", line: 35, size: 8, align: 8, file: !1, scope: !19, baseType: !23) +!22 = !DIDerivedType(tag: DW_TAG_member, name: "s4_2", line: 36, size: 8, align: 8, offset: 8, file: !1, scope: !19, baseType: !24)  !23 = !DICompositeType(tag: DW_TAG_structure_type, name: "S4_1", line: 29, size: 8, align: 8, file: !1, elements: !2, identifier: "_ZTS4S4_1")  !24 = !DICompositeType(tag: DW_TAG_structure_type, name: "S4_2<&i>", line: 32, size: 8, align: 8, file: !1, elements: !2, templateParams: !25, identifier: "_ZTS4S4_2IXadL_Z1iEEE")  !25 = !{!26} @@ -142,10 +142,10 @@  !27 = !{!28, !30, !31, !32, !33}  !28 = !DIGlobalVariable(name: "i", line: 1, isLocal: false, isDefinition: true, scope: null, file: !29, type: !8, variable: i32* @i)  !29 = !DIFile(filename: "tu.cpp", directory: "/tmp/dbginfo") -!30 = !DIGlobalVariable(name: "a", line: 6, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S1IXadL_Z1iEEE", variable: %struct.S1* @a) -!31 = !DIGlobalVariable(name: "s2", line: 15, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S2", variable: %struct.S2* @s2) -!32 = !DIGlobalVariable(name: "s3", line: 27, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S3", variable: %struct.S3* @s3) -!33 = !DIGlobalVariable(name: "s4", line: 39, isLocal: false, isDefinition: true, scope: null, file: !29, type: !"_ZTS2S4", variable: %struct.S4* @s4) +!30 = !DIGlobalVariable(name: "a", line: 6, isLocal: false, isDefinition: true, scope: null, file: !29, type: !4, variable: %struct.S1* @a) +!31 = !DIGlobalVariable(name: "s2", line: 15, isLocal: false, isDefinition: true, scope: null, file: !29, type: !9, variable: %struct.S2* @s2) +!32 = !DIGlobalVariable(name: "s3", line: 27, isLocal: false, isDefinition: true, scope: null, file: !29, type: !13, variable: %struct.S3* @s3) +!33 = !DIGlobalVariable(name: "s4", line: 39, isLocal: false, isDefinition: true, scope: null, file: !29, type: !19, variable: %struct.S4* @s4)  !34 = !{i32 2, !"Dwarf Version", i32 4}  !35 = !{i32 1, !"Debug Info Version", i32 3}  !36 = !{!"clang version 3.5.0 "} diff --git a/test/DebugInfo/X86/union-const.ll b/test/DebugInfo/X86/union-const.ll index 1d3969aff52d..54a9e5017c34 100644 --- a/test/DebugInfo/X86/union-const.ll +++ b/test/DebugInfo/X86/union-const.ll @@ -40,11 +40,10 @@ attributes #1 = { nounwind readnone }  !llvm.module.flags = !{!17, !18, !19}  !llvm.ident = !{!20} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226915) (llvm/trunk 226905)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226915) (llvm/trunk 226905)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "union.c", directory: "")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "mfi_aen_setup", line: 5, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !15) +!4 = distinct !DISubprogram(name: "mfi_aen_setup", line: 5, isLocal: false, isDefinition: true, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !15)  !5 = !DIFile(filename: "union.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8} diff --git a/test/DebugInfo/X86/union-template.ll b/test/DebugInfo/X86/union-template.ll index 1f91f2a129fe..58d44c789050 100644 --- a/test/DebugInfo/X86/union-template.ll +++ b/test/DebugInfo/X86/union-template.ll @@ -29,11 +29,10 @@ attributes #1 = { nounwind readnone }  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!28} -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 178499) (llvm/trunk 178472)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports:  !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 178499) (llvm/trunk 178472)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !9, imports:  !2)  !1 = !DIFile(filename: "foo.cc", directory: "/usr/local/google/home/echristo/tmp")  !2 = !{} -!3 = !{!4} -!4 = distinct !DISubprogram(name: "g", linkageName: "_ZN7PR156371gEf", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "g", linkageName: "_ZN7PR156371gEf", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DINamespace(name: "PR15637", line: 1, file: !1, scope: null)  !6 = !DISubroutineType(types: !7)  !7 = !{null, !8} diff --git a/test/DebugInfo/X86/vector.ll b/test/DebugInfo/X86/vector.ll index 3e2092bd806f..7d6abd787bf0 100644 --- a/test/DebugInfo/X86/vector.ll +++ b/test/DebugInfo/X86/vector.ll @@ -12,7 +12,7 @@  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!13} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171825) (llvm/trunk 171822)", isOptimized: false, emissionKind: 0, file: !12, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports:  !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171825) (llvm/trunk 171822)", isOptimized: false, emissionKind: FullDebug, file: !12, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)  !1 = !{}  !3 = !{!5}  !5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: <4 x i32>* @a) diff --git a/test/DebugInfo/X86/vla.ll b/test/DebugInfo/X86/vla.ll index 5a25f021894e..1c72519ccb8d 100644 --- a/test/DebugInfo/X86/vla.ll +++ b/test/DebugInfo/X86/vla.ll @@ -1,7 +1,7 @@  ; RUN: llc -O0 -mtriple=x86_64-apple-darwin -filetype=asm %s -o - | FileCheck %s  ; Ensure that we generate an indirect location for the variable length array a. -; CHECK: ##DEBUG_VALUE: vla:a <- [%RDX+0] -; CHECK: DW_OP_breg1 +; CHECK: ##DEBUG_VALUE: vla:a <- [%RCX+0] +; CHECK: DW_OP_breg2  ; rdar://problem/13658587  ;  ; generated from: @@ -75,16 +75,15 @@ entry:  !llvm.dbg.cu = !{!0}  !llvm.module.flags = !{!29} -!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)  !1 = !DIFile(filename: "vla.c", directory: "")  !2 = !{} -!3 = !{!4, !9} -!4 = distinct !DISubprogram(name: "vla", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "vla", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)  !5 = !DIFile(filename: "vla.c", directory: "")  !6 = !DISubroutineType(types: !7)  !7 = !{!8, !8}  !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !10, variables: !2) +!9 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 7, file: !1, scope: !5, type: !10, variables: !2)  !10 = !DISubroutineType(types: !11)  !11 = !{!8, !8, !12}  !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13) | 
