Ver Fonte

Renumber testcase metadata nodes after r290153.

This patch renumbers the metadata nodes in debug info testcases after
https://reviews.llvm.org/D26769. This is a separate patch because it
causes so much churn. This was implemented with a python script that
pipes the testcases through llvm-as - | llvm-dis - and then goes
through the original and new output side-by side to insert all
comments at a close-enough location.

Differential Revision: https://reviews.llvm.org/D27765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290292 91177308-0d34-0410-b5e6-96231b3b80d8
Adrian Prantl há 8 anos atrás
pai
commit
c271bc0481
100 ficheiros alterados com 4314 adições e 4104 exclusões
  1. 36 32
      test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll
  2. 67 57
      test/CodeGen/ARM/2010-06-25-Thumb2ITInvalidIterator.ll
  3. 107 89
      test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
  4. 101 83
      test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
  5. 49 44
      test/CodeGen/ARM/coalesce-dbgvalue.ll
  6. 43 39
      test/CodeGen/BPF/dwarfdump.ll
  7. 330 483
      test/CodeGen/PowerPC/pr17168.ll
  8. 40 38
      test/CodeGen/WebAssembly/dbgvalue.ll
  9. 42 50
      test/CodeGen/X86/2010-05-26-DotDebugLoc.ll
  10. 95 92
      test/CodeGen/X86/fp128-g.ll
  11. 45 35
      test/CodeGen/X86/fpstack-debuginstr-kill.ll
  12. 42 35
      test/CodeGen/X86/misched-code-difference-with-debug.ll
  13. 12 11
      test/CodeGen/X86/null-streamer.ll
  14. 12 10
      test/DebugInfo/AArch64/big-endian.ll
  15. 15 13
      test/DebugInfo/AArch64/bitfields.ll
  16. 172 171
      test/DebugInfo/AArch64/frameindices.ll
  17. 23 20
      test/DebugInfo/ARM/big-endian-bitfield.ll
  18. 24 21
      test/DebugInfo/ARM/bitfield.ll
  19. 29 26
      test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll
  20. 12 10
      test/DebugInfo/ARM/tls.ll
  21. 26 23
      test/DebugInfo/COFF/anonymous-struct.ll
  22. 12 4
      test/DebugInfo/COFF/big-type.ll
  23. 47 42
      test/DebugInfo/COFF/bitfields.ll
  24. 19 16
      test/DebugInfo/COFF/enum.ll
  25. 23 20
      test/DebugInfo/COFF/global-dllimport.ll
  26. 17 15
      test/DebugInfo/COFF/globals-discarded.ll
  27. 31 26
      test/DebugInfo/COFF/globals.ll
  28. 40 38
      test/DebugInfo/COFF/inheritance.ll
  29. 48 45
      test/DebugInfo/COFF/inlining-files.ll
  30. 56 55
      test/DebugInfo/COFF/inlining-header.ll
  31. 34 31
      test/DebugInfo/COFF/inlining-levels.ll
  32. 23 24
      test/DebugInfo/COFF/int8-char-type.ll
  33. 11 3
      test/DebugInfo/COFF/long-type-name.ll
  34. 61 58
      test/DebugInfo/COFF/register-variables.ll
  35. 47 46
      test/DebugInfo/COFF/scopes.ll
  36. 75 70
      test/DebugInfo/COFF/types-array-advanced.ll
  37. 17 15
      test/DebugInfo/COFF/types-nested-class.ll
  38. 82 71
      test/DebugInfo/COFF/types-ptr-to-member.ll
  39. 65 64
      test/DebugInfo/COFF/udts.ll
  40. 100 97
      test/DebugInfo/COFF/virtual-method-kinds.ll
  41. 65 61
      test/DebugInfo/COFF/vtable-optzn-array.ll
  42. 19 14
      test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll
  43. 13 11
      test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll
  44. 50 46
      test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
  45. 49 36
      test/DebugInfo/Generic/accel-table-hash-collisions.ll
  46. 36 33
      test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll
  47. 36 32
      test/DebugInfo/Generic/cross-cu-linkonce.ll
  48. 16 14
      test/DebugInfo/Generic/dbg-at-specficiation.ll
  49. 22 21
      test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll
  50. 65 56
      test/DebugInfo/Generic/dwarf-public-names.ll
  51. 34 30
      test/DebugInfo/Generic/enum.ll
  52. 16 13
      test/DebugInfo/Generic/global.ll
  53. 60 66
      test/DebugInfo/Generic/gvn.ll
  54. 23 19
      test/DebugInfo/Generic/member-pointers.ll
  55. 138 138
      test/DebugInfo/Generic/recursive_inlining.ll
  56. 38 35
      test/DebugInfo/Generic/template-recursive-void.ll
  57. 15 12
      test/DebugInfo/Generic/tu-member-pointer.ll
  58. 12 10
      test/DebugInfo/Generic/typedef.ll
  59. 50 46
      test/DebugInfo/Mips/InlinedFnLocalVar.ll
  60. 12 9
      test/DebugInfo/PowerPC/tls-fission.ll
  61. 12 10
      test/DebugInfo/PowerPC/tls.ll
  62. 50 47
      test/DebugInfo/WebAssembly/dbg-declare.ll
  63. 36 28
      test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
  64. 18 15
      test/DebugInfo/X86/DIModuleContext.ll
  65. 32 30
      test/DebugInfo/X86/DW_AT_calling-convention.ll
  66. 26 24
      test/DebugInfo/X86/DW_AT_specification.ll
  67. 33 30
      test/DebugInfo/X86/DW_TAG_friend.ll
  68. 51 47
      test/DebugInfo/X86/InlinedFnLocalVar.ll
  69. 63 55
      test/DebugInfo/X86/PR26148.ll
  70. 13 12
      test/DebugInfo/X86/align_c11.ll
  71. 71 68
      test/DebugInfo/X86/align_cpp11.ll
  72. 17 16
      test/DebugInfo/X86/align_objc.ll
  73. 28 25
      test/DebugInfo/X86/arange-and-stub.ll
  74. 16 13
      test/DebugInfo/X86/arange.ll
  75. 8 7
      test/DebugInfo/X86/atomic-c11-dwarf-4.ll
  76. 8 7
      test/DebugInfo/X86/atomic-c11-dwarf-5.ll
  77. 23 27
      test/DebugInfo/X86/bitfields-dwarf4.ll
  78. 15 13
      test/DebugInfo/X86/bitfields.ll
  79. 12 9
      test/DebugInfo/X86/c-type-units.ll
  80. 61 58
      test/DebugInfo/X86/concrete_out_of_line.ll
  81. 52 48
      test/DebugInfo/X86/cu-ranges-odr.ll
  82. 23 21
      test/DebugInfo/X86/data_member_location.ll
  83. 28 23
      test/DebugInfo/X86/dbg-subrange.ll
  84. 71 58
      test/DebugInfo/X86/dbg-value-inlined-parameter.ll
  85. 46 42
      test/DebugInfo/X86/dbg-value-regmask-clobber.ll
  86. 53 49
      test/DebugInfo/X86/debug-info-access.ll
  87. 67 67
      test/DebugInfo/X86/debug-info-packed-struct.ll
  88. 54 43
      test/DebugInfo/X86/debug-info-static-member.ll
  89. 62 55
      test/DebugInfo/X86/debug-loc-frame.ll
  90. 16 14
      test/DebugInfo/X86/debugger-tune.ll
  91. 74 71
      test/DebugInfo/X86/decl-derived-member.ll
  92. 21 18
      test/DebugInfo/X86/dllimport.ll
  93. 44 41
      test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll
  94. 33 32
      test/DebugInfo/X86/dwarf-aranges.ll
  95. 24 20
      test/DebugInfo/X86/dwarf-linkage-names.ll
  96. 65 56
      test/DebugInfo/X86/dwarf-public-names.ll
  97. 25 23
      test/DebugInfo/X86/empty-array.ll
  98. 30 26
      test/DebugInfo/X86/enum-class.ll
  99. 12 11
      test/DebugInfo/X86/enum-fwd-decl.ll
  100. 22 21
      test/DebugInfo/X86/externaltyperef.ll

+ 36 - 32
test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll

@@ -2,45 +2,49 @@
 
 ; rdar://9146594
 
-define void @drt_vsprintf() nounwind ssp {
+source_filename = "test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll"
+
+; Function Attrs: nounwind ssp
+define void @drt_vsprintf() #0 {
 entry:
   %do_tab_convert = alloca i32, align 4
-  br i1 undef, label %if.then24, label %if.else295, !dbg !13
+  br i1 undef, label %if.then24, label %if.else295, !dbg !11
 
 if.then24:                                        ; preds = %entry
   unreachable
 
 if.else295:                                       ; preds = %entry
-  call void @llvm.dbg.declare(metadata i32* %do_tab_convert, metadata !16, metadata !DIExpression()), !dbg !18
-  store i32 0, i32* %do_tab_convert, align 4, !dbg !19
+  call void @llvm.dbg.declare(metadata i32* %do_tab_convert, metadata !14, metadata !16), !dbg !17
+  store i32 0, i32* %do_tab_convert, align 4, !dbg !18
   unreachable
 }
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
-
-!llvm.dbg.cu = !{!3}
-!llvm.module.flags = !{!22, !23}
-
-!0 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "vsplive", line: 617, isLocal: true, isDefinition: true, scope: !1, file: !2, type: !6))
-!1 = distinct !DISubprogram(name: "drt_vsprintf", line: 616, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, file: !20, scope: !2, type: !4)
-!2 = !DIFile(filename: "print.i", directory: "/Volumes/Ebi/echeng/radars/r9146594")
-!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (http://llvm.org/git/clang.git git:/git/puzzlebox/clang.git/ c4d1aea01c4444eb81bdbf391f1be309127c3cf1)", isOptimized: true, emissionKind: FullDebug, file: !20, globals: !{!0})
-!4 = !DISubroutineType(types: !5)
-!5 = !{!6}
-!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!7 = distinct !DISubprogram(name: "putc_mem", line: 30, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, file: !20, scope: !2, type: !8)
-!8 = !DISubroutineType(types: !9)
-!9 = !{null}
-!10 = distinct !DISubprogram(name: "print_double", line: 203, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, file: !20, scope: !2, type: !4)
-!11 = distinct !DISubprogram(name: "print_number", line: 75, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, file: !20, scope: !2, type: !4)
-!12 = distinct !DISubprogram(name: "get_flags", line: 508, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, file: !20, scope: !2, type: !8)
-!13 = !DILocation(line: 653, column: 5, scope: !14)
-!14 = distinct !DILexicalBlock(line: 652, column: 35, file: !20, scope: !15)
-!15 = distinct !DILexicalBlock(line: 616, column: 1, file: !20, scope: !1)
-!16 = !DILocalVariable(name: "do_tab_convert", line: 853, scope: !17, file: !2, type: !6)
-!17 = distinct !DILexicalBlock(line: 850, column: 12, file: !20, scope: !14)
-!18 = !DILocation(line: 853, column: 11, scope: !17)
-!19 = !DILocation(line: 853, column: 29, scope: !17)
-!20 = !DIFile(filename: "print.i", directory: "/Volumes/Ebi/echeng/radars/r9146594")
-!22 = !{i32 2, !"Debug Info Version", i32 3}
-!23 = !{i32 2, !"Dwarf Version", i32 2}
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { nounwind ssp }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!9, !10}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.0 (http://llvm.org/git/clang.git git:/git/puzzlebox/clang.git/ c4d1aea01c4444eb81bdbf391f1be309127c3cf1)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !2)
+!1 = !DIFile(filename: "print.i", directory: "/Volumes/Ebi/echeng/radars/r9146594")
+!2 = !{!3}
+!3 = !DIGlobalVariableExpression(var: !4)
+!4 = !DIGlobalVariable(name: "vsplive", scope: !5, file: !1, line: 617, type: !8, isLocal: true, isDefinition: true)
+!5 = distinct !DISubprogram(name: "drt_vsprintf", scope: !1, file: !1, line: 616, type: !6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
+!6 = !DISubroutineType(types: !7)
+!7 = !{!8}
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 2, !"Dwarf Version", i32 2}
+!11 = !DILocation(line: 653, column: 5, scope: !12)
+!12 = distinct !DILexicalBlock(scope: !13, file: !1, line: 652, column: 35)
+!13 = distinct !DILexicalBlock(scope: !5, file: !1, line: 616, column: 1)
+!14 = !DILocalVariable(name: "do_tab_convert", scope: !15, file: !1, line: 853, type: !8)
+!15 = distinct !DILexicalBlock(scope: !12, file: !1, line: 850, column: 12)
+!16 = !DIExpression()
+!17 = !DILocation(line: 853, column: 11, scope: !15)
+!18 = !DILocation(line: 853, column: 29, scope: !15)
+

+ 67 - 57
test/CodeGen/ARM/2010-06-25-Thumb2ITInvalidIterator.ll

@@ -1,78 +1,88 @@
 ; RUN: llc < %s
 
+source_filename = "test/CodeGen/ARM/2010-06-25-Thumb2ITInvalidIterator.ll"
 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
 target triple = "thumbv7-apple-darwin3.0.0-iphoneos"
 
-@length = common global i32 0, align 4, !dbg !14            ; <i32*> [#uses=1]
+@length = common global i32 0, align 4, !dbg !0
 
-define void @x0(i8* nocapture %buf, i32 %nbytes) nounwind optsize {
+; Function Attrs: nounwind optsize
+define void @x0(i8* nocapture %buf, i32 %nbytes) #0 {
 entry:
-  tail call void @llvm.dbg.value(metadata i8* %buf, i64 0, metadata !0, metadata !DIExpression()), !dbg !15
-  tail call void @llvm.dbg.value(metadata i32 %nbytes, i64 0, metadata !8, metadata !DIExpression()), !dbg !16
-  %tmp = load i32, i32* @length, !dbg !17              ; <i32> [#uses=3]
-  %cmp = icmp eq i32 %tmp, -1, !dbg !17           ; <i1> [#uses=1]
-  %cmp.not = xor i1 %cmp, true                    ; <i1> [#uses=1]
-  %cmp3 = icmp ult i32 %tmp, %nbytes, !dbg !17    ; <i1> [#uses=1]
-  %or.cond = and i1 %cmp.not, %cmp3               ; <i1> [#uses=1]
-  tail call void @llvm.dbg.value(metadata i32 %tmp, i64 0, metadata !8, metadata !DIExpression()), !dbg !17
-  %nbytes.addr.0 = select i1 %or.cond, i32 %tmp, i32 %nbytes ; <i32> [#uses=1]
-  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !DIExpression()), !dbg !19
-  br label %while.cond, !dbg !20
+  tail call void @llvm.dbg.value(metadata i8* %buf, i64 0, metadata !8, metadata !14), !dbg !15
+  tail call void @llvm.dbg.value(metadata i32 %nbytes, i64 0, metadata !16, metadata !14), !dbg !18
+  %tmp = load i32, i32* @length, !dbg !19
+  %cmp = icmp eq i32 %tmp, -1, !dbg !19
+  %cmp.not = xor i1 %cmp, true
+  %cmp3 = icmp ult i32 %tmp, %nbytes, !dbg !19
+  %or.cond = and i1 %cmp.not, %cmp3
+  tail call void @llvm.dbg.value(metadata i32 %tmp, i64 0, metadata !16, metadata !14), !dbg !19
+  %nbytes.addr.0 = select i1 %or.cond, i32 %tmp, i32 %nbytes
+  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !21, metadata !14), !dbg !22
+  br label %while.cond, !dbg !23
 
 while.cond:                                       ; preds = %while.body, %entry
-  %0 = phi i32 [ 0, %entry ], [ %inc, %while.body ] ; <i32> [#uses=3]
-  %buf.addr.0 = getelementptr i8, i8* %buf, i32 %0    ; <i8*> [#uses=1]
-  %cmp7 = icmp ult i32 %0, %nbytes.addr.0, !dbg !20 ; <i1> [#uses=1]
-  br i1 %cmp7, label %land.rhs, label %while.end, !dbg !20
+
+  %0 = phi i32 [ 0, %entry ], [ %inc, %while.body ]
+  %buf.addr.0 = getelementptr i8, i8* %buf, i32 %0
+  %cmp7 = icmp ult i32 %0, %nbytes.addr.0, !dbg !23
+  br i1 %cmp7, label %land.rhs, label %while.end, !dbg !23
 
 land.rhs:                                         ; preds = %while.cond
-  %call = tail call i32 @x1() nounwind optsize, !dbg !20 ; <i32> [#uses=2]
-  %cmp9 = icmp eq i32 %call, -1, !dbg !20         ; <i1> [#uses=1]
-  br i1 %cmp9, label %while.end, label %while.body, !dbg !20
+  %call = tail call i32 @x1() #0, !dbg !23
+  %cmp9 = icmp eq i32 %call, -1, !dbg !23
+  br i1 %cmp9, label %while.end, label %while.body, !dbg !23
 
 while.body:                                       ; preds = %land.rhs
-  %conv = trunc i32 %call to i8, !dbg !21         ; <i8> [#uses=1]
-  store i8 %conv, i8* %buf.addr.0, !dbg !21
-  %inc = add i32 %0, 1, !dbg !23                  ; <i32> [#uses=1]
-  br label %while.cond, !dbg !24
+  %conv = trunc i32 %call to i8, !dbg !24
+  store i8 %conv, i8* %buf.addr.0, !dbg !24
+  %inc = add i32 %0, 1, !dbg !26
+  br label %while.cond, !dbg !27
 
 while.end:                                        ; preds = %land.rhs, %while.cond
-  ret void, !dbg !25
+  ret void, !dbg !28
 }
 
-declare i32 @x1() optsize
+; Function Attrs: optsize
+declare i32 @x1() #1
+
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+attributes #0 = { nounwind optsize }
+attributes #1 = { optsize }
+attributes #2 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!3}
-!llvm.module.flags = !{!27, !28}
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!6, !7}
 
-!0 = !DILocalVariable(name: "buf", line: 4, arg: 1, scope: !1, file: !2, type: !6)
-!1 = distinct !DISubprogram(name: "x0", linkageName: "x0", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !26, scope: null, type: !4)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "length", linkageName: "length", scope: !2, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
 !2 = !DIFile(filename: "t.c", directory: "/private/tmp")
-!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 2.0", isOptimized: true, file: !26, globals: !{!14})
-!4 = !DISubroutineType(types: !5)
-!5 = !{null}
-!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !26, scope: !2, baseType: !7)
-!7 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
-!8 = !DILocalVariable(name: "nbytes", line: 4, arg: 2, scope: !1, file: !2, type: !9)
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned long", size: 32, align: 32, encoding: DW_ATE_unsigned)
-!10 = !DILocalVariable(name: "nread", line: 6, scope: !11, file: !2, type: !9)
-!11 = distinct !DILexicalBlock(line: 5, column: 1, file: !26, scope: !1)
-!12 = !DILocalVariable(name: "c", line: 7, scope: !11, file: !2, type: !13)
-!13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!14 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "length", linkageName: "length", line: 1, isLocal: false, isDefinition: true, scope: !2, file: !2, type: !13))
-!15 = !DILocation(line: 4, column: 24, scope: !1)
-!16 = !DILocation(line: 4, column: 43, scope: !1)
-!17 = !DILocation(line: 9, column: 2, scope: !11)
-!18 = !{i32 0}
-!19 = !DILocation(line: 10, column: 2, scope: !11)
-!20 = !DILocation(line: 11, column: 2, scope: !11)
-!21 = !DILocation(line: 12, column: 3, scope: !22)
-!22 = distinct !DILexicalBlock(line: 11, column: 45, file: !26, scope: !11)
-!23 = !DILocation(line: 13, column: 3, scope: !22)
-!24 = !DILocation(line: 14, column: 2, scope: !22)
-!25 = !DILocation(line: 15, column: 1, scope: !11)
-!26 = !DIFile(filename: "t.c", directory: "/private/tmp")
-!27 = !{i32 2, !"Dwarf Version", i32 2}
-!28 = !{i32 2, !"Debug Info Version", i32 3}
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang 2.0", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, globals: !5)
+!5 = !{!0}
+!6 = !{i32 2, !"Dwarf Version", i32 2}
+!7 = !{i32 2, !"Debug Info Version", i32 3}
+!8 = !DILocalVariable(name: "buf", arg: 1, scope: !9, file: !2, line: 4, type: !12)
+!9 = distinct !DISubprogram(name: "x0", linkageName: "x0", scope: null, file: !2, line: 5, type: !10, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4)
+!10 = !DISubroutineType(types: !11)
+!11 = !{null}
+!12 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !2, file: !2, baseType: !13, size: 32, align: 32)
+!13 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
+!14 = !DIExpression()
+!15 = !DILocation(line: 4, column: 24, scope: !9)
+!16 = !DILocalVariable(name: "nbytes", arg: 2, scope: !9, file: !2, line: 4, type: !17)
+!17 = !DIBasicType(name: "unsigned long", size: 32, align: 32, encoding: DW_ATE_unsigned)
+!18 = !DILocation(line: 4, column: 43, scope: !9)
+!19 = !DILocation(line: 9, column: 2, scope: !20)
+!20 = distinct !DILexicalBlock(scope: !9, file: !2, line: 5, column: 1)
+!21 = !DILocalVariable(name: "nread", scope: !20, file: !2, line: 6, type: !17)
+!22 = !DILocation(line: 10, column: 2, scope: !20)
+!23 = !DILocation(line: 11, column: 2, scope: !20)
+!24 = !DILocation(line: 12, column: 3, scope: !25)
+!25 = distinct !DILexicalBlock(scope: !20, file: !2, line: 11, column: 45)
+!26 = !DILocation(line: 13, column: 3, scope: !25)
+!27 = !DILocation(line: 14, column: 2, scope: !25)
+!28 = !DILocation(line: 15, column: 1, scope: !20)
+

+ 107 - 89
test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll

@@ -1,14 +1,14 @@
 ; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
 
+source_filename = "test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll"
 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32"
 target triple = "thumbv7-apple-darwin10"
 
-@x1 = internal global i8 1, align 1, !dbg !13
-@x2 = internal global i8 1, align 1, !dbg !14
-@x3 = internal global i8 1, align 1, !dbg !15
-@x4 = internal global i8 1, align 1, !dbg !16
-@x5 = global i8 1, align 1, !dbg !17
-
+@x1 = internal global i8 1, align 1, !dbg !0
+@x2 = internal global i8 1, align 1, !dbg !4
+@x3 = internal global i8 1, align 1, !dbg !6
+@x4 = internal global i8 1, align 1, !dbg !8
+@x5 = global i8 1, align 1, !dbg !10
 ; Check debug info output for merged global.
 ; DW_AT_location
 ; 0x03 DW_OP_addr
@@ -28,102 +28,120 @@ target triple = "thumbv7-apple-darwin10"
 ; CHECK-NOT: {{DW_TAG|NULL}}
 ; CHECK:    DW_AT_location [DW_FORM_exprloc]        (<0x7> 03 [[ADDR]] 23 01  )
 
-define zeroext i8 @get1(i8 zeroext %a) nounwind optsize !dbg !0 {
+; Function Attrs: nounwind optsize
+define zeroext i8 @get1(i8 zeroext %a) #0 !dbg !16 {
 entry:
-  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !30
-  %0 = load i8, i8* @x1, align 4, !dbg !30
-  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !11, metadata !DIExpression()), !dbg !30
-  store i8 %a, i8* @x1, align 4, !dbg !30
-  ret i8 %0, !dbg !31
+  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !20, metadata !23), !dbg !24
+  %0 = load i8, i8* @x1, align 4, !dbg !24
+  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !21, metadata !23), !dbg !24
+  store i8 %a, i8* @x1, align 4, !dbg !24
+  ret i8 %0, !dbg !25
 }
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 
-define zeroext i8 @get2(i8 zeroext %a) nounwind optsize !dbg !6 {
+; Function Attrs: nounwind optsize
+define zeroext i8 @get2(i8 zeroext %a) #0 !dbg !26 {
 entry:
-  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !18, metadata !DIExpression()), !dbg !32
-  %0 = load i8, i8* @x2, align 4, !dbg !32
-  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !19, metadata !DIExpression()), !dbg !32
-  store i8 %a, i8* @x2, align 4, !dbg !32
-  ret i8 %0, !dbg !33
+  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !28, metadata !23), !dbg !31
+  %0 = load i8, i8* @x2, align 4, !dbg !31
+  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !29, metadata !23), !dbg !31
+  store i8 %a, i8* @x2, align 4, !dbg !31
+  ret i8 %0, !dbg !32
 }
 
-define zeroext i8 @get3(i8 zeroext %a) nounwind optsize !dbg !7 {
+; Function Attrs: nounwind optsize
+
+define zeroext i8 @get3(i8 zeroext %a) #0 !dbg !33 {
 entry:
-  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !21, metadata !DIExpression()), !dbg !34
-  %0 = load i8, i8* @x3, align 4, !dbg !34
-  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !22, metadata !DIExpression()), !dbg !34
-  store i8 %a, i8* @x3, align 4, !dbg !34
-  ret i8 %0, !dbg !35
+  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !35, metadata !23), !dbg !38
+  %0 = load i8, i8* @x3, align 4, !dbg !38
+  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !36, metadata !23), !dbg !38
+  store i8 %a, i8* @x3, align 4, !dbg !38
+  ret i8 %0, !dbg !39
 }
 
-define zeroext i8 @get4(i8 zeroext %a) nounwind optsize !dbg !8 {
+; Function Attrs: nounwind optsize
+
+define zeroext i8 @get4(i8 zeroext %a) #0 !dbg !40 {
 entry:
-  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !24, metadata !DIExpression()), !dbg !36
-  %0 = load i8, i8* @x4, align 4, !dbg !36
-  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !25, metadata !DIExpression()), !dbg !36
-  store i8 %a, i8* @x4, align 4, !dbg !36
-  ret i8 %0, !dbg !37
+  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !42, metadata !23), !dbg !45
+  %0 = load i8, i8* @x4, align 4, !dbg !45
+  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !43, metadata !23), !dbg !45
+  store i8 %a, i8* @x4, align 4, !dbg !45
+  ret i8 %0, !dbg !46
 }
 
-define zeroext i8 @get5(i8 zeroext %a) nounwind optsize !dbg !9 {
+; Function Attrs: nounwind optsize
+
+define zeroext i8 @get5(i8 zeroext %a) #0 !dbg !47 {
 entry:
-  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !27, metadata !DIExpression()), !dbg !38
-  %0 = load i8, i8* @x5, align 4, !dbg !38
-  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !28, metadata !DIExpression()), !dbg !38
-  store i8 %a, i8* @x5, align 4, !dbg !38
-  ret i8 %0, !dbg !39
+  tail call void @llvm.dbg.value(metadata i8 %a, i64 0, metadata !49, metadata !23), !dbg !52
+  %0 = load i8, i8* @x5, align 4, !dbg !52
+  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !50, metadata !23), !dbg !52
+  store i8 %a, i8* @x5, align 4, !dbg !52
+  ret i8 %0, !dbg !53
 }
 
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!49}
-
-!0 = distinct !DISubprogram(name: "get1", linkageName: "get1", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 4, file: !47, scope: !1, type: !3, variables: !42)
-!1 = !DIFile(filename: "foo.c", directory: "/tmp/")
-!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2369.8)", isOptimized: true, emissionKind: FullDebug, file: !47, enums: !48, retainedTypes: !48, globals: !41, imports:  !48)
-!3 = !DISubroutineType(types: !4)
-!4 = !{!5, !5}
-!5 = !DIBasicType(tag: DW_TAG_base_type, name: "_Bool", size: 8, align: 8, encoding: DW_ATE_boolean)
-!6 = distinct !DISubprogram(name: "get2", linkageName: "get2", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 7, file: !47, scope: !1, type: !3, variables: !43)
-!7 = distinct !DISubprogram(name: "get3", linkageName: "get3", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 10, file: !47, scope: !1, type: !3, variables: !44)
-!8 = distinct !DISubprogram(name: "get4", linkageName: "get4", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 13, file: !47, scope: !1, type: !3, variables: !45)
-!9 = distinct !DISubprogram(name: "get5", linkageName: "get5", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 16, file: !47, scope: !1, type: !3, variables: !46)
-!10 = !DILocalVariable(name: "a", line: 4, arg: 1, scope: !0, file: !1, type: !5)
-!11 = !DILocalVariable(name: "b", line: 4, scope: !12, file: !1, type: !5)
-!12 = distinct !DILexicalBlock(line: 4, column: 0, file: !47, scope: !0)
-!13 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x1", line: 3, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5))
-!14 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x2", line: 6, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5))
-!15 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x3", line: 9, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5))
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x4", line: 12, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !5))
-!17 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x5", line: 15, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5))
-!18 = !DILocalVariable(name: "a", line: 7, arg: 1, scope: !6, file: !1, type: !5)
-!19 = !DILocalVariable(name: "b", line: 7, scope: !20, file: !1, type: !5)
-!20 = distinct !DILexicalBlock(line: 7, column: 0, file: !47, scope: !6)
-!21 = !DILocalVariable(name: "a", line: 10, arg: 1, scope: !7, file: !1, type: !5)
-!22 = !DILocalVariable(name: "b", line: 10, scope: !23, file: !1, type: !5)
-!23 = distinct !DILexicalBlock(line: 10, column: 0, file: !47, scope: !7)
-!24 = !DILocalVariable(name: "a", line: 13, arg: 1, scope: !8, file: !1, type: !5)
-!25 = !DILocalVariable(name: "b", line: 13, scope: !26, file: !1, type: !5)
-!26 = distinct !DILexicalBlock(line: 13, column: 0, file: !47, scope: !8)
-!27 = !DILocalVariable(name: "a", line: 16, arg: 1, scope: !9, file: !1, type: !5)
-!28 = !DILocalVariable(name: "b", line: 16, scope: !29, file: !1, type: !5)
-!29 = distinct !DILexicalBlock(line: 16, column: 0, file: !47, scope: !9)
-!30 = !DILocation(line: 4, scope: !0)
-!31 = !DILocation(line: 4, scope: !12)
-!32 = !DILocation(line: 7, scope: !6)
-!33 = !DILocation(line: 7, scope: !20)
-!34 = !DILocation(line: 10, scope: !7)
-!35 = !DILocation(line: 10, scope: !23)
-!36 = !DILocation(line: 13, scope: !8)
-!37 = !DILocation(line: 13, scope: !26)
-!38 = !DILocation(line: 16, scope: !9)
-!39 = !DILocation(line: 16, scope: !29)
-!41 = !{!13, !14, !15, !16, !17}
-!42 = !{!10, !11}
-!43 = !{!18, !19}
-!44 = !{!21, !22}
-!45 = !{!24, !25}
-!46 = !{!27, !28}
-!47 = !DIFile(filename: "foo.c", directory: "/tmp/")
-!48 = !{}
-!49 = !{i32 1, !"Debug Info Version", i32 3}
+attributes #0 = { nounwind optsize }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!12}
+!llvm.module.flags = !{!15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x1", scope: !2, file: !2, line: 3, type: !3, isLocal: true, isDefinition: true)
+!2 = !DIFile(filename: "foo.c", directory: "/tmp/")
+!3 = !DIBasicType(name: "_Bool", size: 8, align: 8, encoding: DW_ATE_boolean)
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "x2", scope: !2, file: !2, line: 6, type: !3, isLocal: true, isDefinition: true)
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "x3", scope: !2, file: !2, line: 9, type: !3, isLocal: true, isDefinition: true)
+!8 = !DIGlobalVariableExpression(var: !9)
+!9 = !DIGlobalVariable(name: "x4", scope: !2, file: !2, line: 12, type: !3, isLocal: true, isDefinition: true)
+!10 = !DIGlobalVariableExpression(var: !11)
+!11 = !DIGlobalVariable(name: "x5", scope: !2, file: !2, line: 15, type: !3, isLocal: false, isDefinition: true)
+!12 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2369.8)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !13, retainedTypes: !13, globals: !14, imports: !13)
+!13 = !{}
+!14 = !{!0, !4, !6, !8, !10}
+!15 = !{i32 1, !"Debug Info Version", i32 3}
+!16 = distinct !DISubprogram(name: "get1", linkageName: "get1", scope: !2, file: !2, line: 4, type: !17, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !19)
+!17 = !DISubroutineType(types: !18)
+!18 = !{!3, !3}
+!19 = !{!20, !21}
+!20 = !DILocalVariable(name: "a", arg: 1, scope: !16, file: !2, line: 4, type: !3)
+!21 = !DILocalVariable(name: "b", scope: !22, file: !2, line: 4, type: !3)
+!22 = distinct !DILexicalBlock(scope: !16, file: !2, line: 4)
+!23 = !DIExpression()
+!24 = !DILocation(line: 4, scope: !16)
+!25 = !DILocation(line: 4, scope: !22)
+!26 = distinct !DISubprogram(name: "get2", linkageName: "get2", scope: !2, file: !2, line: 7, type: !17, isLocal: false, isDefinition: true, scopeLine: 7, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !27)
+!27 = !{!28, !29}
+!28 = !DILocalVariable(name: "a", arg: 1, scope: !26, file: !2, line: 7, type: !3)
+!29 = !DILocalVariable(name: "b", scope: !30, file: !2, line: 7, type: !3)
+!30 = distinct !DILexicalBlock(scope: !26, file: !2, line: 7)
+!31 = !DILocation(line: 7, scope: !26)
+!32 = !DILocation(line: 7, scope: !30)
+!33 = distinct !DISubprogram(name: "get3", linkageName: "get3", scope: !2, file: !2, line: 10, type: !17, isLocal: false, isDefinition: true, scopeLine: 10, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !34)
+!34 = !{!35, !36}
+!35 = !DILocalVariable(name: "a", arg: 1, scope: !33, file: !2, line: 10, type: !3)
+!36 = !DILocalVariable(name: "b", scope: !37, file: !2, line: 10, type: !3)
+!37 = distinct !DILexicalBlock(scope: !33, file: !2, line: 10)
+!38 = !DILocation(line: 10, scope: !33)
+!39 = !DILocation(line: 10, scope: !37)
+!40 = distinct !DISubprogram(name: "get4", linkageName: "get4", scope: !2, file: !2, line: 13, type: !17, isLocal: false, isDefinition: true, scopeLine: 13, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !41)
+!41 = !{!42, !43}
+!42 = !DILocalVariable(name: "a", arg: 1, scope: !40, file: !2, line: 13, type: !3)
+!43 = !DILocalVariable(name: "b", scope: !44, file: !2, line: 13, type: !3)
+!44 = distinct !DILexicalBlock(scope: !40, file: !2, line: 13)
+!45 = !DILocation(line: 13, scope: !40)
+!46 = !DILocation(line: 13, scope: !44)
+!47 = distinct !DISubprogram(name: "get5", linkageName: "get5", scope: !2, file: !2, line: 16, type: !17, isLocal: false, isDefinition: true, scopeLine: 16, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !48)
+!48 = !{!49, !50}
+!49 = !DILocalVariable(name: "a", arg: 1, scope: !47, file: !2, line: 16, type: !3)
+!50 = !DILocalVariable(name: "b", scope: !51, file: !2, line: 16, type: !3)
+!51 = distinct !DILexicalBlock(scope: !47, file: !2, line: 16)
+!52 = !DILocation(line: 16, scope: !47)
+!53 = !DILocation(line: 16, scope: !51)
+

+ 101 - 83
test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll

@@ -19,103 +19,121 @@
 ; CHECK-NOT: {{DW_TAG|NULL}}
 ; CHECK:    DW_AT_location [DW_FORM_exprloc]        (<0x7> 03 [[ADDR]] 23 04  )
 
+source_filename = "test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll"
 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32"
 target triple = "thumbv7-apple-macosx10.7.0"
 
-@x1 = internal unnamed_addr global i32 1, align 4, !dbg !25
-@x2 = internal unnamed_addr global i32 2, align 4, !dbg !26
+@x1 = internal unnamed_addr global i32 1, align 4, !dbg !0
+@x2 = internal unnamed_addr global i32 2, align 4, !dbg !6
 @x3 = internal unnamed_addr global i32 3, align 4
 @x4 = internal unnamed_addr global i32 4, align 4
 @x5 = global i32 0, align 4
 
-define i32 @get1(i32 %a) nounwind optsize ssp !dbg !1 {
-  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !30
-  %1 = load i32, i32* @x1, align 4, !dbg !31
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !11, metadata !DIExpression()), !dbg !31
-  store i32 %a, i32* @x1, align 4, !dbg !31
-  ret i32 %1, !dbg !31
+; Function Attrs: nounwind optsize ssp
+define i32 @get1(i32 %a) #0 !dbg !10 {
+  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !14, metadata !17), !dbg !18
+  %1 = load i32, i32* @x1, align 4, !dbg !19
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !15, metadata !17), !dbg !19
+  store i32 %a, i32* @x1, align 4, !dbg !19
+  ret i32 %1, !dbg !19
 }
 
-define i32 @get2(i32 %a) nounwind optsize ssp !dbg !6 {
-  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !13, metadata !DIExpression()), !dbg !32
-  %1 = load i32, i32* @x2, align 4, !dbg !33
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !14, metadata !DIExpression()), !dbg !33
-  store i32 %a, i32* @x2, align 4, !dbg !33
-  ret i32 %1, !dbg !33
+; Function Attrs: nounwind optsize ssp
+
+define i32 @get2(i32 %a) #0 !dbg !20 {
+  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !22, metadata !17), !dbg !25
+  %1 = load i32, i32* @x2, align 4, !dbg !26
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !23, metadata !17), !dbg !26
+  store i32 %a, i32* @x2, align 4, !dbg !26
+  ret i32 %1, !dbg !26
 }
 
-define i32 @get3(i32 %a) nounwind optsize ssp !dbg !7 {
-  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !16, metadata !DIExpression()), !dbg !34
-  %1 = load i32, i32* @x3, align 4, !dbg !35
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !17, metadata !DIExpression()), !dbg !35
-  store i32 %a, i32* @x3, align 4, !dbg !35
-  ret i32 %1, !dbg !35
+; Function Attrs: nounwind optsize ssp
+
+define i32 @get3(i32 %a) #0 !dbg !27 {
+  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !29, metadata !17), !dbg !32
+  %1 = load i32, i32* @x3, align 4, !dbg !33
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !30, metadata !17), !dbg !33
+  store i32 %a, i32* @x3, align 4, !dbg !33
+  ret i32 %1, !dbg !33
 }
 
-define i32 @get4(i32 %a) nounwind optsize ssp !dbg !8 {
-  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !19, metadata !DIExpression()), !dbg !36
-  %1 = load i32, i32* @x4, align 4, !dbg !37
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !20, metadata !DIExpression()), !dbg !37
-  store i32 %a, i32* @x4, align 4, !dbg !37
-  ret i32 %1, !dbg !37
+; Function Attrs: nounwind optsize ssp
+
+define i32 @get4(i32 %a) #0 !dbg !34 {
+  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !36, metadata !17), !dbg !39
+  %1 = load i32, i32* @x4, align 4, !dbg !40
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !37, metadata !17), !dbg !40
+  store i32 %a, i32* @x4, align 4, !dbg !40
+  ret i32 %1, !dbg !40
 }
 
-define i32 @get5(i32 %a) nounwind optsize ssp !dbg !9 {
-  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !27, metadata !DIExpression()), !dbg !38
-  %1 = load i32, i32* @x5, align 4, !dbg !39
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !28, metadata !DIExpression()), !dbg !39
-  store i32 %a, i32* @x5, align 4, !dbg !39
-  ret i32 %1, !dbg !39
+; Function Attrs: nounwind optsize ssp
+
+define i32 @get5(i32 %a) #0 !dbg !41 {
+  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !43, metadata !17), !dbg !46
+  %1 = load i32, i32* @x5, align 4, !dbg !47
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !44, metadata !17), !dbg !47
+  store i32 %a, i32* @x5, align 4, !dbg !47
+  ret i32 %1, !dbg !47
 }
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!49}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: FullDebug, file: !47, enums: !48, retainedTypes: !48, globals: !41, imports:  !48)
-!1 = distinct !DISubprogram(name: "get1", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 5, file: !47, scope: !2, type: !3, variables: !42)
-!2 = !DIFile(filename: "ss3.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: "get2", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 8, file: !47, scope: !2, type: !3, variables: !43)
-!7 = distinct !DISubprogram(name: "get3", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 11, file: !47, scope: !2, type: !3, variables: !44)
-!8 = distinct !DISubprogram(name: "get4", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 14, file: !47, scope: !2, type: !3, variables: !45)
-!9 = distinct !DISubprogram(name: "get5", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 17, file: !47, scope: !2, type: !3, variables: !46)
-!10 = !DILocalVariable(name: "a", line: 5, arg: 1, scope: !1, file: !2, type: !5)
-!11 = !DILocalVariable(name: "b", line: 5, scope: !12, file: !2, type: !5)
-!12 = distinct !DILexicalBlock(line: 5, column: 19, file: !47, scope: !1)
-!13 = !DILocalVariable(name: "a", line: 8, arg: 1, scope: !6, file: !2, type: !5)
-!14 = !DILocalVariable(name: "b", line: 8, scope: !15, file: !2, type: !5)
-!15 = distinct !DILexicalBlock(line: 8, column: 17, file: !47, scope: !6)
-!16 = !DILocalVariable(name: "a", line: 11, arg: 1, scope: !7, file: !2, type: !5)
-!17 = !DILocalVariable(name: "b", line: 11, scope: !18, file: !2, type: !5)
-!18 = distinct !DILexicalBlock(line: 11, column: 19, file: !47, scope: !7)
-!19 = !DILocalVariable(name: "a", line: 14, arg: 1, scope: !8, file: !2, type: !5)
-!20 = !DILocalVariable(name: "b", line: 14, scope: !21, file: !2, type: !5)
-!21 = distinct !DILexicalBlock(line: 14, column: 19, file: !47, scope: !8)
-!25 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x1", line: 4, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5))
-!26 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x2", line: 7, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5))
-!27 = !DILocalVariable(name: "a", line: 17, arg: 1, scope: !9, file: !2, type: !5)
-!28 = !DILocalVariable(name: "b", line: 17, scope: !29, file: !2, type: !5)
-!29 = distinct !DILexicalBlock(line: 17, column: 19, file: !47, scope: !9)
-!30 = !DILocation(line: 5, column: 16, scope: !1)
-!31 = !DILocation(line: 5, column: 32, scope: !12)
-!32 = !DILocation(line: 8, column: 14, scope: !6)
-!33 = !DILocation(line: 8, column: 29, scope: !15)
-!34 = !DILocation(line: 11, column: 16, scope: !7)
-!35 = !DILocation(line: 11, column: 32, scope: !18)
-!36 = !DILocation(line: 14, column: 16, scope: !8)
-!37 = !DILocation(line: 14, column: 32, scope: !21)
-!38 = !DILocation(line: 17, column: 16, scope: !9)
-!39 = !DILocation(line: 17, column: 32, scope: !29)
-!41 = !{!25, !26}
-!42 = !{!10, !11}
-!43 = !{!13, !14}
-!44 = !{!16, !17}
-!45 = !{!19, !20}
-!46 = !{!27, !28}
-!47 = !DIFile(filename: "ss3.c", directory: "/private/tmp")
-!48 = !{}
-!49 = !{i32 1, !"Debug Info Version", i32 3}
+; Function Attrs: nounwind readnone
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
+
+attributes #0 = { nounwind optsize ssp }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!9}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x1", scope: !2, file: !3, line: 4, type: !8, isLocal: true, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "ss3.c", directory: "/private/tmp")
+!4 = !{}
+!5 = !{!0, !6}
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "x2", scope: !2, file: !3, line: 7, type: !8, isLocal: true, isDefinition: true)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = !{i32 1, !"Debug Info Version", i32 3}
+!10 = distinct !DISubprogram(name: "get1", scope: !3, file: !3, line: 5, type: !11, isLocal: false, isDefinition: true, scopeLine: 5, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !13)
+!11 = !DISubroutineType(types: !12)
+!12 = !{!8}
+!13 = !{!14, !15}
+!14 = !DILocalVariable(name: "a", arg: 1, scope: !10, file: !3, line: 5, type: !8)
+!15 = !DILocalVariable(name: "b", scope: !16, file: !3, line: 5, type: !8)
+!16 = distinct !DILexicalBlock(scope: !10, file: !3, line: 5, column: 19)
+!17 = !DIExpression()
+!18 = !DILocation(line: 5, column: 16, scope: !10)
+!19 = !DILocation(line: 5, column: 32, scope: !16)
+!20 = distinct !DISubprogram(name: "get2", scope: !3, file: !3, line: 8, type: !11, isLocal: false, isDefinition: true, scopeLine: 8, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !21)
+!21 = !{!22, !23}
+!22 = !DILocalVariable(name: "a", arg: 1, scope: !20, file: !3, line: 8, type: !8)
+!23 = !DILocalVariable(name: "b", scope: !24, file: !3, line: 8, type: !8)
+!24 = distinct !DILexicalBlock(scope: !20, file: !3, line: 8, column: 17)
+!25 = !DILocation(line: 8, column: 14, scope: !20)
+!26 = !DILocation(line: 8, column: 29, scope: !24)
+!27 = distinct !DISubprogram(name: "get3", scope: !3, file: !3, line: 11, type: !11, isLocal: false, isDefinition: true, scopeLine: 11, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !28)
+!28 = !{!29, !30}
+!29 = !DILocalVariable(name: "a", arg: 1, scope: !27, file: !3, line: 11, type: !8)
+!30 = !DILocalVariable(name: "b", scope: !31, file: !3, line: 11, type: !8)
+!31 = distinct !DILexicalBlock(scope: !27, file: !3, line: 11, column: 19)
+!32 = !DILocation(line: 11, column: 16, scope: !27)
+!33 = !DILocation(line: 11, column: 32, scope: !31)
+!34 = distinct !DISubprogram(name: "get4", scope: !3, file: !3, line: 14, type: !11, isLocal: false, isDefinition: true, scopeLine: 14, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !35)
+!35 = !{!36, !37}
+!36 = !DILocalVariable(name: "a", arg: 1, scope: !34, file: !3, line: 14, type: !8)
+!37 = !DILocalVariable(name: "b", scope: !38, file: !3, line: 14, type: !8)
+!38 = distinct !DILexicalBlock(scope: !34, file: !3, line: 14, column: 19)
+!39 = !DILocation(line: 14, column: 16, scope: !34)
+!40 = !DILocation(line: 14, column: 32, scope: !38)
+!41 = distinct !DISubprogram(name: "get5", scope: !3, file: !3, line: 17, type: !11, isLocal: false, isDefinition: true, scopeLine: 17, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !42)
+!42 = !{!43, !44}
+!43 = !DILocalVariable(name: "a", arg: 1, scope: !41, file: !3, line: 17, type: !8)
+!44 = !DILocalVariable(name: "b", scope: !45, file: !3, line: 17, type: !8)
+!45 = distinct !DILexicalBlock(scope: !41, file: !3, line: 17, column: 19)
+!46 = !DILocation(line: 17, column: 16, scope: !41)
+!47 = !DILocation(line: 17, column: 32, scope: !45)
+

+ 49 - 44
test/CodeGen/ARM/coalesce-dbgvalue.ll

@@ -6,18 +6,19 @@
 ; instruction which must be updated during
 ; ConnectedVNInfoEqClasses::Distribute().
 
+source_filename = "test/CodeGen/ARM/coalesce-dbgvalue.ll"
 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
 target triple = "thumbv7-apple-ios3.0.0"
 
-@c = common global i32 0, align 4, !dbg !19
-@b = common global i32 0, align 4, !dbg !18
-@a = common global i64 0, align 8, !dbg !16
-@d = common global i32 0, align 4, !dbg !20
+@c = common global i32 0, align 4, !dbg !0
+@b = common global i32 0, align 4, !dbg !4
+@a = common global i64 0, align 8, !dbg !6
+@d = common global i32 0, align 4, !dbg !9
 
 ; Function Attrs: nounwind ssp
-define i32 @pr16110() #0 !dbg !4 {
+define i32 @pr16110() #0 !dbg !15 {
 for.cond1.preheader:
-  store i32 0, i32* @c, align 4, !dbg !21
+  store i32 0, i32* @c, align 4, !dbg !24
   br label %for.cond1.outer, !dbg !26
 
 for.cond1:                                        ; preds = %for.end9, %for.cond1.outer
@@ -27,11 +28,11 @@ for.cond1:                                        ; preds = %for.end9, %for.cond
 
 for.body2:                                        ; preds = %for.cond1
   store i32 %storemerge11, i32* @b, align 4, !dbg !26
-  tail call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !11, metadata !DIExpression()), !dbg !28
+  tail call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !20, metadata !27), !dbg !28
   %0 = load i64, i64* @a, align 8, !dbg !29
   %xor = xor i64 %0, %e.1.ph, !dbg !29
   %conv3 = trunc i64 %xor to i32, !dbg !29
-  tail call void @llvm.dbg.value(metadata i32 %conv3, i64 0, metadata !10, metadata !DIExpression()), !dbg !29
+  tail call void @llvm.dbg.value(metadata i32 %conv3, i64 0, metadata !19, metadata !27), !dbg !29
   %tobool4 = icmp eq i32 %conv3, 0, !dbg !29
   br i1 %tobool4, label %land.end, label %land.rhs, !dbg !29
 
@@ -52,16 +53,16 @@ land.end:                                         ; preds = %land.rhs, %for.body
 for.cond1.outer:                                  ; preds = %land.end, %for.cond1.preheader
   %storemerge11.ph = phi i32 [ %inc8, %land.end ], [ 0, %for.cond1.preheader ]
   %e.1.ph = phi i64 [ %phitmp, %land.end ], [ 0, %for.cond1.preheader ]
-  %3 = load i32, i32* @d, align 4, !dbg !31
-  %tobool10 = icmp eq i32 %3, 0, !dbg !31
+  %3 = load i32, i32* @d, align 4, !dbg !30
+  %tobool10 = icmp eq i32 %3, 0, !dbg !30
   br label %for.cond1
 
 for.end9:                                         ; preds = %for.cond1
-  br i1 %tobool10, label %if.end, label %for.cond1, !dbg !31
+  br i1 %tobool10, label %if.end, label %for.cond1, !dbg !30
 
 if.end:                                           ; preds = %for.end9
   store i32 %storemerge11, i32* @b, align 4, !dbg !26
-  ret i32 0, !dbg !32
+  ret i32 0, !dbg !31
 }
 
 declare i32 @fn2(...) #1
@@ -76,35 +77,39 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n
 attributes #2 = { nounwind readnone }
 attributes #3 = { nounwind }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!33}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 182024) (llvm/trunk 182023)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !15, imports: !2)
-!1 = !DIFile(filename: "pr16110.c", directory: "/d/b")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "pr16110", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !9)
-!5 = !DIFile(filename: "pr16110.c", directory: "/d/b")
-!6 = !DISubroutineType(types: !7)
-!7 = !{!8}
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !{!10, !11}
-!10 = !DILocalVariable(name: "e", line: 8, scope: !4, file: !5, type: !8)
-!11 = !DILocalVariable(name: "f", line: 13, scope: !12, file: !5, type: !14)
-!12 = distinct !DILexicalBlock(line: 12, column: 0, file: !1, scope: !13)
-!13 = distinct !DILexicalBlock(line: 12, column: 0, file: !1, scope: !4)
-!14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !8)
-!15 = !{!16, !18, !19, !20}
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !17))
-!17 = !DIBasicType(tag: DW_TAG_base_type, name: "long long int", size: 64, align: 32, encoding: DW_ATE_signed)
-!18 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8))
-!19 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8))
-!20 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "d", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8))
-!21 = !DILocation(line: 10, scope: !22)
-!22 = distinct !DILexicalBlock(line: 10, column: 0, file: !1, scope: !4)
-!26 = !DILocation(line: 12, scope: !13)
-!27 = !{i32* null}
-!28 = !DILocation(line: 13, scope: !12)
-!29 = !DILocation(line: 14, scope: !12)
-!31 = !DILocation(line: 16, scope: !4)
-!32 = !DILocation(line: 18, scope: !4)
-!33 = !{i32 1, !"Debug Info Version", i32 3}
+!llvm.dbg.cu = !{!11}
+!llvm.module.flags = !{!14}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "c", scope: null, file: !2, line: 3, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "pr16110.c", directory: "/d/b")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !8, isLocal: false, isDefinition: true)
+!8 = !DIBasicType(name: "long long int", size: 64, align: 32, encoding: DW_ATE_signed)
+!9 = !DIGlobalVariableExpression(var: !10)
+!10 = !DIGlobalVariable(name: "d", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!11 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.4 (trunk 182024) (llvm/trunk 182023)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !12, retainedTypes: !12, globals: !13, imports: !12)
+!12 = !{}
+!13 = !{!6, !4, !0, !9}
+!14 = !{i32 1, !"Debug Info Version", i32 3}
+!15 = distinct !DISubprogram(name: "pr16110", scope: !2, file: !2, line: 7, type: !16, isLocal: false, isDefinition: true, scopeLine: 7, virtualIndex: 6, isOptimized: true, unit: !11, variables: !18)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!3}
+!18 = !{!19, !20}
+!19 = !DILocalVariable(name: "e", scope: !15, file: !2, line: 8, type: !3)
+!20 = !DILocalVariable(name: "f", scope: !21, file: !2, line: 13, type: !23)
+!21 = distinct !DILexicalBlock(scope: !22, file: !2, line: 12)
+!22 = distinct !DILexicalBlock(scope: !15, file: !2, line: 12)
+!23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 32, align: 32)
+!24 = !DILocation(line: 10, scope: !25)
+!25 = distinct !DILexicalBlock(scope: !15, file: !2, line: 10)
+!26 = !DILocation(line: 12, scope: !22)
+!27 = !DIExpression()
+!28 = !DILocation(line: 13, scope: !21)
+!29 = !DILocation(line: 14, scope: !21)
+!30 = !DILocation(line: 16, scope: !15)
+!31 = !DILocation(line: 18, scope: !15)
+

+ 43 - 39
test/CodeGen/BPF/dwarfdump.ll

@@ -7,52 +7,56 @@ target triple = "bpf"
 
 @testprog.myvar_c = internal unnamed_addr global i32 0, align 4, !dbg !0
 
-define i32 @testprog(i32, i32) local_unnamed_addr #0 !dbg !1 {
-  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !10, metadata !15), !dbg !16
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !11, metadata !15), !dbg !17
-  %3 = load i32, i32* @testprog.myvar_c, align 4, !dbg !18, !tbaa !19
-  %4 = add i32 %1, %0, !dbg !23
-  %5 = add i32 %4, %3, !dbg !24
-  store i32 %5, i32* @testprog.myvar_c, align 4, !dbg !25, !tbaa !19
-  ret i32 %5, !dbg !26
+; Function Attrs: nounwind
+define i32 @testprog(i32, i32) local_unnamed_addr #0 !dbg !2 {
+  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !11, metadata !16), !dbg !17
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !12, metadata !16), !dbg !18
+  %3 = load i32, i32* @testprog.myvar_c, align 4, !dbg !19, !tbaa !20
+  %4 = add i32 %1, %0, !dbg !24
+  %5 = add i32 %4, %3, !dbg !25
+  store i32 %5, i32* @testprog.myvar_c, align 4, !dbg !26, !tbaa !20
+  ret i32 %5, !dbg !27
 }
 
+; Function Attrs: nounwind readnone
 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 
 attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "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" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!6}
-!llvm.module.flags = !{!12, !13}
-!llvm.ident = !{!14}
-
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "myvar_c", scope: !1, file: !2, line: 3, type: !5, isLocal: true, isDefinition: true))
-!1 = distinct !DISubprogram(name: "testprog", scope: !2, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !6, variables: !9)
-!2 = !DIFile(filename: "testprog.c", directory: "/w/llvm/bld")
-!3 = !DISubroutineType(types: !4)
-!4 = !{!5, !5, !5}
-!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (trunk 287518) (llvm/trunk 287520)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !7, globals: !8)
-!7 = !{}
-!8 = !{!0}
-!9 = !{!10, !11}
-!10 = !DILocalVariable(name: "myvar_a", arg: 1, scope: !1, file: !2, line: 1, type: !5)
-!11 = !DILocalVariable(name: "myvar_b", arg: 2, scope: !1, file: !2, line: 1, type: !5)
-!12 = !{i32 2, !"Dwarf Version", i32 4}
-!13 = !{i32 2, !"Debug Info Version", i32 3}
-!14 = !{!"clang version 4.0.0 (trunk 287518) (llvm/trunk 287520)"}
-!15 = !DIExpression()
-!16 = !DILocation(line: 1, column: 18, scope: !1)
-!17 = !DILocation(line: 1, column: 31, scope: !1)
-!18 = !DILocation(line: 5, column: 19, scope: !1)
-!19 = !{!20, !20, i64 0}
-!20 = !{!"int", !21, i64 0}
-!21 = !{!"omnipotent char", !22, i64 0}
-!22 = !{!"Simple C/C++ TBAA"}
-!23 = !DILocation(line: 5, column: 27, scope: !1)
-!24 = !DILocation(line: 7, column: 27, scope: !1)
-!25 = !DILocation(line: 7, column: 17, scope: !1)
-!26 = !DILocation(line: 9, column: 9, scope: !1)
+!llvm.dbg.cu = !{!7}
+!llvm.module.flags = !{!13, !14}
+!llvm.ident = !{!15}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "myvar_c", scope: !2, file: !3, line: 3, type: !6, isLocal: true, isDefinition: true)
+!2 = distinct !DISubprogram(name: "testprog", scope: !3, file: !3, line: 1, type: !4, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !7, variables: !10)
+!3 = !DIFile(filename: "testprog.c", directory: "/w/llvm/bld")
+!4 = !DISubroutineType(types: !5)
+!5 = !{!6, !6, !6}
+!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!7 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 (trunk 287518) (llvm/trunk 287520)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !8, globals: !9)
+!8 = !{}
+!9 = !{!0}
+!10 = !{!11, !12}
+!11 = !DILocalVariable(name: "myvar_a", arg: 1, scope: !2, file: !3, line: 1, type: !6)
+!12 = !DILocalVariable(name: "myvar_b", arg: 2, scope: !2, file: !3, line: 1, type: !6)
+!13 = !{i32 2, !"Dwarf Version", i32 4}
+!14 = !{i32 2, !"Debug Info Version", i32 3}
+!15 = !{!"clang version 4.0.0 (trunk 287518) (llvm/trunk 287520)"}
+!16 = !DIExpression()
+!17 = !DILocation(line: 1, column: 18, scope: !2)
+!18 = !DILocation(line: 1, column: 31, scope: !2)
+!19 = !DILocation(line: 5, column: 19, scope: !2)
+!20 = !{!21, !21, i64 0}
+!21 = !{!"int", !22, i64 0}
+!22 = !{!"omnipotent char", !23, i64 0}
+!23 = !{!"Simple C/C++ TBAA"}
+!24 = !DILocation(line: 5, column: 27, scope: !2)
+!25 = !DILocation(line: 7, column: 27, scope: !2)
+!26 = !DILocation(line: 7, column: 17, scope: !2)
+!27 = !DILocation(line: 9, column: 9, scope: !2)
+
 ; CHECK: file_names[  1]    0 0x00000000 0x00000000 testprog.c
 ; CHECK: 0x0000000000000000      2
 ; CHECK: 0x0000000000000020      7

+ 330 - 483
test/CodeGen/PowerPC/pr17168.ll

@@ -3,46 +3,49 @@
 ; This test formerly failed due to a DBG_VALUE being placed prior to a PHI
 ; when fast-isel is partially successful before punting to DAG-isel.
 
+source_filename = "test/CodeGen/PowerPC/pr17168.ll"
 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-f128:128:128-v128:128:128-n32:64"
 target triple = "powerpc64-unknown-linux-gnu"
 
-@grid_points = external global [3 x i32], align 4, !dbg !299
+@grid_points = external global [3 x i32], align 4, !dbg !0
 
 ; Function Attrs: nounwind
-define fastcc void @compute_rhs() #0 !dbg !114 {
+define fastcc void @compute_rhs() #0 !dbg !263 {
 entry:
-  br i1 undef, label %for.cond871.preheader.for.inc960_crit_edge, label %for.end1042, !dbg !439
+  br i1 undef, label %for.cond871.preheader.for.inc960_crit_edge, label %for.end1042, !dbg !281
 
 for.cond871.preheader.for.inc960_crit_edge:       ; preds = %for.cond871.preheader.for.inc960_crit_edge, %entry
-  br i1 false, label %for.cond871.preheader.for.inc960_crit_edge, label %for.cond964.preheader, !dbg !439
+  br i1 false, label %for.cond871.preheader.for.inc960_crit_edge, label %for.cond964.preheader, !dbg !281
 
 for.cond964.preheader:                            ; preds = %for.cond871.preheader.for.inc960_crit_edge
-  br i1 undef, label %for.cond968.preheader, label %for.end1042, !dbg !441
+  br i1 undef, label %for.cond968.preheader, label %for.end1042, !dbg !283
 
 for.cond968.preheader:                            ; preds = %for.cond968.preheader, %for.cond964.preheader
-  br i1 false, label %for.cond968.preheader, label %for.end1042, !dbg !441
+  br i1 false, label %for.cond968.preheader, label %for.end1042, !dbg !283
 
 for.end1042:                                      ; preds = %for.cond968.preheader, %for.cond964.preheader, %entry
+
   %0 = phi i32 [ undef, %for.cond964.preheader ], [ undef, %for.cond968.preheader ], [ undef, %entry ]
-  %1 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @grid_points, i64 0, i64 0), align 4, !dbg !443, !tbaa !444
-  tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !119, metadata !DIExpression()), !dbg !448
-  %sub10454270 = add nsw i32 %0, -1, !dbg !448
-  %cmp10464271 = icmp sgt i32 %sub10454270, 1, !dbg !448
-  %sub11134263 = add nsw i32 %1, -1, !dbg !450
-  %cmp11144264 = icmp sgt i32 %sub11134263, 1, !dbg !450
-  br i1 %cmp11144264, label %for.cond1116.preheader, label %for.cond1816.preheader.for.inc1898_crit_edge, !dbg !450
+  %1 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @grid_points, i64 0, i64 0), align 4, !dbg !285, !tbaa !286
+  tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !268, metadata !290), !dbg !291
+  %sub10454270 = add nsw i32 %0, -1, !dbg !291
+  %cmp10464271 = icmp sgt i32 %sub10454270, 1, !dbg !291
+  %sub11134263 = add nsw i32 %1, -1, !dbg !293
+  %cmp11144264 = icmp sgt i32 %sub11134263, 1, !dbg !293
+  br i1 %cmp11144264, label %for.cond1116.preheader, label %for.cond1816.preheader.for.inc1898_crit_edge, !dbg !293
 
 for.cond1116.preheader:                           ; preds = %for.inc1658, %for.end1042
-  br i1 %cmp10464271, label %for.body1123, label %for.inc1658, !dbg !452
+  br i1 %cmp10464271, label %for.body1123, label %for.inc1658, !dbg !295
 
 for.body1123:                                     ; preds = %for.body1123, %for.cond1116.preheader
-  br label %for.body1123, !dbg !455
+
+  br label %for.body1123, !dbg !298
 
 for.inc1658:                                      ; preds = %for.cond1116.preheader
-  br i1 undef, label %for.cond1116.preheader, label %for.cond1816.preheader.for.inc1898_crit_edge, !dbg !450
+  br i1 undef, label %for.cond1116.preheader, label %for.cond1816.preheader.for.inc1898_crit_edge, !dbg !293
 
 for.cond1816.preheader.for.inc1898_crit_edge:     ; preds = %for.cond1816.preheader.for.inc1898_crit_edge, %for.inc1658, %for.end1042
-  br label %for.cond1816.preheader.for.inc1898_crit_edge, !dbg !458
+  br label %for.cond1816.preheader.for.inc1898_crit_edge, !dbg !301
 }
 
 ; Function Attrs: nounwind readnone
@@ -51,470 +54,314 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 attributes #0 = { nounwind "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!438, !464}
+!llvm.dbg.cu = !{!7}
+!llvm.module.flags = !{!261, !262}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "grid_points", scope: null, file: !2, line: 28, type: !3, isLocal: true, isDefinition: true)
+!2 = !DIFile(filename: "./header.h", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
+!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 96, align: 32, elements: !5)
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = !{!6}
+!6 = !DISubrange(count: 3)
+!7 = distinct !DICompileUnit(language: DW_LANG_C99, file: !8, producer: "clang version 3.4 (trunk 190311)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !9, globals: !10, imports: !9)
+!8 = !DIFile(filename: "bt.c", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
+!9 = !{}
+!10 = !{!0, !11, !14, !20, !22, !24, !26, !28, !30, !32, !34, !36, !38, !40, !42, !44, !46, !48, !50, !52, !54, !56, !58, !60, !62, !64, !66, !68, !70, !72, !74, !76, !78, !80, !82, !84, !86, !88, !93, !97, !99, !101, !103, !105, !107, !109, !114, !116, !118, !120, !122, !124, !126, !128, !130, !132, !134, !136, !138, !140, !142, !144, !146, !148, !150, !152, !154, !156, !158, !160, !162, !164, !166, !168, !170, !172, !174, !176, !178, !180, !182, !184, !186, !188, !190, !192, !194, !196, !198, !200, !202, !204, !206, !208, !210, !212, !214, !216, !218, !220, !222, !224, !226, !228, !230, !232, !236, !241, !243, !247, !249, !253, !255, !257, !259}
+!11 = !DIGlobalVariableExpression(var: !12)
+!12 = !DIGlobalVariable(name: "dt", scope: null, file: !2, line: 35, type: !13, isLocal: true, isDefinition: true)
+!13 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
+!14 = !DIGlobalVariableExpression(var: !15)
+!15 = !DIGlobalVariable(name: "rhs", scope: null, file: !2, line: 68, type: !16, isLocal: true, isDefinition: true)
+!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 1385839040, align: 64, elements: !17)
+!17 = !{!18, !18, !18, !19}
+!18 = !DISubrange(count: 163)
+!19 = !DISubrange(count: 5)
+!20 = !DIGlobalVariableExpression(var: !21)
+!21 = !DIGlobalVariable(name: "zzcon5", scope: null, file: !2, line: 42, type: !13, isLocal: true, isDefinition: true)
+!22 = !DIGlobalVariableExpression(var: !23)
+!23 = !DIGlobalVariable(name: "zzcon4", scope: null, file: !2, line: 42, type: !13, isLocal: true, isDefinition: true)
+!24 = !DIGlobalVariableExpression(var: !25)
+!25 = !DIGlobalVariable(name: "zzcon3", scope: null, file: !2, line: 42, type: !13, isLocal: true, isDefinition: true)
+!26 = !DIGlobalVariableExpression(var: !27)
+!27 = !DIGlobalVariable(name: "dz5tz1", scope: null, file: !2, line: 43, type: !13, isLocal: true, isDefinition: true)
+!28 = !DIGlobalVariableExpression(var: !29)
+!29 = !DIGlobalVariable(name: "dz4tz1", scope: null, file: !2, line: 43, type: !13, isLocal: true, isDefinition: true)
+!30 = !DIGlobalVariableExpression(var: !31)
+!31 = !DIGlobalVariable(name: "dz3tz1", scope: null, file: !2, line: 43, type: !13, isLocal: true, isDefinition: true)
+!32 = !DIGlobalVariableExpression(var: !33)
+!33 = !DIGlobalVariable(name: "zzcon2", scope: null, file: !2, line: 42, type: !13, isLocal: true, isDefinition: true)
+!34 = !DIGlobalVariableExpression(var: !35)
+!35 = !DIGlobalVariable(name: "dz2tz1", scope: null, file: !2, line: 43, type: !13, isLocal: true, isDefinition: true)
+!36 = !DIGlobalVariableExpression(var: !37)
+!37 = !DIGlobalVariable(name: "tz2", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!38 = !DIGlobalVariableExpression(var: !39)
+!39 = !DIGlobalVariable(name: "dz1tz1", scope: null, file: !2, line: 43, type: !13, isLocal: true, isDefinition: true)
+!40 = !DIGlobalVariableExpression(var: !41)
+!41 = !DIGlobalVariable(name: "yycon5", scope: null, file: !2, line: 40, type: !13, isLocal: true, isDefinition: true)
+!42 = !DIGlobalVariableExpression(var: !43)
+!43 = !DIGlobalVariable(name: "yycon4", scope: null, file: !2, line: 40, type: !13, isLocal: true, isDefinition: true)
+!44 = !DIGlobalVariableExpression(var: !45)
+!45 = !DIGlobalVariable(name: "yycon3", scope: null, file: !2, line: 40, type: !13, isLocal: true, isDefinition: true)
+!46 = !DIGlobalVariableExpression(var: !47)
+!47 = !DIGlobalVariable(name: "dy5ty1", scope: null, file: !2, line: 41, type: !13, isLocal: true, isDefinition: true)
+!48 = !DIGlobalVariableExpression(var: !49)
+!49 = !DIGlobalVariable(name: "dy4ty1", scope: null, file: !2, line: 41, type: !13, isLocal: true, isDefinition: true)
+!50 = !DIGlobalVariableExpression(var: !51)
+!51 = !DIGlobalVariable(name: "dy3ty1", scope: null, file: !2, line: 41, type: !13, isLocal: true, isDefinition: true)
+!52 = !DIGlobalVariableExpression(var: !53)
+!53 = !DIGlobalVariable(name: "yycon2", scope: null, file: !2, line: 40, type: !13, isLocal: true, isDefinition: true)
+!54 = !DIGlobalVariableExpression(var: !55)
+!55 = !DIGlobalVariable(name: "dy2ty1", scope: null, file: !2, line: 41, type: !13, isLocal: true, isDefinition: true)
+!56 = !DIGlobalVariableExpression(var: !57)
+!57 = !DIGlobalVariable(name: "ty2", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!58 = !DIGlobalVariableExpression(var: !59)
+!59 = !DIGlobalVariable(name: "dy1ty1", scope: null, file: !2, line: 41, type: !13, isLocal: true, isDefinition: true)
+!60 = !DIGlobalVariableExpression(var: !61)
+!61 = !DIGlobalVariable(name: "dssp", scope: null, file: !2, line: 35, type: !13, isLocal: true, isDefinition: true)
+!62 = !DIGlobalVariableExpression(var: !63)
+!63 = !DIGlobalVariable(name: "c1", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!64 = !DIGlobalVariableExpression(var: !65)
+!65 = !DIGlobalVariable(name: "xxcon5", scope: null, file: !2, line: 38, type: !13, isLocal: true, isDefinition: true)
+!66 = !DIGlobalVariableExpression(var: !67)
+!67 = !DIGlobalVariable(name: "xxcon4", scope: null, file: !2, line: 38, type: !13, isLocal: true, isDefinition: true)
+!68 = !DIGlobalVariableExpression(var: !69)
+!69 = !DIGlobalVariable(name: "xxcon3", scope: null, file: !2, line: 38, type: !13, isLocal: true, isDefinition: true)
+!70 = !DIGlobalVariableExpression(var: !71)
+!71 = !DIGlobalVariable(name: "dx5tx1", scope: null, file: !2, line: 39, type: !13, isLocal: true, isDefinition: true)
+!72 = !DIGlobalVariableExpression(var: !73)
+!73 = !DIGlobalVariable(name: "dx4tx1", scope: null, file: !2, line: 39, type: !13, isLocal: true, isDefinition: true)
+!74 = !DIGlobalVariableExpression(var: !75)
+!75 = !DIGlobalVariable(name: "dx3tx1", scope: null, file: !2, line: 39, type: !13, isLocal: true, isDefinition: true)
+!76 = !DIGlobalVariableExpression(var: !77)
+!77 = !DIGlobalVariable(name: "c2", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!78 = !DIGlobalVariableExpression(var: !79)
+!79 = !DIGlobalVariable(name: "con43", scope: null, file: !2, line: 48, type: !13, isLocal: true, isDefinition: true)
+!80 = !DIGlobalVariableExpression(var: !81)
+!81 = !DIGlobalVariable(name: "xxcon2", scope: null, file: !2, line: 38, type: !13, isLocal: true, isDefinition: true)
+!82 = !DIGlobalVariableExpression(var: !83)
+!83 = !DIGlobalVariable(name: "dx2tx1", scope: null, file: !2, line: 39, type: !13, isLocal: true, isDefinition: true)
+!84 = !DIGlobalVariableExpression(var: !85)
+!85 = !DIGlobalVariable(name: "tx2", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!86 = !DIGlobalVariableExpression(var: !87)
+!87 = !DIGlobalVariable(name: "dx1tx1", scope: null, file: !2, line: 39, type: !13, isLocal: true, isDefinition: true)
+!88 = !DIGlobalVariableExpression(var: !89)
+!89 = !DIGlobalVariable(name: "forcing", scope: null, file: !2, line: 66, type: !90, isLocal: true, isDefinition: true)
+!90 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 1663006848, align: 64, elements: !91)
+!91 = !{!18, !18, !18, !92}
+!92 = !DISubrange(count: 6)
+!93 = !DIGlobalVariableExpression(var: !94)
+!94 = !DIGlobalVariable(name: "qs", scope: null, file: !2, line: 63, type: !95, isLocal: true, isDefinition: true)
+!95 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 277167808, align: 64, elements: !96)
+!96 = !{!18, !18, !18}
+!97 = !DIGlobalVariableExpression(var: !98)
+!98 = !DIGlobalVariable(name: "square", scope: null, file: !2, line: 65, type: !95, isLocal: true, isDefinition: true)
+!99 = !DIGlobalVariableExpression(var: !100)
+!100 = !DIGlobalVariable(name: "ws", scope: null, file: !2, line: 62, type: !95, isLocal: true, isDefinition: true)
+!101 = !DIGlobalVariableExpression(var: !102)
+!102 = !DIGlobalVariable(name: "vs", scope: null, file: !2, line: 61, type: !95, isLocal: true, isDefinition: true)
+!103 = !DIGlobalVariableExpression(var: !104)
+!104 = !DIGlobalVariable(name: "us", scope: null, file: !2, line: 60, type: !95, isLocal: true, isDefinition: true)
+!105 = !DIGlobalVariableExpression(var: !106)
+!106 = !DIGlobalVariable(name: "rho_i", scope: null, file: !2, line: 64, type: !95, isLocal: true, isDefinition: true)
+!107 = !DIGlobalVariableExpression(var: !108)
+!108 = !DIGlobalVariable(name: "u", scope: null, file: !2, line: 67, type: !16, isLocal: true, isDefinition: true)
+!109 = !DIGlobalVariableExpression(var: !110)
+!110 = !DIGlobalVariable(name: "ce", scope: null, file: !2, line: 36, type: !111, isLocal: true, isDefinition: true)
+!111 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 4160, align: 64, elements: !112)
+!112 = !{!19, !113}
+!113 = !DISubrange(count: 13)
+!114 = !DIGlobalVariableExpression(var: !115)
+!115 = !DIGlobalVariable(name: "dnzm1", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!116 = !DIGlobalVariableExpression(var: !117)
+!117 = !DIGlobalVariable(name: "dnym1", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!118 = !DIGlobalVariableExpression(var: !119)
+!119 = !DIGlobalVariable(name: "dnxm1", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!120 = !DIGlobalVariableExpression(var: !121)
+!121 = !DIGlobalVariable(name: "zzcon1", scope: null, file: !2, line: 42, type: !13, isLocal: true, isDefinition: true)
+!122 = !DIGlobalVariableExpression(var: !123)
+!123 = !DIGlobalVariable(name: "yycon1", scope: null, file: !2, line: 40, type: !13, isLocal: true, isDefinition: true)
+!124 = !DIGlobalVariableExpression(var: !125)
+!125 = !DIGlobalVariable(name: "xxcon1", scope: null, file: !2, line: 38, type: !13, isLocal: true, isDefinition: true)
+!126 = !DIGlobalVariableExpression(var: !127)
+!127 = !DIGlobalVariable(name: "con16", scope: null, file: !2, line: 48, type: !13, isLocal: true, isDefinition: true)
+!128 = !DIGlobalVariableExpression(var: !129)
+!129 = !DIGlobalVariable(name: "c2iv", scope: null, file: !2, line: 48, type: !13, isLocal: true, isDefinition: true)
+!130 = !DIGlobalVariableExpression(var: !131)
+!131 = !DIGlobalVariable(name: "c3c4tz3", scope: null, file: !2, line: 48, type: !13, isLocal: true, isDefinition: true)
+!132 = !DIGlobalVariableExpression(var: !133)
+!133 = !DIGlobalVariable(name: "c3c4ty3", scope: null, file: !2, line: 48, type: !13, isLocal: true, isDefinition: true)
+!134 = !DIGlobalVariableExpression(var: !135)
+!135 = !DIGlobalVariable(name: "c3c4tx3", scope: null, file: !2, line: 48, type: !13, isLocal: true, isDefinition: true)
+!136 = !DIGlobalVariableExpression(var: !137)
+!137 = !DIGlobalVariable(name: "comz6", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!138 = !DIGlobalVariableExpression(var: !139)
+!139 = !DIGlobalVariable(name: "comz5", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!140 = !DIGlobalVariableExpression(var: !141)
+!141 = !DIGlobalVariable(name: "comz4", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!142 = !DIGlobalVariableExpression(var: !143)
+!143 = !DIGlobalVariable(name: "comz1", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!144 = !DIGlobalVariableExpression(var: !145)
+!145 = !DIGlobalVariable(name: "dtdssp", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!146 = !DIGlobalVariableExpression(var: !147)
+!147 = !DIGlobalVariable(name: "c2dttz1", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!148 = !DIGlobalVariableExpression(var: !149)
+!149 = !DIGlobalVariable(name: "c2dtty1", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!150 = !DIGlobalVariableExpression(var: !151)
+!151 = !DIGlobalVariable(name: "c2dttx1", scope: null, file: !2, line: 47, type: !13, isLocal: true, isDefinition: true)
+!152 = !DIGlobalVariableExpression(var: !153)
+!153 = !DIGlobalVariable(name: "dttz2", scope: null, file: !2, line: 46, type: !13, isLocal: true, isDefinition: true)
+!154 = !DIGlobalVariableExpression(var: !155)
+!155 = !DIGlobalVariable(name: "dttz1", scope: null, file: !2, line: 46, type: !13, isLocal: true, isDefinition: true)
+!156 = !DIGlobalVariableExpression(var: !157)
+!157 = !DIGlobalVariable(name: "dtty2", scope: null, file: !2, line: 46, type: !13, isLocal: true, isDefinition: true)
+!158 = !DIGlobalVariableExpression(var: !159)
+!159 = !DIGlobalVariable(name: "dtty1", scope: null, file: !2, line: 46, type: !13, isLocal: true, isDefinition: true)
+!160 = !DIGlobalVariableExpression(var: !161)
+!161 = !DIGlobalVariable(name: "dttx2", scope: null, file: !2, line: 46, type: !13, isLocal: true, isDefinition: true)
+!162 = !DIGlobalVariableExpression(var: !163)
+!163 = !DIGlobalVariable(name: "dttx1", scope: null, file: !2, line: 46, type: !13, isLocal: true, isDefinition: true)
+!164 = !DIGlobalVariableExpression(var: !165)
+!165 = !DIGlobalVariable(name: "c5dssp", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!166 = !DIGlobalVariableExpression(var: !167)
+!167 = !DIGlobalVariable(name: "c4dssp", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!168 = !DIGlobalVariableExpression(var: !169)
+!169 = !DIGlobalVariable(name: "dzmax", scope: null, file: !2, line: 37, type: !13, isLocal: true, isDefinition: true)
+!170 = !DIGlobalVariableExpression(var: !171)
+!171 = !DIGlobalVariable(name: "dymax", scope: null, file: !2, line: 37, type: !13, isLocal: true, isDefinition: true)
+!172 = !DIGlobalVariableExpression(var: !173)
+!173 = !DIGlobalVariable(name: "dxmax", scope: null, file: !2, line: 37, type: !13, isLocal: true, isDefinition: true)
+!174 = !DIGlobalVariableExpression(var: !175)
+!175 = !DIGlobalVariable(name: "dz5", scope: null, file: !2, line: 34, type: !13, isLocal: true, isDefinition: true)
+!176 = !DIGlobalVariableExpression(var: !177)
+!177 = !DIGlobalVariable(name: "dz4", scope: null, file: !2, line: 34, type: !13, isLocal: true, isDefinition: true)
+!178 = !DIGlobalVariableExpression(var: !179)
+!179 = !DIGlobalVariable(name: "dz3", scope: null, file: !2, line: 34, type: !13, isLocal: true, isDefinition: true)
+!180 = !DIGlobalVariableExpression(var: !181)
+!181 = !DIGlobalVariable(name: "dz2", scope: null, file: !2, line: 34, type: !13, isLocal: true, isDefinition: true)
+!182 = !DIGlobalVariableExpression(var: !183)
+!183 = !DIGlobalVariable(name: "dz1", scope: null, file: !2, line: 34, type: !13, isLocal: true, isDefinition: true)
+!184 = !DIGlobalVariableExpression(var: !185)
+!185 = !DIGlobalVariable(name: "dy5", scope: null, file: !2, line: 33, type: !13, isLocal: true, isDefinition: true)
+!186 = !DIGlobalVariableExpression(var: !187)
+!187 = !DIGlobalVariable(name: "dy4", scope: null, file: !2, line: 33, type: !13, isLocal: true, isDefinition: true)
+!188 = !DIGlobalVariableExpression(var: !189)
+!189 = !DIGlobalVariable(name: "dy3", scope: null, file: !2, line: 33, type: !13, isLocal: true, isDefinition: true)
+!190 = !DIGlobalVariableExpression(var: !191)
+!191 = !DIGlobalVariable(name: "dy2", scope: null, file: !2, line: 33, type: !13, isLocal: true, isDefinition: true)
+!192 = !DIGlobalVariableExpression(var: !193)
+!193 = !DIGlobalVariable(name: "dy1", scope: null, file: !2, line: 33, type: !13, isLocal: true, isDefinition: true)
+!194 = !DIGlobalVariableExpression(var: !195)
+!195 = !DIGlobalVariable(name: "dx5", scope: null, file: !2, line: 32, type: !13, isLocal: true, isDefinition: true)
+!196 = !DIGlobalVariableExpression(var: !197)
+!197 = !DIGlobalVariable(name: "dx4", scope: null, file: !2, line: 32, type: !13, isLocal: true, isDefinition: true)
+!198 = !DIGlobalVariableExpression(var: !199)
+!199 = !DIGlobalVariable(name: "dx3", scope: null, file: !2, line: 32, type: !13, isLocal: true, isDefinition: true)
+!200 = !DIGlobalVariableExpression(var: !201)
+!201 = !DIGlobalVariable(name: "dx2", scope: null, file: !2, line: 32, type: !13, isLocal: true, isDefinition: true)
+!202 = !DIGlobalVariableExpression(var: !203)
+!203 = !DIGlobalVariable(name: "dx1", scope: null, file: !2, line: 32, type: !13, isLocal: true, isDefinition: true)
+!204 = !DIGlobalVariableExpression(var: !205)
+!205 = !DIGlobalVariable(name: "tz3", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!206 = !DIGlobalVariableExpression(var: !207)
+!207 = !DIGlobalVariable(name: "tz1", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!208 = !DIGlobalVariableExpression(var: !209)
+!209 = !DIGlobalVariable(name: "ty3", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!210 = !DIGlobalVariableExpression(var: !211)
+!211 = !DIGlobalVariable(name: "ty1", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!212 = !DIGlobalVariableExpression(var: !213)
+!213 = !DIGlobalVariable(name: "tx3", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!214 = !DIGlobalVariableExpression(var: !215)
+!215 = !DIGlobalVariable(name: "tx1", scope: null, file: !2, line: 31, type: !13, isLocal: true, isDefinition: true)
+!216 = !DIGlobalVariableExpression(var: !217)
+!217 = !DIGlobalVariable(name: "conz1", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!218 = !DIGlobalVariableExpression(var: !219)
+!219 = !DIGlobalVariable(name: "c1345", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!220 = !DIGlobalVariableExpression(var: !221)
+!221 = !DIGlobalVariable(name: "c3c4", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!222 = !DIGlobalVariableExpression(var: !223)
+!223 = !DIGlobalVariable(name: "c1c5", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!224 = !DIGlobalVariableExpression(var: !225)
+!225 = !DIGlobalVariable(name: "c1c2", scope: null, file: !2, line: 44, type: !13, isLocal: true, isDefinition: true)
+!226 = !DIGlobalVariableExpression(var: !227)
+!227 = !DIGlobalVariable(name: "c5", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!228 = !DIGlobalVariableExpression(var: !229)
+!229 = !DIGlobalVariable(name: "c4", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!230 = !DIGlobalVariableExpression(var: !231)
+!231 = !DIGlobalVariable(name: "c3", scope: null, file: !2, line: 45, type: !13, isLocal: true, isDefinition: true)
+!232 = !DIGlobalVariableExpression(var: !233)
+!233 = !DIGlobalVariable(name: "lhs", scope: null, file: !2, line: 69, type: !234, isLocal: true, isDefinition: true)
+!234 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 20787585600, align: 64, elements: !235)
+!235 = !{!18, !18, !18, !6, !19, !19}
+!236 = !DIGlobalVariableExpression(var: !237)
+!237 = !DIGlobalVariable(name: "q", scope: null, file: !2, line: 73, type: !238, isLocal: true, isDefinition: true)
+!238 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 10368, align: 64, elements: !239)
+!239 = !{!240}
+!240 = !DISubrange(count: 162)
+!241 = !DIGlobalVariableExpression(var: !242)
+!242 = !DIGlobalVariable(name: "cuf", scope: null, file: !2, line: 72, type: !238, isLocal: true, isDefinition: true)
+!243 = !DIGlobalVariableExpression(var: !244)
+!244 = !DIGlobalVariable(name: "buf", scope: null, file: !2, line: 75, type: !245, isLocal: true, isDefinition: true)
+!245 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 51840, align: 64, elements: !246)
+!246 = !{!240, !19}
+!247 = !DIGlobalVariableExpression(var: !248)
+!248 = !DIGlobalVariable(name: "ue", scope: null, file: !2, line: 74, type: !245, isLocal: true, isDefinition: true)
+!249 = !DIGlobalVariableExpression(var: !250)
+!250 = !DIGlobalVariable(name: "njac", scope: null, file: !2, line: 86, type: !251, isLocal: true, isDefinition: true)
+!251 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 6886684800, align: 64, elements: !252)
+!252 = !{!18, !18, !240, !19, !19}
+!253 = !DIGlobalVariableExpression(var: !254)
+!254 = !DIGlobalVariable(name: "fjac", scope: null, file: !2, line: 84, type: !251, isLocal: true, isDefinition: true)
+!255 = !DIGlobalVariableExpression(var: !256)
+!256 = !DIGlobalVariable(name: "tmp3", scope: null, file: !2, line: 88, type: !13, isLocal: true, isDefinition: true)
+!257 = !DIGlobalVariableExpression(var: !258)
+!258 = !DIGlobalVariable(name: "tmp2", scope: null, file: !2, line: 88, type: !13, isLocal: true, isDefinition: true)
+!259 = !DIGlobalVariableExpression(var: !260)
+!260 = !DIGlobalVariable(name: "tmp1", scope: null, file: !2, line: 88, type: !13, isLocal: true, isDefinition: true)
+!261 = !{i32 2, !"Dwarf Version", i32 4}
+!262 = !{i32 1, !"Debug Info Version", i32 3}
+!263 = distinct !DISubprogram(name: "compute_rhs", scope: !8, file: !8, line: 1767, type: !264, isLocal: true, isDefinition: true, scopeLine: 1767, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !7, variables: !266)
+!264 = !DISubroutineType(types: !265)
+!265 = !{null}
+!266 = !{!267, !268, !269, !270, !271, !272, !273, !274, !275, !276, !277, !278, !279, !280}
+!267 = !DILocalVariable(name: "i", scope: !263, file: !8, line: 1769, type: !4)
+!268 = !DILocalVariable(name: "j", scope: !263, file: !8, line: 1769, type: !4)
+!269 = !DILocalVariable(name: "k", scope: !263, file: !8, line: 1769, type: !4)
+!270 = !DILocalVariable(name: "m", scope: !263, file: !8, line: 1769, type: !4)
+!271 = !DILocalVariable(name: "rho_inv", scope: !263, file: !8, line: 1770, type: !13)
+!272 = !DILocalVariable(name: "uijk", scope: !263, file: !8, line: 1770, type: !13)
+!273 = !DILocalVariable(name: "up1", scope: !263, file: !8, line: 1770, type: !13)
+!274 = !DILocalVariable(name: "um1", scope: !263, file: !8, line: 1770, type: !13)
+!275 = !DILocalVariable(name: "vijk", scope: !263, file: !8, line: 1770, type: !13)
+!276 = !DILocalVariable(name: "vp1", scope: !263, file: !8, line: 1770, type: !13)
+!277 = !DILocalVariable(name: "vm1", scope: !263, file: !8, line: 1770, type: !13)
+!278 = !DILocalVariable(name: "wijk", scope: !263, file: !8, line: 1770, type: !13)
+!279 = !DILocalVariable(name: "wp1", scope: !263, file: !8, line: 1770, type: !13)
+!280 = !DILocalVariable(name: "wm1", scope: !263, file: !8, line: 1770, type: !13)
+!281 = !DILocation(line: 1898, scope: !282)
+!282 = distinct !DILexicalBlock(scope: !263, file: !8, line: 1898)
+!283 = !DILocation(line: 1913, scope: !284)
+!284 = distinct !DILexicalBlock(scope: !263, file: !8, line: 1913)
+!285 = !DILocation(line: 1923, scope: !263)
+!286 = !{!287, !287, i64 0}
+!287 = !{!"int", !288}
+!288 = !{!"omnipotent char", !289}
+!289 = !{!"Simple C/C++ TBAA"}
+!290 = !DIExpression()
+!291 = !DILocation(line: 1925, scope: !292)
+!292 = distinct !DILexicalBlock(scope: !263, file: !8, line: 1925)
+!293 = !DILocation(line: 1939, scope: !294)
+!294 = distinct !DILexicalBlock(scope: !263, file: !8, line: 1939)
+!295 = !DILocation(line: 1940, scope: !296)
+!296 = distinct !DILexicalBlock(scope: !297, file: !8, line: 1940)
+!297 = distinct !DILexicalBlock(scope: !294, file: !8, line: 1939)
+!298 = !DILocation(line: 1941, scope: !299)
+!299 = distinct !DILexicalBlock(scope: !300, file: !8, line: 1941)
+!300 = distinct !DILexicalBlock(scope: !296, file: !8, line: 1940)
+!301 = !DILocation(line: 2020, scope: !302)
+!302 = distinct !DILexicalBlock(scope: !303, file: !8, line: 2020)
+!303 = distinct !DILexicalBlock(scope: !304, file: !8, line: 2019)
+!304 = distinct !DILexicalBlock(scope: !305, file: !8, line: 2019)
+!305 = distinct !DILexicalBlock(scope: !306, file: !8, line: 2018)
+!306 = distinct !DILexicalBlock(scope: !263, file: !8, line: 2018)
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 190311)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !298, imports: !2)
-!1 = !DIFile(filename: "bt.c", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "main", line: 74, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 74, file: !1, scope: !5, type: !6, variables: !12)
-!5 = !DIFile(filename: "bt.c", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
-!6 = !DISubroutineType(types: !7)
-!7 = !{!8, !8, !9}
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10)
-!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11)
-!11 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
-!12 = !{!13, !14, !15, !16, !17, !18, !19, !21, !22, !23, !25, !26}
-!13 = !DILocalVariable(name: "argc", line: 74, arg: 1, scope: !4, file: !5, type: !8)
-!14 = !DILocalVariable(name: "argv", line: 74, arg: 2, scope: !4, file: !5, type: !9)
-!15 = !DILocalVariable(name: "niter", line: 76, scope: !4, file: !5, type: !8)
-!16 = !DILocalVariable(name: "step", line: 76, scope: !4, file: !5, type: !8)
-!17 = !DILocalVariable(name: "n3", line: 76, scope: !4, file: !5, type: !8)
-!18 = !DILocalVariable(name: "nthreads", line: 77, scope: !4, file: !5, type: !8)
-!19 = !DILocalVariable(name: "navg", line: 78, scope: !4, file: !5, type: !20)
-!20 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
-!21 = !DILocalVariable(name: "mflops", line: 78, scope: !4, file: !5, type: !20)
-!22 = !DILocalVariable(name: "tmax", line: 80, scope: !4, file: !5, type: !20)
-!23 = !DILocalVariable(name: "verified", line: 81, scope: !4, file: !5, type: !24)
-!24 = !DIDerivedType(tag: DW_TAG_typedef, name: "boolean", line: 12, file: !1, baseType: !8)
-!25 = !DILocalVariable(name: "class", line: 82, scope: !4, file: !5, type: !11)
-!26 = !DILocalVariable(name: "fp", line: 83, scope: !4, file: !5, type: !27)
-!27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !28)
-!28 = !DIDerivedType(tag: DW_TAG_typedef, name: "FILE", line: 49, file: !1, baseType: !29)
-!29 = !DICompositeType(tag: DW_TAG_structure_type, name: "_IO_FILE", line: 271, size: 1728, align: 64, file: !30, elements: !31)
-!30 = !DIFile(filename: "/usr/include/libio.h", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
-!31 = !{!32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44, !52, !53, !54, !55, !58, !60, !62, !66, !68, !70, !71, !72, !73, !74, !77, !78}
-!32 = !DIDerivedType(tag: DW_TAG_member, name: "_flags", line: 272, size: 32, align: 32, file: !30, scope: !29, baseType: !8)
-!33 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_read_ptr", line: 277, size: 64, align: 64, offset: 64, file: !30, scope: !29, baseType: !10)
-!34 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_read_end", line: 278, size: 64, align: 64, offset: 128, file: !30, scope: !29, baseType: !10)
-!35 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_read_base", line: 279, size: 64, align: 64, offset: 192, file: !30, scope: !29, baseType: !10)
-!36 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_write_base", line: 280, size: 64, align: 64, offset: 256, file: !30, scope: !29, baseType: !10)
-!37 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_write_ptr", line: 281, size: 64, align: 64, offset: 320, file: !30, scope: !29, baseType: !10)
-!38 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_write_end", line: 282, size: 64, align: 64, offset: 384, file: !30, scope: !29, baseType: !10)
-!39 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_buf_base", line: 283, size: 64, align: 64, offset: 448, file: !30, scope: !29, baseType: !10)
-!40 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_buf_end", line: 284, size: 64, align: 64, offset: 512, file: !30, scope: !29, baseType: !10)
-!41 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_save_base", line: 286, size: 64, align: 64, offset: 576, file: !30, scope: !29, baseType: !10)
-!42 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_backup_base", line: 287, size: 64, align: 64, offset: 640, file: !30, scope: !29, baseType: !10)
-!43 = !DIDerivedType(tag: DW_TAG_member, name: "_IO_save_end", line: 288, size: 64, align: 64, offset: 704, file: !30, scope: !29, baseType: !10)
-!44 = !DIDerivedType(tag: DW_TAG_member, name: "_markers", line: 290, size: 64, align: 64, offset: 768, file: !30, scope: !29, baseType: !45)
-!45 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !46)
-!46 = !DICompositeType(tag: DW_TAG_structure_type, name: "_IO_marker", line: 186, size: 192, align: 64, file: !30, elements: !47)
-!47 = !{!48, !49, !51}
-!48 = !DIDerivedType(tag: DW_TAG_member, name: "_next", line: 187, size: 64, align: 64, file: !30, scope: !46, baseType: !45)
-!49 = !DIDerivedType(tag: DW_TAG_member, name: "_sbuf", line: 188, size: 64, align: 64, offset: 64, file: !30, scope: !46, baseType: !50)
-!50 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !29)
-!51 = !DIDerivedType(tag: DW_TAG_member, name: "_pos", line: 192, size: 32, align: 32, offset: 128, file: !30, scope: !46, baseType: !8)
-!52 = !DIDerivedType(tag: DW_TAG_member, name: "_chain", line: 292, size: 64, align: 64, offset: 832, file: !30, scope: !29, baseType: !50)
-!53 = !DIDerivedType(tag: DW_TAG_member, name: "_fileno", line: 294, size: 32, align: 32, offset: 896, file: !30, scope: !29, baseType: !8)
-!54 = !DIDerivedType(tag: DW_TAG_member, name: "_flags2", line: 298, size: 32, align: 32, offset: 928, file: !30, scope: !29, baseType: !8)
-!55 = !DIDerivedType(tag: DW_TAG_member, name: "_old_offset", line: 300, size: 64, align: 64, offset: 960, file: !30, scope: !29, baseType: !56)
-!56 = !DIDerivedType(tag: DW_TAG_typedef, name: "__off_t", line: 141, file: !30, baseType: !57)
-!57 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
-!58 = !DIDerivedType(tag: DW_TAG_member, name: "_cur_column", line: 304, size: 16, align: 16, offset: 1024, file: !30, scope: !29, baseType: !59)
-!59 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned short", size: 16, align: 16, encoding: DW_ATE_unsigned)
-!60 = !DIDerivedType(tag: DW_TAG_member, name: "_vtable_offset", line: 305, size: 8, align: 8, offset: 1040, file: !30, scope: !29, baseType: !61)
-!61 = !DIBasicType(tag: DW_TAG_base_type, name: "signed char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!62 = !DIDerivedType(tag: DW_TAG_member, name: "_shortbuf", line: 306, size: 8, align: 8, offset: 1048, file: !30, scope: !29, baseType: !63)
-!63 = !DICompositeType(tag: DW_TAG_array_type, size: 8, align: 8, baseType: !11, elements: !64)
-!64 = !{!65}
-!65 = !DISubrange(count: 1)
-!66 = !DIDerivedType(tag: DW_TAG_member, name: "_lock", line: 310, size: 64, align: 64, offset: 1088, file: !30, scope: !29, baseType: !67)
-!67 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
-!68 = !DIDerivedType(tag: DW_TAG_member, name: "_offset", line: 319, size: 64, align: 64, offset: 1152, file: !30, scope: !29, baseType: !69)
-!69 = !DIDerivedType(tag: DW_TAG_typedef, name: "__off64_t", line: 142, file: !30, baseType: !57)
-!70 = !DIDerivedType(tag: DW_TAG_member, name: "__pad1", line: 328, size: 64, align: 64, offset: 1216, file: !30, scope: !29, baseType: !67)
-!71 = !DIDerivedType(tag: DW_TAG_member, name: "__pad2", line: 329, size: 64, align: 64, offset: 1280, file: !30, scope: !29, baseType: !67)
-!72 = !DIDerivedType(tag: DW_TAG_member, name: "__pad3", line: 330, size: 64, align: 64, offset: 1344, file: !30, scope: !29, baseType: !67)
-!73 = !DIDerivedType(tag: DW_TAG_member, name: "__pad4", line: 331, size: 64, align: 64, offset: 1408, file: !30, scope: !29, baseType: !67)
-!74 = !DIDerivedType(tag: DW_TAG_member, name: "__pad5", line: 332, size: 64, align: 64, offset: 1472, file: !30, scope: !29, baseType: !75)
-!75 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", line: 42, file: !30, baseType: !76)
-!76 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
-!77 = !DIDerivedType(tag: DW_TAG_member, name: "_mode", line: 334, size: 32, align: 32, offset: 1536, file: !30, scope: !29, baseType: !8)
-!78 = !DIDerivedType(tag: DW_TAG_member, name: "_unused2", line: 336, size: 160, align: 8, offset: 1568, file: !30, scope: !29, baseType: !79)
-!79 = !DICompositeType(tag: DW_TAG_array_type, size: 160, align: 8, baseType: !11, elements: !80)
-!80 = !{!81}
-!81 = !DISubrange(count: 20)
-!82 = distinct !DISubprogram(name: "verify", line: 2388, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2388, file: !1, scope: !5, type: !83, variables: !86)
-!83 = !DISubroutineType(types: !84)
-!84 = !{null, !8, !10, !85}
-!85 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !24)
-!86 = !{!87, !88, !89, !90, !94, !95, !96, !97, !98, !99, !100, !101}
-!87 = !DILocalVariable(name: "no_time_steps", line: 2388, arg: 1, scope: !82, file: !5, type: !8)
-!88 = !DILocalVariable(name: "class", line: 2388, arg: 2, scope: !82, file: !5, type: !10)
-!89 = !DILocalVariable(name: "verified", line: 2388, arg: 3, scope: !82, file: !5, type: !85)
-!90 = !DILocalVariable(name: "xcrref", line: 2397, scope: !82, file: !5, type: !91)
-!91 = !DICompositeType(tag: DW_TAG_array_type, size: 320, align: 64, baseType: !20, elements: !92)
-!92 = !{!93}
-!93 = !DISubrange(count: 5)
-!94 = !DILocalVariable(name: "xceref", line: 2397, scope: !82, file: !5, type: !91)
-!95 = !DILocalVariable(name: "xcrdif", line: 2397, scope: !82, file: !5, type: !91)
-!96 = !DILocalVariable(name: "xcedif", line: 2397, scope: !82, file: !5, type: !91)
-!97 = !DILocalVariable(name: "epsilon", line: 2398, scope: !82, file: !5, type: !20)
-!98 = !DILocalVariable(name: "xce", line: 2398, scope: !82, file: !5, type: !91)
-!99 = !DILocalVariable(name: "xcr", line: 2398, scope: !82, file: !5, type: !91)
-!100 = !DILocalVariable(name: "dtref", line: 2398, scope: !82, file: !5, type: !20)
-!101 = !DILocalVariable(name: "m", line: 2399, scope: !82, file: !5, type: !8)
-!102 = distinct !DISubprogram(name: "rhs_norm", line: 266, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 266, file: !1, scope: !5, type: !103, variables: !106)
-!103 = !DISubroutineType(types: !104)
-!104 = !{null, !105}
-!105 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !20)
-!106 = !{!107, !108, !109, !110, !111, !112, !113}
-!107 = !DILocalVariable(name: "rms", line: 266, arg: 1, scope: !102, file: !5, type: !105)
-!108 = !DILocalVariable(name: "i", line: 271, scope: !102, file: !5, type: !8)
-!109 = !DILocalVariable(name: "j", line: 271, scope: !102, file: !5, type: !8)
-!110 = !DILocalVariable(name: "k", line: 271, scope: !102, file: !5, type: !8)
-!111 = !DILocalVariable(name: "d", line: 271, scope: !102, file: !5, type: !8)
-!112 = !DILocalVariable(name: "m", line: 271, scope: !102, file: !5, type: !8)
-!113 = !DILocalVariable(name: "add", line: 272, scope: !102, file: !5, type: !20)
-!114 = distinct !DISubprogram(name: "compute_rhs", line: 1767, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 1767, file: !1, scope: !5, type: !115, variables: !117)
-!115 = !DISubroutineType(types: !116)
-!116 = !{null}
-!117 = !{!118, !119, !120, !121, !122, !123, !124, !125, !126, !127, !128, !129, !130, !131}
-!118 = !DILocalVariable(name: "i", line: 1769, scope: !114, file: !5, type: !8)
-!119 = !DILocalVariable(name: "j", line: 1769, scope: !114, file: !5, type: !8)
-!120 = !DILocalVariable(name: "k", line: 1769, scope: !114, file: !5, type: !8)
-!121 = !DILocalVariable(name: "m", line: 1769, scope: !114, file: !5, type: !8)
-!122 = !DILocalVariable(name: "rho_inv", line: 1770, scope: !114, file: !5, type: !20)
-!123 = !DILocalVariable(name: "uijk", line: 1770, scope: !114, file: !5, type: !20)
-!124 = !DILocalVariable(name: "up1", line: 1770, scope: !114, file: !5, type: !20)
-!125 = !DILocalVariable(name: "um1", line: 1770, scope: !114, file: !5, type: !20)
-!126 = !DILocalVariable(name: "vijk", line: 1770, scope: !114, file: !5, type: !20)
-!127 = !DILocalVariable(name: "vp1", line: 1770, scope: !114, file: !5, type: !20)
-!128 = !DILocalVariable(name: "vm1", line: 1770, scope: !114, file: !5, type: !20)
-!129 = !DILocalVariable(name: "wijk", line: 1770, scope: !114, file: !5, type: !20)
-!130 = !DILocalVariable(name: "wp1", line: 1770, scope: !114, file: !5, type: !20)
-!131 = !DILocalVariable(name: "wm1", line: 1770, scope: !114, file: !5, type: !20)
-!132 = distinct !DISubprogram(name: "error_norm", line: 225, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 225, file: !1, scope: !5, type: !103, variables: !133)
-!133 = !{!134, !135, !136, !137, !138, !139, !140, !141, !142, !143, !144}
-!134 = !DILocalVariable(name: "rms", line: 225, arg: 1, scope: !132, file: !5, type: !105)
-!135 = !DILocalVariable(name: "i", line: 232, scope: !132, file: !5, type: !8)
-!136 = !DILocalVariable(name: "j", line: 232, scope: !132, file: !5, type: !8)
-!137 = !DILocalVariable(name: "k", line: 232, scope: !132, file: !5, type: !8)
-!138 = !DILocalVariable(name: "m", line: 232, scope: !132, file: !5, type: !8)
-!139 = !DILocalVariable(name: "d", line: 232, scope: !132, file: !5, type: !8)
-!140 = !DILocalVariable(name: "xi", line: 233, scope: !132, file: !5, type: !20)
-!141 = !DILocalVariable(name: "eta", line: 233, scope: !132, file: !5, type: !20)
-!142 = !DILocalVariable(name: "zeta", line: 233, scope: !132, file: !5, type: !20)
-!143 = !DILocalVariable(name: "u_exact", line: 233, scope: !132, file: !5, type: !91)
-!144 = !DILocalVariable(name: "add", line: 233, scope: !132, file: !5, type: !20)
-!145 = distinct !DISubprogram(name: "exact_solution", line: 643, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 644, file: !1, scope: !5, type: !146, variables: !148)
-!146 = !DISubroutineType(types: !147)
-!147 = !{null, !20, !20, !20, !105}
-!148 = !{!149, !150, !151, !152, !153}
-!149 = !DILocalVariable(name: "xi", line: 643, arg: 1, scope: !145, file: !5, type: !20)
-!150 = !DILocalVariable(name: "eta", line: 643, arg: 2, scope: !145, file: !5, type: !20)
-!151 = !DILocalVariable(name: "zeta", line: 643, arg: 3, scope: !145, file: !5, type: !20)
-!152 = !DILocalVariable(name: "dtemp", line: 644, arg: 4, scope: !145, file: !5, type: !105)
-!153 = !DILocalVariable(name: "m", line: 653, scope: !145, file: !5, type: !8)
-!154 = distinct !DISubprogram(name: "set_constants", line: 2191, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2191, file: !1, scope: !5, type: !115, variables: !2)
-!155 = distinct !DISubprogram(name: "lhsinit", line: 855, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 855, file: !1, scope: !5, type: !115, variables: !156)
-!156 = !{!157, !158, !159, !160, !161}
-!157 = !DILocalVariable(name: "i", line: 857, scope: !155, file: !5, type: !8)
-!158 = !DILocalVariable(name: "j", line: 857, scope: !155, file: !5, type: !8)
-!159 = !DILocalVariable(name: "k", line: 857, scope: !155, file: !5, type: !8)
-!160 = !DILocalVariable(name: "m", line: 857, scope: !155, file: !5, type: !8)
-!161 = !DILocalVariable(name: "n", line: 857, scope: !155, file: !5, type: !8)
-!162 = distinct !DISubprogram(name: "initialize", line: 669, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 669, file: !1, scope: !5, type: !115, variables: !163)
-!163 = !{!164, !165, !166, !167, !168, !169, !170, !171, !172, !173, !174, !179, !180, !181, !182}
-!164 = !DILocalVariable(name: "i", line: 679, scope: !162, file: !5, type: !8)
-!165 = !DILocalVariable(name: "j", line: 679, scope: !162, file: !5, type: !8)
-!166 = !DILocalVariable(name: "k", line: 679, scope: !162, file: !5, type: !8)
-!167 = !DILocalVariable(name: "m", line: 679, scope: !162, file: !5, type: !8)
-!168 = !DILocalVariable(name: "ix", line: 679, scope: !162, file: !5, type: !8)
-!169 = !DILocalVariable(name: "iy", line: 679, scope: !162, file: !5, type: !8)
-!170 = !DILocalVariable(name: "iz", line: 679, scope: !162, file: !5, type: !8)
-!171 = !DILocalVariable(name: "xi", line: 680, scope: !162, file: !5, type: !20)
-!172 = !DILocalVariable(name: "eta", line: 680, scope: !162, file: !5, type: !20)
-!173 = !DILocalVariable(name: "zeta", line: 680, scope: !162, file: !5, type: !20)
-!174 = !DILocalVariable(name: "Pface", line: 680, scope: !162, file: !5, type: !175)
-!175 = !DICompositeType(tag: DW_TAG_array_type, size: 1920, align: 64, baseType: !20, elements: !176)
-!176 = !{!177, !178, !93}
-!177 = !DISubrange(count: 2)
-!178 = !DISubrange(count: 3)
-!179 = !DILocalVariable(name: "Pxi", line: 680, scope: !162, file: !5, type: !20)
-!180 = !DILocalVariable(name: "Peta", line: 680, scope: !162, file: !5, type: !20)
-!181 = !DILocalVariable(name: "Pzeta", line: 680, scope: !162, file: !5, type: !20)
-!182 = !DILocalVariable(name: "temp", line: 680, scope: !162, file: !5, type: !91)
-!183 = distinct !DISubprogram(name: "exact_rhs", line: 301, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 301, file: !1, scope: !5, type: !115, variables: !184)
-!184 = !{!185, !186, !187, !188, !189, !190, !191, !192, !193, !194, !195, !196, !197, !198, !199}
-!185 = !DILocalVariable(name: "dtemp", line: 310, scope: !183, file: !5, type: !91)
-!186 = !DILocalVariable(name: "xi", line: 310, scope: !183, file: !5, type: !20)
-!187 = !DILocalVariable(name: "eta", line: 310, scope: !183, file: !5, type: !20)
-!188 = !DILocalVariable(name: "zeta", line: 310, scope: !183, file: !5, type: !20)
-!189 = !DILocalVariable(name: "dtpp", line: 310, scope: !183, file: !5, type: !20)
-!190 = !DILocalVariable(name: "m", line: 311, scope: !183, file: !5, type: !8)
-!191 = !DILocalVariable(name: "i", line: 311, scope: !183, file: !5, type: !8)
-!192 = !DILocalVariable(name: "j", line: 311, scope: !183, file: !5, type: !8)
-!193 = !DILocalVariable(name: "k", line: 311, scope: !183, file: !5, type: !8)
-!194 = !DILocalVariable(name: "ip1", line: 311, scope: !183, file: !5, type: !8)
-!195 = !DILocalVariable(name: "im1", line: 311, scope: !183, file: !5, type: !8)
-!196 = !DILocalVariable(name: "jp1", line: 311, scope: !183, file: !5, type: !8)
-!197 = !DILocalVariable(name: "jm1", line: 311, scope: !183, file: !5, type: !8)
-!198 = !DILocalVariable(name: "km1", line: 311, scope: !183, file: !5, type: !8)
-!199 = !DILocalVariable(name: "kp1", line: 311, scope: !183, file: !5, type: !8)
-!200 = distinct !DISubprogram(name: "adi", line: 210, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 210, file: !1, scope: !5, type: !115, variables: !2)
-!201 = distinct !DISubprogram(name: "add", line: 187, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 187, file: !1, scope: !5, type: !115, variables: !202)
-!202 = !{!203, !204, !205, !206}
-!203 = !DILocalVariable(name: "i", line: 193, scope: !201, file: !5, type: !8)
-!204 = !DILocalVariable(name: "j", line: 193, scope: !201, file: !5, type: !8)
-!205 = !DILocalVariable(name: "k", line: 193, scope: !201, file: !5, type: !8)
-!206 = !DILocalVariable(name: "m", line: 193, scope: !201, file: !5, type: !8)
-!207 = distinct !DISubprogram(name: "z_solve", line: 3457, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3457, file: !1, scope: !5, type: !115, variables: !2)
-!208 = distinct !DISubprogram(name: "z_backsubstitute", line: 3480, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3480, file: !1, scope: !5, type: !115, variables: !209)
-!209 = !{!210, !211, !212, !213, !214}
-!210 = !DILocalVariable(name: "i", line: 3492, scope: !208, file: !5, type: !8)
-!211 = !DILocalVariable(name: "j", line: 3492, scope: !208, file: !5, type: !8)
-!212 = !DILocalVariable(name: "k", line: 3492, scope: !208, file: !5, type: !8)
-!213 = !DILocalVariable(name: "m", line: 3492, scope: !208, file: !5, type: !8)
-!214 = !DILocalVariable(name: "n", line: 3492, scope: !208, file: !5, type: !8)
-!215 = distinct !DISubprogram(name: "z_solve_cell", line: 3512, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3512, file: !1, scope: !5, type: !115, variables: !216)
-!216 = !{!217, !218, !219, !220}
-!217 = !DILocalVariable(name: "i", line: 3527, scope: !215, file: !5, type: !8)
-!218 = !DILocalVariable(name: "j", line: 3527, scope: !215, file: !5, type: !8)
-!219 = !DILocalVariable(name: "k", line: 3527, scope: !215, file: !5, type: !8)
-!220 = !DILocalVariable(name: "ksize", line: 3527, scope: !215, file: !5, type: !8)
-!221 = distinct !DISubprogram(name: "binvrhs", line: 3154, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3154, file: !1, scope: !5, type: !222, variables: !225)
-!222 = !DISubroutineType(types: !223)
-!223 = !{null, !224, !105}
-!224 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !91)
-!225 = !{!226, !227, !228, !229}
-!226 = !DILocalVariable(name: "lhs", line: 3154, arg: 1, scope: !221, file: !5, type: !224)
-!227 = !DILocalVariable(name: "r", line: 3154, arg: 2, scope: !221, file: !5, type: !105)
-!228 = !DILocalVariable(name: "pivot", line: 3159, scope: !221, file: !5, type: !20)
-!229 = !DILocalVariable(name: "coeff", line: 3159, scope: !221, file: !5, type: !20)
-!230 = distinct !DISubprogram(name: "matmul_sub", line: 2841, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2842, file: !1, scope: !5, type: !231, variables: !233)
-!231 = !DISubroutineType(types: !232)
-!232 = !{null, !224, !224, !224}
-!233 = !{!234, !235, !236, !237}
-!234 = !DILocalVariable(name: "ablock", line: 2841, arg: 1, scope: !230, file: !5, type: !224)
-!235 = !DILocalVariable(name: "bblock", line: 2841, arg: 2, scope: !230, file: !5, type: !224)
-!236 = !DILocalVariable(name: "cblock", line: 2842, arg: 3, scope: !230, file: !5, type: !224)
-!237 = !DILocalVariable(name: "j", line: 2851, scope: !230, file: !5, type: !8)
-!238 = distinct !DISubprogram(name: "matvec_sub", line: 2814, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2814, file: !1, scope: !5, type: !239, variables: !241)
-!239 = !DISubroutineType(types: !240)
-!240 = !{null, !224, !105, !105}
-!241 = !{!242, !243, !244, !245}
-!242 = !DILocalVariable(name: "ablock", line: 2814, arg: 1, scope: !238, file: !5, type: !224)
-!243 = !DILocalVariable(name: "avec", line: 2814, arg: 2, scope: !238, file: !5, type: !105)
-!244 = !DILocalVariable(name: "bvec", line: 2814, arg: 3, scope: !238, file: !5, type: !105)
-!245 = !DILocalVariable(name: "i", line: 2823, scope: !238, file: !5, type: !8)
-!246 = distinct !DISubprogram(name: "binvcrhs", line: 2885, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2885, file: !1, scope: !5, type: !247, variables: !249)
-!247 = !DISubroutineType(types: !248)
-!248 = !{null, !224, !224, !105}
-!249 = !{!250, !251, !252, !253, !254}
-!250 = !DILocalVariable(name: "lhs", line: 2885, arg: 1, scope: !246, file: !5, type: !224)
-!251 = !DILocalVariable(name: "c", line: 2885, arg: 2, scope: !246, file: !5, type: !224)
-!252 = !DILocalVariable(name: "r", line: 2885, arg: 3, scope: !246, file: !5, type: !105)
-!253 = !DILocalVariable(name: "pivot", line: 2890, scope: !246, file: !5, type: !20)
-!254 = !DILocalVariable(name: "coeff", line: 2890, scope: !246, file: !5, type: !20)
-!255 = distinct !DISubprogram(name: "lhsz", line: 1475, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 1475, file: !1, scope: !5, type: !115, variables: !256)
-!256 = !{!257, !258, !259}
-!257 = !DILocalVariable(name: "i", line: 1484, scope: !255, file: !5, type: !8)
-!258 = !DILocalVariable(name: "j", line: 1484, scope: !255, file: !5, type: !8)
-!259 = !DILocalVariable(name: "k", line: 1484, scope: !255, file: !5, type: !8)
-!260 = distinct !DISubprogram(name: "y_solve", line: 3299, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3299, file: !1, scope: !5, type: !115, variables: !2)
-!261 = distinct !DISubprogram(name: "y_backsubstitute", line: 3323, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3323, file: !1, scope: !5, type: !115, variables: !262)
-!262 = !{!263, !264, !265, !266, !267}
-!263 = !DILocalVariable(name: "i", line: 3335, scope: !261, file: !5, type: !8)
-!264 = !DILocalVariable(name: "j", line: 3335, scope: !261, file: !5, type: !8)
-!265 = !DILocalVariable(name: "k", line: 3335, scope: !261, file: !5, type: !8)
-!266 = !DILocalVariable(name: "m", line: 3335, scope: !261, file: !5, type: !8)
-!267 = !DILocalVariable(name: "n", line: 3335, scope: !261, file: !5, type: !8)
-!268 = distinct !DISubprogram(name: "y_solve_cell", line: 3355, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3355, file: !1, scope: !5, type: !115, variables: !269)
-!269 = !{!270, !271, !272, !273}
-!270 = !DILocalVariable(name: "i", line: 3370, scope: !268, file: !5, type: !8)
-!271 = !DILocalVariable(name: "j", line: 3370, scope: !268, file: !5, type: !8)
-!272 = !DILocalVariable(name: "k", line: 3370, scope: !268, file: !5, type: !8)
-!273 = !DILocalVariable(name: "jsize", line: 3370, scope: !268, file: !5, type: !8)
-!274 = distinct !DISubprogram(name: "lhsy", line: 1181, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 1181, file: !1, scope: !5, type: !115, variables: !275)
-!275 = !{!276, !277, !278}
-!276 = !DILocalVariable(name: "i", line: 1190, scope: !274, file: !5, type: !8)
-!277 = !DILocalVariable(name: "j", line: 1190, scope: !274, file: !5, type: !8)
-!278 = !DILocalVariable(name: "k", line: 1190, scope: !274, file: !5, type: !8)
-!279 = distinct !DISubprogram(name: "x_solve", line: 2658, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2658, file: !1, scope: !5, type: !115, variables: !2)
-!280 = distinct !DISubprogram(name: "x_backsubstitute", line: 2684, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2684, file: !1, scope: !5, type: !115, variables: !281)
-!281 = !{!282, !283, !284, !285, !286}
-!282 = !DILocalVariable(name: "i", line: 2696, scope: !280, file: !5, type: !8)
-!283 = !DILocalVariable(name: "j", line: 2696, scope: !280, file: !5, type: !8)
-!284 = !DILocalVariable(name: "k", line: 2696, scope: !280, file: !5, type: !8)
-!285 = !DILocalVariable(name: "m", line: 2696, scope: !280, file: !5, type: !8)
-!286 = !DILocalVariable(name: "n", line: 2696, scope: !280, file: !5, type: !8)
-!287 = distinct !DISubprogram(name: "x_solve_cell", line: 2716, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2716, file: !1, scope: !5, type: !115, variables: !288)
-!288 = !{!289, !290, !291, !292}
-!289 = !DILocalVariable(name: "i", line: 2728, scope: !287, file: !5, type: !8)
-!290 = !DILocalVariable(name: "j", line: 2728, scope: !287, file: !5, type: !8)
-!291 = !DILocalVariable(name: "k", line: 2728, scope: !287, file: !5, type: !8)
-!292 = !DILocalVariable(name: "isize", line: 2728, scope: !287, file: !5, type: !8)
-!293 = distinct !DISubprogram(name: "lhsx", line: 898, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 898, file: !1, scope: !5, type: !115, variables: !294)
-!294 = !{!295, !296, !297}
-!295 = !DILocalVariable(name: "i", line: 907, scope: !293, file: !5, type: !8)
-!296 = !DILocalVariable(name: "j", line: 907, scope: !293, file: !5, type: !8)
-!297 = !DILocalVariable(name: "k", line: 907, scope: !293, file: !5, type: !8)
-!298 = !{!299, !304, !305, !309, !310, !311, !312, !313, !314, !315, !316, !317, !318, !319, !320, !321, !322, !323, !324, !325, !326, !327, !328, !329, !330, !331, !332, !333, !334, !335, !336, !337, !338, !339, !340, !341, !342, !343, !347, !350, !351, !352, !353, !354, !355, !356, !360, !361, !362, !363, !364, !365, !366, !367, !368, !369, !370, !371, !372, !373, !374, !375, !376, !377, !378, !379, !380, !381, !382, !383, !384, !385, !386, !387, !388, !389, !390, !391, !392, !393, !394, !395, !396, !397, !398, !399, !400, !401, !402, !403, !404, !405, !406, !407, !408, !409, !410, !411, !412, !413, !414, !415, !416, !417, !418, !419, !422, !426, !427, !430, !431, !434, !435, !436, !437}
-!299 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "grid_points", line: 28, isLocal: true, isDefinition: true, scope: null, file: !300, type: !302))
-!300 = !DIFile(filename: "./header.h", directory: "/home/hfinkel/src/NPB2.3-omp-C/BT")
-!301 = !{!"./header.h", !"/home/hfinkel/src/NPB2.3-omp-C/BT"}
-!302 = !DICompositeType(tag: DW_TAG_array_type, size: 96, align: 32, baseType: !8, elements: !303)
-!303 = !{!178}
-!304 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dt", line: 35, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!305 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "rhs", line: 68, isLocal: true, isDefinition: true, scope: null, file: !300, type: !306))
-!306 = !DICompositeType(tag: DW_TAG_array_type, size: 1385839040, align: 64, baseType: !20, elements: !307)
-!307 = !{!308, !308, !308, !93}
-!308 = !DISubrange(count: 163)
-!309 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zzcon5", line: 42, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!310 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zzcon4", line: 42, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!311 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zzcon3", line: 42, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!312 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz5tz1", line: 43, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!313 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz4tz1", line: 43, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!314 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz3tz1", line: 43, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!315 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zzcon2", line: 42, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!316 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz2tz1", line: 43, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!317 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tz2", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!318 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz1tz1", line: 43, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!319 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "yycon5", line: 40, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!320 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "yycon4", line: 40, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!321 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "yycon3", line: 40, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!322 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy5ty1", line: 41, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!323 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy4ty1", line: 41, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!324 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy3ty1", line: 41, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!325 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "yycon2", line: 40, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!326 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy2ty1", line: 41, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!327 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ty2", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!328 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy1ty1", line: 41, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!329 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dssp", line: 35, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!330 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c1", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!331 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "xxcon5", line: 38, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!332 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "xxcon4", line: 38, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!333 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "xxcon3", line: 38, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!334 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx5tx1", line: 39, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!335 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx4tx1", line: 39, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!336 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx3tx1", line: 39, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!337 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c2", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!338 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "con43", line: 48, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!339 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "xxcon2", line: 38, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!340 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx2tx1", line: 39, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!341 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tx2", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!342 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx1tx1", line: 39, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!343 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "forcing", line: 66, isLocal: true, isDefinition: true, scope: null, file: !300, type: !344))
-!344 = !DICompositeType(tag: DW_TAG_array_type, size: 1663006848, align: 64, baseType: !20, elements: !345)
-!345 = !{!308, !308, !308, !346}
-!346 = !DISubrange(count: 6)
-!347 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "qs", line: 63, isLocal: true, isDefinition: true, scope: null, file: !300, type: !348))
-!348 = !DICompositeType(tag: DW_TAG_array_type, size: 277167808, align: 64, baseType: !20, elements: !349)
-!349 = !{!308, !308, !308}
-!350 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "square", line: 65, isLocal: true, isDefinition: true, scope: null, file: !300, type: !348))
-!351 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ws", line: 62, isLocal: true, isDefinition: true, scope: null, file: !300, type: !348))
-!352 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "vs", line: 61, isLocal: true, isDefinition: true, scope: null, file: !300, type: !348))
-!353 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "us", line: 60, isLocal: true, isDefinition: true, scope: null, file: !300, type: !348))
-!354 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "rho_i", line: 64, isLocal: true, isDefinition: true, scope: null, file: !300, type: !348))
-!355 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "u", line: 67, isLocal: true, isDefinition: true, scope: null, file: !300, type: !306))
-!356 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ce", line: 36, isLocal: true, isDefinition: true, scope: null, file: !300, type: !357))
-!357 = !DICompositeType(tag: DW_TAG_array_type, size: 4160, align: 64, baseType: !20, elements: !358)
-!358 = !{!93, !359}
-!359 = !DISubrange(count: 13)
-!360 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dnzm1", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!361 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dnym1", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!362 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dnxm1", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!363 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zzcon1", line: 42, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!364 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "yycon1", line: 40, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!365 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "xxcon1", line: 38, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!366 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "con16", line: 48, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!367 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c2iv", line: 48, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!368 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c3c4tz3", line: 48, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!369 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c3c4ty3", line: 48, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!370 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c3c4tx3", line: 48, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!371 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "comz6", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!372 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "comz5", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!373 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "comz4", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!374 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "comz1", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!375 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dtdssp", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!376 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c2dttz1", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!377 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c2dtty1", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!378 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c2dttx1", line: 47, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!379 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dttz2", line: 46, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!380 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dttz1", line: 46, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!381 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dtty2", line: 46, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!382 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dtty1", line: 46, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!383 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dttx2", line: 46, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!384 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dttx1", line: 46, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!385 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c5dssp", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!386 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c4dssp", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!387 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dzmax", line: 37, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!388 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dymax", line: 37, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!389 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dxmax", line: 37, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!390 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz5", line: 34, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!391 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz4", line: 34, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!392 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz3", line: 34, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!393 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz2", line: 34, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!394 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dz1", line: 34, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!395 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy5", line: 33, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!396 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy4", line: 33, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!397 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy3", line: 33, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!398 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy2", line: 33, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!399 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dy1", line: 33, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!400 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx5", line: 32, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!401 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx4", line: 32, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!402 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx3", line: 32, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!403 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx2", line: 32, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!404 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "dx1", line: 32, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!405 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tz3", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!406 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tz1", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!407 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ty3", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!408 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ty1", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!409 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tx3", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!410 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tx1", line: 31, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!411 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "conz1", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!412 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c1345", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!413 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c3c4", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!414 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c1c5", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!415 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c1c2", line: 44, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!416 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c5", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!417 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c4", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!418 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c3", line: 45, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!419 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "lhs", line: 69, isLocal: true, isDefinition: true, scope: null, file: !300, type: !420))
-!420 = !DICompositeType(tag: DW_TAG_array_type, size: 20787585600, align: 64, baseType: !20, elements: !421)
-!421 = !{!308, !308, !308, !178, !93, !93}
-!422 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "q", line: 73, isLocal: true, isDefinition: true, scope: null, file: !300, type: !423))
-!423 = !DICompositeType(tag: DW_TAG_array_type, size: 10368, align: 64, baseType: !20, elements: !424)
-!424 = !{!425}
-!425 = !DISubrange(count: 162)
-!426 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "cuf", line: 72, isLocal: true, isDefinition: true, scope: null, file: !300, type: !423))
-!427 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "buf", line: 75, isLocal: true, isDefinition: true, scope: null, file: !300, type: !428))
-!428 = !DICompositeType(tag: DW_TAG_array_type, size: 51840, align: 64, baseType: !20, elements: !429)
-!429 = !{!425, !93}
-!430 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ue", line: 74, isLocal: true, isDefinition: true, scope: null, file: !300, type: !428))
-!431 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "njac", line: 86, isLocal: true, isDefinition: true, scope: null, file: !300, type: !432))
-!432 = !DICompositeType(tag: DW_TAG_array_type, size: 6886684800, align: 64, baseType: !20, elements: !433)
-!433 = !{!308, !308, !425, !93, !93}
-!434 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "fjac", line: 84, isLocal: true, isDefinition: true, scope: null, file: !300, type: !432))
-!435 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tmp3", line: 88, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!436 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tmp2", line: 88, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!437 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tmp1", line: 88, isLocal: true, isDefinition: true, scope: null, file: !300, type: !20))
-!438 = !{i32 2, !"Dwarf Version", i32 4}
-!439 = !DILocation(line: 1898, scope: !440)
-!440 = distinct !DILexicalBlock(line: 1898, column: 0, file: !1, scope: !114)
-!441 = !DILocation(line: 1913, scope: !442)
-!442 = distinct !DILexicalBlock(line: 1913, column: 0, file: !1, scope: !114)
-!443 = !DILocation(line: 1923, scope: !114)
-!444 = !{!"int", !445}
-!445 = !{!"omnipotent char", !446}
-!446 = !{!"Simple C/C++ TBAA"}
-!447 = !{i32 1}
-!448 = !DILocation(line: 1925, scope: !449)
-!449 = distinct !DILexicalBlock(line: 1925, column: 0, file: !1, scope: !114)
-!450 = !DILocation(line: 1939, scope: !451)
-!451 = distinct !DILexicalBlock(line: 1939, column: 0, file: !1, scope: !114)
-!452 = !DILocation(line: 1940, scope: !453)
-!453 = distinct !DILexicalBlock(line: 1940, column: 0, file: !1, scope: !454)
-!454 = distinct !DILexicalBlock(line: 1939, column: 0, file: !1, scope: !451)
-!455 = !DILocation(line: 1941, scope: !456)
-!456 = distinct !DILexicalBlock(line: 1941, column: 0, file: !1, scope: !457)
-!457 = distinct !DILexicalBlock(line: 1940, column: 0, file: !1, scope: !453)
-!458 = !DILocation(line: 2020, scope: !459)
-!459 = distinct !DILexicalBlock(line: 2020, column: 0, file: !1, scope: !460)
-!460 = distinct !DILexicalBlock(line: 2019, column: 0, file: !1, scope: !461)
-!461 = distinct !DILexicalBlock(line: 2019, column: 0, file: !1, scope: !462)
-!462 = distinct !DILexicalBlock(line: 2018, column: 0, file: !1, scope: !463)
-!463 = distinct !DILexicalBlock(line: 2018, column: 0, file: !1, scope: !114)
-!464 = !{i32 1, !"Debug Info Version", i32 3}

+ 40 - 38
test/CodeGen/WebAssembly/dbgvalue.ll

@@ -4,67 +4,69 @@
 ; CHECK: #DEBUG_VALUE: usage:self <- %vreg4
 ; CHECK: BB#1
 ; CHECK: DW_TAG_variable
+source_filename = "test/CodeGen/WebAssembly/dbgvalue.ll"
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
 
-%0 = type opaque
-
 @key = external local_unnamed_addr global [15 x i8], align 1
 @.str = external unnamed_addr constant [33 x i8], align 1
 
-; Function Attrs: nounwind
-define internal i32 @0(i8*) local_unnamed_addr !dbg !14 !type !22 {
-  tail call void @llvm.dbg.value(metadata i8* %0, i64 0, metadata !21, metadata !23), !dbg !24
-  %2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i32 0, i32 0), i8* %0), !dbg !25
-  br i1 1, label %a, label %b
-a:
+define internal i32 @0(i8*) local_unnamed_addr !dbg !15 !type !23 {
+  tail call void @llvm.dbg.value(metadata i8* %0, i64 0, metadata !22, metadata !24), !dbg !25
+  %2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i32 0, i32 0), i8* %0), !dbg !26
+  br i1 true, label %a, label %b
+
+a:                                                ; preds = %1
   %3 = add i32 %2, %2
   br label %c
 
-b:
+b:                                                ; preds = %1
   %4 = sub i32 %2, %2
   br label %c
 
-c:
+c:                                                ; preds = %b, %a
   %5 = phi i32 [ %3, %a ], [ %4, %b ]
   %6 = add i32 ptrtoint (i32 (i8*)* @0 to i32), %5
-  ret i32 %6, !dbg !26
+  ret i32 %6, !dbg !27
 }
 
-; Function Attrs: nounwind
 declare i32 @printf(i8* nocapture readonly, ...) local_unnamed_addr
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
+
+attributes #0 = { nounwind readnone }
 
 !llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!11, !12}
-!llvm.ident = !{!13}
+!llvm.module.flags = !{!12, !13}
+!llvm.ident = !{!14}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 273884) (llvm/trunk 273897)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
 !1 = !DIFile(filename: "crash.c", directory: "wasm/tests")
 !2 = !{}
 !3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "key", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true))
-!5 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 120, align: 8, elements: !9)
-!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !7, line: 185, baseType: !8)
-!7 = !DIFile(filename: "wasm/emscripten/system/include/libc/bits/alltypes.h", directory: "wasm/tests")
-!8 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
-!9 = !{!10}
-!10 = !DISubrange(count: 15)
-!11 = !{i32 2, !"Dwarf Version", i32 4}
-!12 = !{i32 2, !"Debug Info Version", i32 3}
-!13 = !{!"clang version 3.9.0 (trunk 273884) (llvm/trunk 273897)"}
-!14 = distinct !DISubprogram(name: "usage", scope: !1, file: !1, line: 15, type: !15, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !20)
-!15 = !DISubroutineType(types: !16)
-!16 = !{!17, !18}
-!17 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 32, align: 32)
-!19 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!20 = !{!21}
-!21 = !DILocalVariable(name: "self", arg: 1, scope: !14, file: !1, line: 15, type: !18)
-!22 = !{i64 0, !"_ZTSFiPcE"}
-!23 = !DIExpression()
-!24 = !DILocation(line: 15, column: 17, scope: !14)
-!25 = !DILocation(line: 16, column: 3, scope: !14)
-!26 = !DILocation(line: 17, column: 3, scope: !14)
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "key", scope: !0, file: !1, line: 7, type: !6, isLocal: false, isDefinition: true)
+!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 120, align: 8, elements: !10)
+!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !8, line: 185, baseType: !9)
+!8 = !DIFile(filename: "wasm/emscripten/system/include/libc/bits/alltypes.h", directory: "wasm/tests")
+!9 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
+!10 = !{!11}
+!11 = !DISubrange(count: 15)
+!12 = !{i32 2, !"Dwarf Version", i32 4}
+!13 = !{i32 2, !"Debug Info Version", i32 3}
+!14 = !{!"clang version 3.9.0 (trunk 273884) (llvm/trunk 273897)"}
+!15 = distinct !DISubprogram(name: "usage", scope: !1, file: !1, line: 15, type: !16, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !21)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!18, !19}
+!18 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !20, size: 32, align: 32)
+!20 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!21 = !{!22}
+!22 = !DILocalVariable(name: "self", arg: 1, scope: !15, file: !1, line: 15, type: !19)
+!23 = !{i64 0, !"_ZTSFiPcE"}
+!24 = !DIExpression()
+!25 = !DILocation(line: 15, column: 17, scope: !15)
+!26 = !DILocation(line: 16, column: 3, scope: !15)
+!27 = !DILocation(line: 17, column: 3, scope: !15)
+

+ 42 - 50
test/CodeGen/X86/2010-05-26-DotDebugLoc.ll

@@ -1,66 +1,60 @@
 ; RUN: llc -O2 < %s | FileCheck %s
 ; RUN: llc -O2 -regalloc=basic < %s | FileCheck %s
+source_filename = "test/CodeGen/X86/2010-05-26-DotDebugLoc.ll"
 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"
 
 %struct.a = type { i32, %struct.a* }
 
-@llvm.used = appending global [1 x i8*] [i8* bitcast (i8* (%struct.a*)* @bar to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
+@llvm.used = appending global [1 x i8*] [i8* bitcast (i8* (%struct.a*)* @bar to i8*)], section "llvm.metadata"
 
-define i8* @bar(%struct.a* %myvar) nounwind optsize noinline ssp !dbg !9 {
+; Function Attrs: noinline nounwind optsize ssp
+define i8* @bar(%struct.a* %myvar) #0 !dbg !8 {
 entry:
-  tail call void @llvm.dbg.value(metadata %struct.a* %myvar, i64 0, metadata !8, metadata !DIExpression()), !dbg !DILocation(scope: !9)
-  %0 = getelementptr inbounds %struct.a, %struct.a* %myvar, i64 0, i32 0, !dbg !28 ; <i32*> [#uses=1]
-  %1 = load i32, i32* %0, align 8, !dbg !28            ; <i32> [#uses=1]
-  tail call void @foo(i32 %1) nounwind optsize noinline ssp, !dbg !28
-  %2 = bitcast %struct.a* %myvar to i8*, !dbg !30 ; <i8*> [#uses=1]
-  ret i8* %2, !dbg !30
+  tail call void @llvm.dbg.value(metadata %struct.a* %myvar, i64 0, metadata !18, metadata !19), !dbg !20
+  %0 = getelementptr inbounds %struct.a, %struct.a* %myvar, i64 0, i32 0, !dbg !21
+  %1 = load i32, i32* %0, align 8, !dbg !21
+  tail call void @foo(i32 %1) #0, !dbg !21
+  %2 = bitcast %struct.a* %myvar to i8*, !dbg !23
+  ret i8* %2, !dbg !23
 }
 
-declare void @foo(i32) nounwind optsize noinline ssp
+; Function Attrs: noinline nounwind optsize ssp
+declare void @foo(i32) #0
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!38}
+attributes #0 = { noinline nounwind optsize ssp }
+attributes #1 = { nounwind readnone }
 
-!0 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ret", line: 7, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !3))
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!7}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
 !1 = !DIFile(filename: "foo.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: FullDebug, file: !36, enums: !37, retainedTypes: !37, globals: !31, imports:  !37)
-!3 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!4 = !DILocalVariable(name: "x", line: 12, arg: 1, scope: !5, file: !1, type: !3)
-!5 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, scopeLine: 13, file: !36, scope: !1, type: !6, variables: !33)
-!6 = !DISubroutineType(types: !7)
-!7 = !{null, !3}
-!8 = !DILocalVariable(name: "myvar", line: 17, arg: 1, scope: !9, file: !1, type: !13)
-!9 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, scopeLine: 17, file: !36, scope: !1, type: !10, variables: !34)
-!10 = !DISubroutineType(types: !11)
-!11 = !{!12, !13}
-!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !36, scope: !1, baseType: null)
-!13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !36, scope: !1, baseType: !14)
-!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "a", line: 2, size: 128, align: 64, file: !36, scope: !1, elements: !15)
-!15 = !{!16, !17}
-!16 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 3, size: 32, align: 32, file: !36, scope: !14, baseType: !3)
-!17 = !DIDerivedType(tag: DW_TAG_member, name: "d", line: 4, size: 64, align: 64, offset: 64, file: !36, scope: !14, baseType: !13)
-!18 = !DILocalVariable(name: "argc", line: 22, arg: 1, scope: !19, file: !1, type: !3)
-!19 = distinct !DISubprogram(name: "main", linkageName: "main", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, scopeLine: 22, file: !36, scope: !1, type: !20, variables: !35)
-!20 = !DISubroutineType(types: !21)
-!21 = !{!3, !3, !22}
-!22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !36, scope: !1, baseType: !23)
-!23 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !36, scope: !1, baseType: !24)
-!24 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!25 = !DILocalVariable(name: "argv", line: 22, arg: 2, scope: !19, file: !1, type: !22)
-!26 = !DILocalVariable(name: "e", line: 23, scope: !27, file: !1, type: !14)
-!27 = distinct !DILexicalBlock(line: 22, column: 0, file: !36, scope: !19)
-!28 = !DILocation(line: 18, scope: !29)
-!29 = distinct !DILexicalBlock(line: 17, column: 0, file: !36, scope: !9)
-!30 = !DILocation(line: 19, scope: !29)
-!31 = !{!0}
-!33 = !{!4}
-!34 = !{!8}
-!35 = !{!18, !25, !26}
-!36 = !DIFile(filename: "foo.c", directory: "/tmp/")
-!37 = !{}
+!2 = !{}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "ret", scope: !1, file: !1, line: 7, type: !6, isLocal: false, isDefinition: true)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+!8 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: !1, file: !1, line: 17, type: !9, isLocal: false, isDefinition: true, scopeLine: 17, virtualIndex: 6, isOptimized: true, unit: !0, variables: !17)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!11, !12}
+!11 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !1, file: !1, baseType: null, size: 64, align: 64)
+!12 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !1, file: !1, baseType: !13, size: 64, align: 64)
+!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "a", scope: !1, file: !1, line: 2, size: 128, align: 64, elements: !14)
+!14 = !{!15, !16}
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !13, file: !1, line: 3, baseType: !6, size: 32, align: 32)
+!16 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !13, file: !1, line: 4, baseType: !12, size: 64, align: 64, offset: 64)
+!17 = !{!18}
+!18 = !DILocalVariable(name: "myvar", arg: 1, scope: !8, file: !1, line: 17, type: !12)
+!19 = !DIExpression()
+!20 = !DILocation(line: 0, scope: !8)
+!21 = !DILocation(line: 18, scope: !22)
+!22 = distinct !DILexicalBlock(scope: !8, file: !1, line: 17)
+!23 = !DILocation(line: 19, scope: !22)
 
 ; The variable bar:myvar changes registers after the first movq.
 ; It is cobbered by popq %rbx
@@ -70,7 +64,6 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
 ; CHECK: popq
 ; CHECK-NEXT: [[CLOBBER:Ltmp[0-9]*]]
 
-
 ; CHECK: Ldebug_loc0:
 ; CHECK-NEXT: [[SET1:.*]] = Lfunc_begin0-Lfunc_begin0
 ; CHECK-NEXT: .quad   [[SET1]]
@@ -84,4 +77,3 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
 ; CHECK-NEXT: .quad   [[SET4]]
 ; CHECK-NEXT: .short  1     ## Loc expr size
 ; CHECK-NEXT: .byte   83
-!38 = !{i32 1, !"Debug Info Version", i32 3}

+ 95 - 92
test/CodeGen/X86/fp128-g.ll

@@ -14,11 +14,11 @@ target triple = "x86_64--linux-android"
 @ld_ptr = common local_unnamed_addr global fp128* null, align 8, !dbg !0
 
 ; Function Attrs: nounwind readonly uwtable
-define fp128 @test_return1(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !11 {
+define fp128 @test_return1(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !12 {
 entry:
-  tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !15, metadata !16), !dbg !17
-  %0 = load fp128, fp128* %ptr, align 16, !dbg !18, !tbaa !19
-  ret fp128 %0, !dbg !23
+  tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !16, metadata !17), !dbg !18
+  %0 = load fp128, fp128* %ptr, align 16, !dbg !19, !tbaa !20
+  ret fp128 %0, !dbg !24
 ; X64-LABEL: test_return1:
 ; X64:       .loc
 ; X64:       movaps     (%rdi), %xmm0
@@ -27,26 +27,27 @@ entry:
 }
 
 ; Function Attrs: nounwind readonly uwtable
-define fp128 @test_return2(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !24 {
+define fp128 @test_return2(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !25 {
 entry:
-  tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !26, metadata !16), !dbg !28
-  %0 = load fp128, fp128* %ptr, align 16, !dbg !29, !tbaa !19
-  tail call void @llvm.dbg.value(metadata fp128 %0, i64 0, metadata !27, metadata !16), !dbg !30
-  ret fp128 %0, !dbg !31
+  tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !27, metadata !17), !dbg !29
+  %0 = load fp128, fp128* %ptr, align 16, !dbg !30, !tbaa !20
+  tail call void @llvm.dbg.value(metadata fp128 %0, i64 0, metadata !28, metadata !17), !dbg !31
+  ret fp128 %0, !dbg !32
+}
+
 ; X64-LABEL: test_return2:
 ; X64:       .loc
 ; X64:       movaps     (%rdi), %xmm0
 ; X64:       .loc
 ; X64:       retq
-}
-
 ; Function Attrs: nounwind readonly uwtable
-define fp128 @test_return3(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !32 {
+
+define fp128 @test_return3(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !33 {
 entry:
-  tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !34, metadata !16), !dbg !35
-  %0 = load fp128, fp128* %ptr, align 16, !dbg !36, !tbaa !19
-  %add = fadd fp128 %0, %0, !dbg !37
-  ret fp128 %add, !dbg !38
+  tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !35, metadata !17), !dbg !36
+  %0 = load fp128, fp128* %ptr, align 16, !dbg !37, !tbaa !20
+  %add = fadd fp128 %0, %0, !dbg !38
+  ret fp128 %add, !dbg !39
 ; X64-LABEL: test_return3:
 ; X64:       .loc
 ; X64:       movaps     (%rdi), %xmm0
@@ -58,11 +59,11 @@ entry:
 }
 
 ; Function Attrs: norecurse nounwind readonly uwtable
-define fp128 @test_return4() local_unnamed_addr #1 !dbg !39 {
+define fp128 @test_return4() local_unnamed_addr #1 !dbg !40 {
 entry:
-  %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !42, !tbaa !43
-  %1 = load fp128, fp128* %0, align 16, !dbg !45, !tbaa !19
-  ret fp128 %1, !dbg !46
+  %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !43, !tbaa !44
+  %1 = load fp128, fp128* %0, align 16, !dbg !46, !tbaa !20
+  ret fp128 %1, !dbg !47
 ; X64-LABEL: test_return4:
 ; X64:       .loc
 ; X64:       movq	ld_ptr(%rip), %rax
@@ -73,12 +74,12 @@ entry:
 }
 
 ; Function Attrs: nounwind readonly uwtable
-define fp128 @test_return5() local_unnamed_addr #0 !dbg !47 {
+define fp128 @test_return5() local_unnamed_addr #0 !dbg !48 {
 entry:
-  %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !50, !tbaa !43
-  %1 = load fp128, fp128* %0, align 16, !dbg !51, !tbaa !19
-  tail call void @llvm.dbg.value(metadata fp128 %1, i64 0, metadata !49, metadata !16), !dbg !52
-  ret fp128 %1, !dbg !53
+  %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !51, !tbaa !44
+  %1 = load fp128, fp128* %0, align 16, !dbg !52, !tbaa !20
+  tail call void @llvm.dbg.value(metadata fp128 %1, i64 0, metadata !50, metadata !17), !dbg !53
+  ret fp128 %1, !dbg !54
 ; X64-LABEL: test_return5:
 ; X64:       .loc
 ; X64:       movq	ld_ptr(%rip), %rax
@@ -89,12 +90,12 @@ entry:
 }
 
 ; Function Attrs: norecurse nounwind readonly uwtable
-define fp128 @test_return6() local_unnamed_addr #1 !dbg !54 {
+define fp128 @test_return6() local_unnamed_addr #1 !dbg !55 {
 entry:
-  %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !55, !tbaa !43
-  %1 = load fp128, fp128* %0, align 16, !dbg !56, !tbaa !19
-  %add = fadd fp128 %1, %1, !dbg !57
-  ret fp128 %add, !dbg !58
+  %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !56, !tbaa !44
+  %1 = load fp128, fp128* %0, align 16, !dbg !57, !tbaa !20
+  %add = fadd fp128 %1, %1, !dbg !58
+  ret fp128 %add, !dbg !59
 ; X64-LABEL: test_return6:
 ; X64:       .loc
 ; X64:       movaps	(%rax), %xmm0
@@ -112,66 +113,68 @@ attributes #0 = { nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-ma
 attributes #1 = { norecurse nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "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" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #2 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!1}
-!llvm.module.flags = !{!7, !8, !9}
-!llvm.ident = !{!10}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10}
+!llvm.ident = !{!11}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "ld_ptr", scope: !2, file: !3, line: 17, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 (trunk 281495)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "fp128-g.c", directory: "/disk5/chh/Debug/ld.loop")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
+!7 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
+!8 = !{i32 2, !"Dwarf Version", i32 4}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"PIC Level", i32 2}
+!11 = !{!"clang version 4.0.0 (trunk 281495)"}
+!12 = distinct !DISubprogram(name: "test_return1", scope: !3, file: !3, line: 3, type: !13, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !15)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!7, !6}
+!15 = !{!16}
+!16 = !DILocalVariable(name: "ptr", arg: 1, scope: !12, file: !3, line: 3, type: !6)
+!17 = !DIExpression()
+!18 = !DILocation(line: 3, column: 39, scope: !12)
+!19 = !DILocation(line: 4, column: 12, scope: !12)
+!20 = !{!21, !21, i64 0}
+!21 = !{!"long double", !22, i64 0}
+!22 = !{!"omnipotent char", !23, i64 0}
+!23 = !{!"Simple C/C++ TBAA"}
+!24 = !DILocation(line: 4, column: 5, scope: !12)
+!25 = distinct !DISubprogram(name: "test_return2", scope: !3, file: !3, line: 7, type: !13, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !26)
+!26 = !{!27, !28}
+!27 = !DILocalVariable(name: "ptr", arg: 1, scope: !25, file: !3, line: 7, type: !6)
+!28 = !DILocalVariable(name: "value", scope: !25, file: !3, line: 8, type: !7)
+!29 = !DILocation(line: 7, column: 39, scope: !25)
+!30 = !DILocation(line: 9, column: 14, scope: !25)
+!31 = !DILocation(line: 8, column: 17, scope: !25)
+!32 = !DILocation(line: 10, column: 5, scope: !25)
+!33 = distinct !DISubprogram(name: "test_return3", scope: !3, file: !3, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !34)
+!34 = !{!35}
+!35 = !DILocalVariable(name: "ptr", arg: 1, scope: !33, file: !3, line: 13, type: !6)
+!36 = !DILocation(line: 13, column: 39, scope: !33)
+!37 = !DILocation(line: 14, column: 12, scope: !33)
+!38 = !DILocation(line: 14, column: 17, scope: !33)
+!39 = !DILocation(line: 14, column: 5, scope: !33)
+!40 = distinct !DISubprogram(name: "test_return4", scope: !3, file: !3, line: 18, type: !41, isLocal: false, isDefinition: true, scopeLine: 18, isOptimized: true, unit: !2, variables: !4)
+!41 = !DISubroutineType(types: !42)
+!42 = !{!7}
+!43 = !DILocation(line: 19, column: 13, scope: !40)
+!44 = !{!45, !45, i64 0}
+!45 = !{!"any pointer", !22, i64 0}
+!46 = !DILocation(line: 19, column: 12, scope: !40)
+!47 = !DILocation(line: 19, column: 5, scope: !40)
+!48 = distinct !DISubprogram(name: "test_return5", scope: !3, file: !3, line: 22, type: !41, isLocal: false, isDefinition: true, scopeLine: 22, isOptimized: true, unit: !2, variables: !49)
+!49 = !{!50}
+!50 = !DILocalVariable(name: "value", scope: !48, file: !3, line: 23, type: !7)
+!51 = !DILocation(line: 23, column: 26, scope: !48)
+!52 = !DILocation(line: 23, column: 25, scope: !48)
+!53 = !DILocation(line: 23, column: 17, scope: !48)
+!54 = !DILocation(line: 24, column: 5, scope: !48)
+!55 = distinct !DISubprogram(name: "test_return6", scope: !3, file: !3, line: 27, type: !41, isLocal: false, isDefinition: true, scopeLine: 27, isOptimized: true, unit: !2, variables: !4)
+!56 = !DILocation(line: 28, column: 13, scope: !55)
+!57 = !DILocation(line: 28, column: 12, scope: !55)
+!58 = !DILocation(line: 28, column: 20, scope: !55)
+!59 = !DILocation(line: 28, column: 5, scope: !55)
 
-!0 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ld_ptr", scope: !1, file: !2, line: 17, type: !5, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (trunk 281495)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "fp128-g.c", directory: "/disk5/chh/Debug/ld.loop")
-!3 = !{}
-!4 = !{!0}
-!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
-!6 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
-!7 = !{i32 2, !"Dwarf Version", i32 4}
-!8 = !{i32 2, !"Debug Info Version", i32 3}
-!9 = !{i32 1, !"PIC Level", i32 2}
-!10 = !{!"clang version 4.0.0 (trunk 281495)"}
-!11 = distinct !DISubprogram(name: "test_return1", scope: !2, file: !2, line: 3, type: !12, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !14)
-!12 = !DISubroutineType(types: !13)
-!13 = !{!6, !5}
-!14 = !{!15}
-!15 = !DILocalVariable(name: "ptr", arg: 1, scope: !11, file: !2, line: 3, type: !5)
-!16 = !DIExpression()
-!17 = !DILocation(line: 3, column: 39, scope: !11)
-!18 = !DILocation(line: 4, column: 12, scope: !11)
-!19 = !{!20, !20, i64 0}
-!20 = !{!"long double", !21, i64 0}
-!21 = !{!"omnipotent char", !22, i64 0}
-!22 = !{!"Simple C/C++ TBAA"}
-!23 = !DILocation(line: 4, column: 5, scope: !11)
-!24 = distinct !DISubprogram(name: "test_return2", scope: !2, file: !2, line: 7, type: !12, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !25)
-!25 = !{!26, !27}
-!26 = !DILocalVariable(name: "ptr", arg: 1, scope: !24, file: !2, line: 7, type: !5)
-!27 = !DILocalVariable(name: "value", scope: !24, file: !2, line: 8, type: !6)
-!28 = !DILocation(line: 7, column: 39, scope: !24)
-!29 = !DILocation(line: 9, column: 14, scope: !24)
-!30 = !DILocation(line: 8, column: 17, scope: !24)
-!31 = !DILocation(line: 10, column: 5, scope: !24)
-!32 = distinct !DISubprogram(name: "test_return3", scope: !2, file: !2, line: 13, type: !12, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !33)
-!33 = !{!34}
-!34 = !DILocalVariable(name: "ptr", arg: 1, scope: !32, file: !2, line: 13, type: !5)
-!35 = !DILocation(line: 13, column: 39, scope: !32)
-!36 = !DILocation(line: 14, column: 12, scope: !32)
-!37 = !DILocation(line: 14, column: 17, scope: !32)
-!38 = !DILocation(line: 14, column: 5, scope: !32)
-!39 = distinct !DISubprogram(name: "test_return4", scope: !2, file: !2, line: 18, type: !40, isLocal: false, isDefinition: true, scopeLine: 18, isOptimized: true, unit: !1, variables: !3)
-!40 = !DISubroutineType(types: !41)
-!41 = !{!6}
-!42 = !DILocation(line: 19, column: 13, scope: !39)
-!43 = !{!44, !44, i64 0}
-!44 = !{!"any pointer", !21, i64 0}
-!45 = !DILocation(line: 19, column: 12, scope: !39)
-!46 = !DILocation(line: 19, column: 5, scope: !39)
-!47 = distinct !DISubprogram(name: "test_return5", scope: !2, file: !2, line: 22, type: !40, isLocal: false, isDefinition: true, scopeLine: 22, isOptimized: true, unit: !1, variables: !48)
-!48 = !{!49}
-!49 = !DILocalVariable(name: "value", scope: !47, file: !2, line: 23, type: !6)
-!50 = !DILocation(line: 23, column: 26, scope: !47)
-!51 = !DILocation(line: 23, column: 25, scope: !47)
-!52 = !DILocation(line: 23, column: 17, scope: !47)
-!53 = !DILocation(line: 24, column: 5, scope: !47)
-!54 = distinct !DISubprogram(name: "test_return6", scope: !2, file: !2, line: 27, type: !40, isLocal: false, isDefinition: true, scopeLine: 27, isOptimized: true, unit: !1, variables: !3)
-!55 = !DILocation(line: 28, column: 13, scope: !54)
-!56 = !DILocation(line: 28, column: 12, scope: !54)
-!57 = !DILocation(line: 28, column: 20, scope: !54)
-!58 = !DILocation(line: 28, column: 5, scope: !54)

+ 45 - 35
test/CodeGen/X86/fpstack-debuginstr-kill.ll

@@ -1,17 +1,19 @@
 ; RUN: llc < %s -mcpu=generic -mtriple=i386-apple-darwin -no-integrated-as
 
-@g1 = global double 0.000000e+00, align 8, !dbg !22
-@g2 = global i32 0, align 4, !dbg !23
+source_filename = "test/CodeGen/X86/fpstack-debuginstr-kill.ll"
 
-define void @_Z16fpuop_arithmeticjj(i32, i32) !dbg !4 {
+@g1 = global double 0.000000e+00, align 8, !dbg !0
+@g2 = global i32 0, align 4, !dbg !7
+
+define void @_Z16fpuop_arithmeticjj(i32, i32) !dbg !16 {
 entry:
   switch i32 undef, label %sw.bb.i1921 [
   ]
 
-sw.bb261:                                         ; preds = %entry, %entry
+sw.bb261:                                         ; No predecessors!
   unreachable
 
-sw.bb.i1921:                                      ; preds = %if.end504
+sw.bb.i1921:                                      ; preds = %entry
   switch i32 undef, label %if.end511 [
     i32 1, label %sw.bb27.i
   ]
@@ -20,7 +22,7 @@ sw.bb27.i:                                        ; preds = %sw.bb.i1921
   %conv.i.i1923 = fpext float undef to x86_fp80
   br label %if.end511
 
-if.end511:                                        ; preds = %sw.bb27.i, %sw.bb13.i
+if.end511:                                        ; preds = %sw.bb27.i, %sw.bb.i1921
   %src.sroa.0.0.src.sroa.0.0.2280 = phi x86_fp80 [ %conv.i.i1923, %sw.bb27.i ], [ undef, %sw.bb.i1921 ]
   switch i32 undef, label %sw.bb992 [
     i32 3, label %sw.bb735
@@ -32,39 +34,47 @@ sw.bb735:                                         ; preds = %if.end511
   unreachable
 
 if.end41.i2210:                                   ; preds = %if.end511
-  call void @llvm.dbg.value(metadata x86_fp80 %src.sroa.0.0.src.sroa.0.0.2280, i64 0, metadata !20, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+  call void @llvm.dbg.value(metadata x86_fp80 %src.sroa.0.0.src.sroa.0.0.2280, i64 0, metadata !25, metadata !26), !dbg !27
   unreachable
 
 sw.bb992:                                         ; preds = %if.end511
   ret void
 }
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
+
+attributes #0 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!10}
+!llvm.module.flags = !{!14, !15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "g1", scope: null, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "f1.cpp", directory: "x87stackifier")
+!3 = !DIDerivedType(tag: DW_TAG_typedef, name: "fpu_extended", file: !2, line: 3, baseType: !4)
+!4 = !DIDerivedType(tag: DW_TAG_typedef, name: "fpu_register", file: !2, line: 2, baseType: !5)
+!5 = !DIDerivedType(tag: DW_TAG_typedef, name: "uae_f64", file: !2, line: 1, baseType: !6)
+!6 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
+!7 = !DIGlobalVariableExpression(var: !8)
+!8 = !DIGlobalVariable(name: "g2", scope: null, file: !2, line: 6, type: !9, isLocal: false, isDefinition: true)
+!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !11, producer: "clang version 3.6.0 (http://llvm.org/git/clang 8444ae7cfeaefae031f8fedf0d1435ca3b14d90b) (http://llvm.org/git/llvm 886f0101a7d176543b831f5efb74c03427244a55)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !12, retainedTypes: !12, globals: !13, imports: !12)
+!11 = !DIFile(filename: "fpu_ieee.cpp", directory: "x87stackifier")
+!12 = !{}
+!13 = !{!0, !7}
+!14 = !{i32 2, !"Dwarf Version", i32 2}
+!15 = !{i32 2, !"Debug Info Version", i32 3}
+!16 = distinct !DISubprogram(name: "fpuop_arithmetic", linkageName: "_Z16fpuop_arithmeticjj", scope: !2, file: !2, line: 11, type: !17, isLocal: false, isDefinition: true, scopeLine: 13, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !10, variables: !20)
+!17 = !DISubroutineType(types: !18)
+!18 = !{null, !19, !19}
+!19 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
+!20 = !{!21, !22, !23, !24, !25}
+!21 = !DILocalVariable(arg: 1, scope: !16, file: !2, line: 11, type: !19)
+!22 = !DILocalVariable(arg: 2, scope: !16, file: !2, line: 11, type: !19)
+!23 = !DILocalVariable(name: "x", scope: !16, file: !2, line: 14, type: !3)
+!24 = !DILocalVariable(name: "a", scope: !16, file: !2, line: 15, type: !9)
+!25 = !DILocalVariable(name: "value", scope: !16, file: !2, line: 16, type: !3)
+!26 = !DIExpression()
+!27 = !DILocation(line: 0, scope: !16)
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!24, !25}
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (http://llvm.org/git/clang 8444ae7cfeaefae031f8fedf0d1435ca3b14d90b) (http://llvm.org/git/llvm 886f0101a7d176543b831f5efb74c03427244a55)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !21, imports: !2)
-!1 = !DIFile(filename: "fpu_ieee.cpp", directory: "x87stackifier")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "fpuop_arithmetic", linkageName: "_Z16fpuop_arithmeticjj", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 13, file: !5, scope: !6, type: !7, variables: !10)
-!5 = !DIFile(filename: "f1.cpp", directory: "x87stackifier")
-!6 = !DIFile(filename: "f1.cpp", directory: "x87stackifier")
-!7 = !DISubroutineType(types: !8)
-!8 = !{null, !9, !9}
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
-!10 = !{!11, !12, !13, !18, !20}
-!11 = !DILocalVariable(name: "", line: 11, arg: 1, scope: !4, file: !6, type: !9)
-!12 = !DILocalVariable(name: "", line: 11, arg: 2, scope: !4, file: !6, type: !9)
-!13 = !DILocalVariable(name: "x", line: 14, scope: !4, file: !6, type: !14)
-!14 = !DIDerivedType(tag: DW_TAG_typedef, name: "fpu_extended", line: 3, file: !5, baseType: !15)
-!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "fpu_register", line: 2, file: !5, baseType: !16)
-!16 = !DIDerivedType(tag: DW_TAG_typedef, name: "uae_f64", line: 1, file: !5, baseType: !17)
-!17 = !DIBasicType(tag: DW_TAG_base_type, name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
-!18 = !DILocalVariable(name: "a", line: 15, scope: !4, file: !6, type: !19)
-!19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!20 = !DILocalVariable(name: "value", line: 16, scope: !4, file: !6, type: !14)
-!21 = !{!22, !23}
-!22 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "g1", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14))
-!23 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "g2", line: 6, isLocal: false, isDefinition: true, scope: null, file: !6, type: !19))
-!24 = !{i32 2, !"Dwarf Version", i32 2}
-!25 = !{i32 2, !"Debug Info Version", i32 3}

+ 42 - 35
test/CodeGen/X86/misched-code-difference-with-debug.ll

@@ -19,16 +19,17 @@
 ; clang -O2 -c test.cpp -emit-llvm -S -g
 ;
 
+source_filename = "test/CodeGen/X86/misched-code-difference-with-debug.ll"
 
 %class.C = type { i8 }
 
-@argc = global i8 0, align 1, !dbg !21
+@argc = global i8 0, align 1, !dbg !0
 
 declare i32 @test_function(%class.C*, i8 signext, i8 signext, i8 signext, ...)
-
 ; CHECK-LABEL: test_without_debug
 ; CHECK: movl [[A:%[a-z]+]], [[B:%[a-z]+]]
 ; CHECK-NEXT: movl [[A]], [[C:%[a-z]+]]
+
 define void @test_without_debug() {
 entry:
   %c = alloca %class.C, align 1
@@ -39,51 +40,57 @@ entry:
   %call2 = call i32 (%class.C*, i8, i8, i8, ...) @test_function(%class.C* %c, i8 signext 0, i8 signext %1, i8 signext 0, i32 %conv)
   ret void
 }
-
 ; CHECK-LABEL: test_with_debug
 ; CHECK: movl [[A]], [[B]]
 ; CHECK-NEXT: movl [[A]], [[C]]
-define void @test_with_debug() !dbg !13 {
+
+define void @test_with_debug() !dbg !17 {
 entry:
   %c = alloca %class.C, align 1
   %0 = load i8, i8* @argc, align 1
-  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !19, metadata !29), !dbg !DILocation(scope: !13)
+  tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !22, metadata !23), !dbg !24
   %conv = sext i8 %0 to i32
-  tail call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !DILocation(scope: !13)
+  tail call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !21, metadata !25), !dbg !24
   %call = call i32 (%class.C*, i8, i8, i8, ...) @test_function(%class.C* %c, i8 signext 0, i8 signext %0, i8 signext 0, i32 %conv)
   %1 = load i8, i8* @argc, align 1
-  call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !DILocation(scope: !13)
+  call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !21, metadata !25), !dbg !24
   %call2 = call i32 (%class.C*, i8, i8, i8, ...) @test_function(%class.C* %c, i8 signext 0, i8 signext %1, i8 signext 0, i32 %conv)
   ret void
 }
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+; Function Attrs: nounwind readnone
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
+
+attributes #0 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!15, !16}
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!22, !23}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "argc", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "test.cpp", directory: "")
+!3 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !6, globals: !14, imports: !5)
+!5 = !{}
+!6 = !{!7}
+!7 = !DICompositeType(tag: DW_TAG_class_type, name: "C", file: !2, line: 2, size: 8, align: 8, elements: !8, identifier: "_ZTS1C")
+!8 = !{!9}
+!9 = !DISubprogram(name: "test", scope: !7, file: !2, type: !10, isLocal: false, isDefinition: false, isOptimized: false)
+!10 = !DISubroutineType(types: !11)
+!11 = !{!12, !13, !3, !3, !3, null}
+!12 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial)
+!14 = !{!0}
+!15 = !{i32 2, !"Dwarf Version", i32 4}
+!16 = !{i32 2, !"Debug Info Version", i32 3}
+!17 = distinct !DISubprogram(name: "test_with_debug", linkageName: "test_with_debug", scope: !2, file: !2, line: 6, type: !18, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !4, variables: !20)
+!18 = !DISubroutineType(types: !19)
+!19 = !{null}
+!20 = !{!21, !22}
+!21 = !DILocalVariable(name: "c", scope: !17, file: !2, line: 7, type: !7)
+!22 = !DILocalVariable(name: "lc", scope: !17, file: !2, line: 8, type: !3)
+!23 = !DIExpression()
+!24 = !DILocation(line: 0, scope: !17)
+!25 = !DIExpression(DW_OP_deref)
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, enums: !2, retainedTypes: !3, globals: !20, imports: !2, emissionKind: FullDebug)
-!1 = !DIFile(filename: "test.cpp", directory: "")
-!2 = !{}
-!3 = !{!4}
-!4 = !DICompositeType(tag: DW_TAG_class_type, name: "C", line: 2, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1C")
-!5 = !{!6}
-!6 = !DISubprogram(name: "test", file: !1, scope: !4, type: !7, isDefinition: false)
-!7 = !DISubroutineType(types: !8)
-!8 = !{!9, !10, !11, !11, !11, null}
-!9 = !DIBasicType(encoding: DW_ATE_signed, size: 32, align: 32, name: "int")
-!10 = !DIDerivedType(baseType: !4, tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial)
-!11 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!13 = distinct !DISubprogram(name: "test_with_debug", linkageName: "test_with_debug", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 6, file: !1, scope: !14, type: !15, variables: !17)
-!14 = !DIFile(filename: "test.cpp", directory: "")
-!15 = !DISubroutineType(types: !16)
-!16 = !{null}
-!17 = !{!18, !19}
-!18 = !DILocalVariable(name: "c", line: 7, scope: !13, file: !14, type: !4)
-!19 = !DILocalVariable(name: "lc", line: 8, scope: !13, file: !14, type: !11)
-!20 = !{!21}
-!21 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "argc", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !11))
-!22 = !{i32 2, !"Dwarf Version", i32 4}
-!23 = !{i32 2, !"Debug Info Version", i32 3}
-!25 = !DILocation(line: 8, column: 3, scope: !13)
-!29 = !DIExpression()

+ 12 - 11
test/CodeGen/X86/null-streamer.ll

@@ -3,7 +3,9 @@
 ; RUN: llc -filetype=null -o %t -march=x86 %s
 ; RUN: llc -filetype=null -o %t -mtriple=i686-cygwin %s
 
-define void @f0()  {
+source_filename = "test/CodeGen/X86/null-streamer.ll"
+
+define void @f0() {
   ret void
 }
 
@@ -12,16 +14,15 @@ define void @f1() {
 }
 
 !llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!11, !13}
+!llvm.module.flags = !{!7, !8}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: " ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !9, imports: !2)
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: " ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
 !1 = !DIFile(filename: "file.c", directory: "")
 !2 = !{}
-!4 = distinct !DISubprogram(name: "", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !1, type: !6, variables: !2)
-!6 = !DISubroutineType(types: !7)
-!7 = !{!8}
-!8 = !DIBasicType(tag: DW_TAG_base_type, size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !{!10}
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", linkageName: "_ZL1i", line: 1, isLocal: true, isDefinition: true, scope: null, file: !1, type: !8))
-!11 = !{i32 2, !"Dwarf Version", i32 3}
-!13 = !{i32 1, !"Debug Info Version", i32 3}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", scope: null, file: !1, line: 1, type: !6, isLocal: true, isDefinition: true)
+!6 = !DIBasicType(size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !{i32 2, !"Dwarf Version", i32 3}
+!8 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 12 - 10
test/DebugInfo/AArch64/big-endian.ll

@@ -1,22 +1,24 @@
 ; RUN: llc %s -filetype=asm -o -
 
+source_filename = "test/DebugInfo/AArch64/big-endian.ll"
 target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
 target triple = "aarch64_be--none-eabi"
 
-@a = common global i32 0, align 4, !dbg !4
+@a = common global i32 0, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
+!llvm.dbg.cu = !{!4}
 !llvm.module.flags = !{!8, !9}
 !llvm.ident = !{!10}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "-", directory: "/work/validation")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !7))
-!5 = !DIFile(filename: "<stdin>", directory: "/work/validation")
-!6 = !{!"<stdin>", !"/work/validation"}
-!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "<stdin>", directory: "/work/validation")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5, producer: "clang version 3.6.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, retainedTypes: !6, globals: !7, imports: !6)
+!5 = !DIFile(filename: "-", directory: "/work/validation")
+!6 = !{}
+!7 = !{!0}
 !8 = !{i32 2, !"Dwarf Version", i32 4}
 !9 = !{i32 2, !"Debug Info Version", i32 3}
 !10 = !{!"clang version 3.6.0 "}
+

+ 15 - 13
test/DebugInfo/AArch64/bitfields.ll

@@ -43,31 +43,33 @@
 ; CHECK-NEXT: DW_AT_data_member_location {{.*}} 08
 
 ; ModuleID = 'bitfields.c'
+source_filename = "test/DebugInfo/AArch64/bitfields.ll"
 target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
 target triple = "aarch64_be--linux-gnu"
 
 %struct.bitfield = type <{ i8, [3 x i8], i64 }>
 
-@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !4
+@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
+!llvm.dbg.cu = !{!2}
 !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: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "bitfields.c", directory: "/")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true))
-!5 = !DIFile(filename: "bitfields.c", directory: "/")
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, elements: !7)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "bitfields.c", directory: "/")
+!4 = !{}
+!5 = !{!0}
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !3, line: 1, size: 96, elements: !7)
 !7 = !{!8, !10, !11, !12}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2)
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !3, line: 2, baseType: !9, size: 2)
 !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, offset: 32)
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, offset: 64)
-!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, offset: 65)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !3, line: 3, baseType: !9, size: 32, offset: 32)
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !3, line: 4, baseType: !9, size: 1, offset: 64)
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !3, line: 5, baseType: !9, size: 28, offset: 65)
 !13 = !{i32 2, !"Dwarf Version", i32 2}
 !14 = !{i32 2, !"Debug Info Version", i32 3}
 !15 = !{i32 1, !"PIC Level", i32 2}
 !16 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}
+

+ 172 - 171
test/DebugInfo/AArch64/frameindices.ll

@@ -33,105 +33,106 @@
 ;   f11(c);
 ; }
 ; ModuleID = 'test.cpp'
+source_filename = "test/DebugInfo/AArch64/frameindices.ll"
 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
 target triple = "aarch64-apple-ios"
 
 %struct.A = type { i8, i8*, i8 }
 %struct.B = type { i8 }
 
-@a = global i64 0, align 8, !dbg !41
-@b = global i32* null, align 8, !dbg !42
+@a = global i64 0, align 8, !dbg !0
+@b = global i32* null, align 8, !dbg !4
 
-define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 !dbg !25 {
+define void @_Z3f131A(%struct.A* nocapture readonly %p1) !dbg !32 {
 entry:
   %agg.tmp = alloca %struct.A, align 8
-  tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !30, metadata !46), !dbg !47
-  %0 = load i64, i64* @a, align 8, !dbg !48, !tbaa !49
-  %call = tail call noalias i8* @_Znwm(i64 %0) #5, !dbg !53
-  store i8* %call, i8** bitcast (i32** @b to i8**), align 8, !dbg !54, !tbaa !55
-  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp, i64 0, i32 0, !dbg !57
-  %2 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !57
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 8, i1 false), !dbg !57, !tbaa.struct !58
-  call void @_Z2f91A(%struct.A* %agg.tmp), !dbg !61
-  ret void, !dbg !62
+  tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !36, metadata !37), !dbg !38
+  %0 = load i64, i64* @a, align 8, !dbg !39, !tbaa !40
+  %call = tail call noalias i8* @_Znwm(i64 %0) #4, !dbg !44
+  store i8* %call, i8** bitcast (i32** @b to i8**), align 8, !dbg !45, !tbaa !46
+  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp, i64 0, i32 0, !dbg !48
+  %2 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !48
+  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 8, i1 false), !dbg !48, !tbaa.struct !49
+  call void @_Z2f91A(%struct.A* %agg.tmp), !dbg !52
+  ret void, !dbg !53
 }
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
 
 ; Function Attrs: nobuiltin
-declare noalias i8* @_Znwm(i64) #2
+declare noalias i8* @_Znwm(i64) #1
 
-declare void @_Z2f91A(%struct.A*) #0
+declare void @_Z2f91A(%struct.A*)
 
-; Function Attrs: nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #3
+; Function Attrs: argmemonly nounwind
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #2
 
-define void @_Z3f111A(%struct.A* nocapture readonly %p1) #0 !dbg !31 {
+define void @_Z3f111A(%struct.A* nocapture readonly %p1) !dbg !54 {
 entry:
   %agg.tmp.i = alloca %struct.A, align 8
-  tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !33, metadata !46), !dbg !63
-  %0 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !64
-  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i, i64 0, i32 0, !dbg !65
-  call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !65
-  %2 = load i64, i64* @a, align 8, !dbg !67, !tbaa !49
-  %call.i = tail call noalias i8* @_Znwm(i64 %2) #5, !dbg !68
-  store i8* %call.i, i8** bitcast (i32** @b to i8**), align 8, !dbg !69, !tbaa !55
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %0, i64 24, i32 8, i1 false), !dbg !70
-  call void @_Z2f91A(%struct.A* %agg.tmp.i), !dbg !71
-  call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !72
-  ret void, !dbg !73
+  tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !56, metadata !37), !dbg !57
+  %0 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !58
+  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i, i64 0, i32 0, !dbg !59
+  call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !59
+  %2 = load i64, i64* @a, align 8, !dbg !61, !tbaa !40
+  %call.i = tail call noalias i8* @_Znwm(i64 %2) #4, !dbg !62
+  store i8* %call.i, i8** bitcast (i32** @b to i8**), align 8, !dbg !63, !tbaa !46
+  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %0, i64 24, i32 8, i1 false), !dbg !64
+  call void @_Z2f91A(%struct.A* %agg.tmp.i), !dbg !65
+  call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !66
+  ret void, !dbg !67
 }
 
-define void @_Z3f16v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !34 {
+define void @_Z3f16v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !68 {
 entry:
   %agg.tmp.i.i = alloca %struct.A, align 8
   %d = alloca %struct.B, align 1
   %agg.tmp.sroa.2 = alloca [15 x i8], align 1
   %agg.tmp.sroa.4 = alloca [7 x i8], align 1
-  tail call void @llvm.dbg.declare(metadata [15 x i8]* %agg.tmp.sroa.2, metadata !74, metadata !76), !dbg !77
-  tail call void @llvm.dbg.declare(metadata [7 x i8]* %agg.tmp.sroa.4, metadata !74, metadata !78), !dbg !77
-  tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !38, metadata !79), !dbg !80
-  %0 = load i64, i64* @a, align 8, !dbg !81, !tbaa !49
-  tail call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
-  %call = call %struct.B* @_ZN1BC1El(%struct.B* %d, i64 %0), !dbg !82
-  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !38, metadata !83), !dbg !80
-  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !38, metadata !84), !dbg !80
-  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !74, metadata !83), !dbg !77
-  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !74, metadata !84), !dbg !77
-  call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !74, metadata !46), !dbg !77
-  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 0, !dbg !85
-  call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !85
-  %2 = load i64, i64* @a, align 8, !dbg !87, !tbaa !49
-  %call.i.i5 = invoke noalias i8* @_Znwm(i64 %2) #5
-          to label %call.i.i.noexc unwind label %lpad, !dbg !88
+  tail call void @llvm.dbg.declare(metadata [15 x i8]* %agg.tmp.sroa.2, metadata !56, metadata !74), !dbg !75
+  tail call void @llvm.dbg.declare(metadata [7 x i8]* %agg.tmp.sroa.4, metadata !56, metadata !77), !dbg !75
+  tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !72, metadata !37), !dbg !78
+  %0 = load i64, i64* @a, align 8, !dbg !79, !tbaa !40
+  tail call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !73, metadata !37), !dbg !80
+  %call = call %struct.B* @_ZN1BC1El(%struct.B* %d, i64 %0), !dbg !80
+  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !72, metadata !81), !dbg !78
+  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !72, metadata !82), !dbg !78
+  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !56, metadata !81), !dbg !75
+  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !56, metadata !82), !dbg !75
+  call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !56, metadata !37), !dbg !75
+  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 0, !dbg !83
+  call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !83
+  %2 = load i64, i64* @a, align 8, !dbg !85, !tbaa !40
+  %call.i.i5 = invoke noalias i8* @_Znwm(i64 %2) #4
+          to label %call.i.i.noexc unwind label %lpad, !dbg !86
 
 call.i.i.noexc:                                   ; preds = %entry
-  %agg.tmp.sroa.4.17..sroa_idx = getelementptr inbounds [7 x i8], [7 x i8]* %agg.tmp.sroa.4, i64 0, i64 0, !dbg !89
-  %agg.tmp.sroa.2.1..sroa_idx = getelementptr inbounds [15 x i8], [15 x i8]* %agg.tmp.sroa.2, i64 0, i64 0, !dbg !89
-  store i8* %call.i.i5, i8** bitcast (i32** @b to i8**), align 8, !dbg !90, !tbaa !55
-  store i8 1, i8* %1, align 8, !dbg !91
-  %agg.tmp.sroa.2.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 1, !dbg !91
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.2.0..sroa_raw_idx, i8* %agg.tmp.sroa.2.1..sroa_idx, i64 15, i32 1, i1 false), !dbg !91
-  %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 2, !dbg !91
-  store i8 1, i8* %agg.tmp.sroa.3.0..sroa_idx, align 8, !dbg !91
-  %agg.tmp.sroa.4.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 17, !dbg !91
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.4.0..sroa_raw_idx, i8* %agg.tmp.sroa.4.17..sroa_idx, i64 7, i32 1, i1 false), !dbg !91
+  %agg.tmp.sroa.4.17..sroa_idx = getelementptr inbounds [7 x i8], [7 x i8]* %agg.tmp.sroa.4, i64 0, i64 0, !dbg !87
+  %agg.tmp.sroa.2.1..sroa_idx = getelementptr inbounds [15 x i8], [15 x i8]* %agg.tmp.sroa.2, i64 0, i64 0, !dbg !87
+  store i8* %call.i.i5, i8** bitcast (i32** @b to i8**), align 8, !dbg !88, !tbaa !46
+  store i8 1, i8* %1, align 8, !dbg !89
+  %agg.tmp.sroa.2.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 1, !dbg !89
+  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.2.0..sroa_raw_idx, i8* %agg.tmp.sroa.2.1..sroa_idx, i64 15, i32 1, i1 false), !dbg !89
+  %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 2, !dbg !89
+  store i8 1, i8* %agg.tmp.sroa.3.0..sroa_idx, align 8, !dbg !89
+  %agg.tmp.sroa.4.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 17, !dbg !89
+  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.4.0..sroa_raw_idx, i8* %agg.tmp.sroa.4.17..sroa_idx, i64 7, i32 1, i1 false), !dbg !89
   invoke void @_Z2f91A(%struct.A* %agg.tmp.i.i)
-          to label %invoke.cont unwind label %lpad, !dbg !92
+          to label %invoke.cont unwind label %lpad, !dbg !90
 
 invoke.cont:                                      ; preds = %call.i.i.noexc
-  call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !93
-  call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
-  %call1 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !94
-  ret void, !dbg !94
+  call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !91
+  call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !73, metadata !37), !dbg !80
+  %call1 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !92
+  ret void, !dbg !92
 
 lpad:                                             ; preds = %call.i.i.noexc, %entry
   %3 = landingpad { i8*, i32 }
-          cleanup, !dbg !94
-  call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
-  %call2 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !94
-  resume { i8*, i32 } %3, !dbg !94
+          cleanup, !dbg !92
+  call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !73, metadata !37), !dbg !80
+  %call2 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !92
+  resume { i8*, i32 } %3, !dbg !92
 }
 
 declare %struct.B* @_ZN1BC1El(%struct.B*, i64)
@@ -139,118 +140,118 @@ declare %struct.B* @_ZN1BC1El(%struct.B*, i64)
 declare i32 @__gxx_personality_v0(...)
 
 ; Function Attrs: nounwind
-declare %struct.B* @_ZN1BD1Ev(%struct.B*) #4
+declare %struct.B* @_ZN1BD1Ev(%struct.B*) #3
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
 
-; Function Attrs: nounwind
-declare void @llvm.lifetime.start(i64, i8* nocapture) #3
+; Function Attrs: argmemonly nounwind
+declare void @llvm.lifetime.start(i64, i8* nocapture) #2
 
-; Function Attrs: nounwind
-declare void @llvm.lifetime.end(i64, i8* nocapture) #3
+; Function Attrs: argmemonly nounwind
+declare void @llvm.lifetime.end(i64, i8* nocapture) #2
 
-attributes #1 = { nounwind readnone }
-attributes #2 = { nobuiltin }
+attributes #0 = { nounwind readnone }
+attributes #1 = { nobuiltin }
+attributes #2 = { argmemonly nounwind }
 attributes #3 = { nounwind }
-attributes #4 = { nounwind  }
-attributes #5 = { builtin }
+attributes #4 = { builtin }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!43, !44}
-!llvm.ident = !{!45}
+!llvm.dbg.cu = !{!8}
+!llvm.module.flags = !{!29, !30}
+!llvm.ident = !{!31}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !40, imports: !2)
-!1 = !DIFile(filename: "<stdin>", directory: "")
-!2 = !{}
-!3 = !{!4, !12, !14}
-!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 2, size: 192, align: 64, file: !5, elements: !6, identifier: "_ZTS1A")
-!5 = !DIFile(filename: "test.cpp", directory: "")
-!6 = !{!7, !9, !11}
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "x4", line: 3, size: 8, align: 8, file: !5, scope: !4, baseType: !8)
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "x5", line: 4, size: 64, align: 64, offset: 64, file: !5, scope: !4, baseType: !10)
-!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "x6", line: 5, size: 8, align: 8, offset: 128, file: !5, scope: !4, baseType: !8)
-!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13)
-!13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "B", line: 8, size: 8, align: 8, file: !5, elements: !15, identifier: "_ZTS1B")
-!15 = !{!16, !21}
-!16 = !DISubprogram(name: "B", line: 9, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !14, type: !17)
-!17 = !DISubroutineType(types: !18)
-!18 = !{null, !19, !20}
-!19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !14)
-!20 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
-!21 = !DISubprogram(name: "~B", line: 10, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !5, scope: !14, type: !22)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "test.cpp", directory: "")
+!3 = !DIBasicType(name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 7, type: !6, isLocal: false, isDefinition: true)
+!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !9, producer: "clang version 3.7.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, retainedTypes: !11, globals: !28, imports: !10)
+!9 = !DIFile(filename: "<stdin>", directory: "")
+!10 = !{}
+!11 = !{!12, !6, !19}
+!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !2, line: 2, size: 192, align: 64, elements: !13, identifier: "_ZTS1A")
+!13 = !{!14, !16, !18}
+!14 = !DIDerivedType(tag: DW_TAG_member, name: "x4", scope: !12, file: !2, line: 3, baseType: !15, size: 8, align: 8)
+!15 = !DIBasicType(name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
+!16 = !DIDerivedType(tag: DW_TAG_member, name: "x5", scope: !12, file: !2, line: 4, baseType: !17, size: 64, align: 64, offset: 64)
+!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64)
+!18 = !DIDerivedType(tag: DW_TAG_member, name: "x6", scope: !12, file: !2, line: 5, baseType: !15, size: 8, align: 8, offset: 128)
+!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !2, line: 8, size: 8, align: 8, elements: !20, identifier: "_ZTS1B")
+!20 = !{!21, !25}
+!21 = !DISubprogram(name: "B", scope: !19, file: !2, line: 9, type: !22, isLocal: false, isDefinition: false, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true)
 !22 = !DISubroutineType(types: !23)
-!23 = !{null, !19}
-!25 = distinct !DISubprogram(name: "f13", linkageName: "_Z3f131A", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 13, file: !5, scope: !26, type: !27, variables: !29)
-!26 = !DIFile(filename: "test.cpp", directory: "")
-!27 = !DISubroutineType(types: !28)
-!28 = !{null, !4}
-!29 = !{!30}
-!30 = !DILocalVariable(name: "p1", line: 13, arg: 1, scope: !25, file: !26, type: !4)
-!31 = distinct !DISubprogram(name: "f11", linkageName: "_Z3f111A", line: 17, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 17, file: !5, scope: !26, type: !27, variables: !32)
-!32 = !{!33}
-!33 = !DILocalVariable(name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !4)
-!34 = distinct !DISubprogram(name: "f16", linkageName: "_Z3f16v", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 18, file: !5, scope: !26, type: !35, variables: !37)
-!35 = !DISubroutineType(types: !36)
-!36 = !{null}
-!37 = !{!38, !39}
-!38 = !DILocalVariable(name: "c", line: 19, scope: !34, file: !26, type: !4)
-!39 = !DILocalVariable(name: "d", line: 20, scope: !34, file: !26, type: !14)
-!40 = !{!41, !42}
-!41 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !26, type: !20))
-!42 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", line: 7, isLocal: false, isDefinition: true, scope: null, file: !26, type: !12))
-!43 = !{i32 2, !"Dwarf Version", i32 2}
-!44 = !{i32 2, !"Debug Info Version", i32 3}
-!45 = !{!"clang version 3.7.0 "}
-!46 = !DIExpression(DW_OP_deref)
-!47 = !DILocation(line: 13, column: 12, scope: !25)
-!48 = !DILocation(line: 14, column: 37, scope: !25)
-!49 = !{!50, !50, i64 0}
-!50 = !{!"long", !51, i64 0}
-!51 = !{!"omnipotent char", !52, i64 0}
-!52 = !{!"Simple C/C++ TBAA"}
-!53 = !DILocation(line: 14, column: 14, scope: !25)
-!54 = !DILocation(line: 14, column: 5, scope: !25)
-!55 = !{!56, !56, i64 0}
-!56 = !{!"any pointer", !51, i64 0}
-!57 = !DILocation(line: 15, column: 6, scope: !25)
-!58 = !{i64 0, i64 1, !59, i64 8, i64 8, !55, i64 16, i64 1, !59}
-!59 = !{!60, !60, i64 0}
-!60 = !{!"bool", !51, i64 0}
-!61 = !DILocation(line: 15, column: 3, scope: !25)
-!62 = !DILocation(line: 16, column: 1, scope: !25)
-!63 = !DILocation(line: 17, column: 12, scope: !31)
-!64 = !DILocation(line: 17, column: 22, scope: !31)
-!65 = !DILocation(line: 13, column: 12, scope: !25, inlinedAt: !66)
-!66 = distinct !DILocation(line: 17, column: 18, scope: !31)
-!67 = !DILocation(line: 14, column: 37, scope: !25, inlinedAt: !66)
-!68 = !DILocation(line: 14, column: 14, scope: !25, inlinedAt: !66)
-!69 = !DILocation(line: 14, column: 5, scope: !25, inlinedAt: !66)
-!70 = !DILocation(line: 15, column: 6, scope: !25, inlinedAt: !66)
-!71 = !DILocation(line: 15, column: 3, scope: !25, inlinedAt: !66)
-!72 = !DILocation(line: 16, column: 1, scope: !25, inlinedAt: !66)
-!73 = !DILocation(line: 17, column: 27, scope: !31)
-!74 = !DILocalVariable(name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !4)
-!75 = distinct !DILocation(line: 22, column: 3, scope: !34)
-!76 = !DIExpression(DW_OP_LLVM_fragment, 8, 120)
-!77 = !DILocation(line: 17, column: 12, scope: !31, inlinedAt: !75)
-!78 = !DIExpression(DW_OP_LLVM_fragment, 136, 56)
-!79 = !DIExpression(DW_OP_deref)
-!80 = !DILocation(line: 19, column: 5, scope: !34)
-!81 = !DILocation(line: 20, column: 7, scope: !34)
-!82 = !DILocation(line: 20, column: 5, scope: !34)
-!83 = !DIExpression(DW_OP_LLVM_fragment, 0, 8)
-!84 = !DIExpression(DW_OP_LLVM_fragment, 128, 8)
-!85 = !DILocation(line: 13, column: 12, scope: !25, inlinedAt: !86)
-!86 = distinct !DILocation(line: 17, column: 18, scope: !31, inlinedAt: !75)
-!87 = !DILocation(line: 14, column: 37, scope: !25, inlinedAt: !86)
-!88 = !DILocation(line: 14, column: 14, scope: !25, inlinedAt: !86)
-!89 = !DILocation(line: 22, column: 7, scope: !34)
-!90 = !DILocation(line: 14, column: 5, scope: !25, inlinedAt: !86)
-!91 = !DILocation(line: 15, column: 6, scope: !25, inlinedAt: !86)
-!92 = !DILocation(line: 15, column: 3, scope: !25, inlinedAt: !86)
-!93 = !DILocation(line: 16, column: 1, scope: !25, inlinedAt: !86)
-!94 = !DILocation(line: 23, column: 1, scope: !34)
+!23 = !{null, !24, !3}
+!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!25 = !DISubprogram(name: "~B", scope: !19, file: !2, line: 10, type: !26, isLocal: false, isDefinition: false, scopeLine: 10, flags: DIFlagPrototyped, isOptimized: true)
+!26 = !DISubroutineType(types: !27)
+!27 = !{null, !24}
+!28 = !{!0, !4}
+!29 = !{i32 2, !"Dwarf Version", i32 2}
+!30 = !{i32 2, !"Debug Info Version", i32 3}
+!31 = !{!"clang version 3.7.0 "}
+!32 = distinct !DISubprogram(name: "f13", linkageName: "_Z3f131A", scope: !2, file: !2, line: 13, type: !33, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !8, variables: !35)
+!33 = !DISubroutineType(types: !34)
+!34 = !{null, !12}
+!35 = !{!36}
+!36 = !DILocalVariable(name: "p1", arg: 1, scope: !32, file: !2, line: 13, type: !12)
+!37 = !DIExpression(DW_OP_deref)
+!38 = !DILocation(line: 13, column: 12, scope: !32)
+!39 = !DILocation(line: 14, column: 37, scope: !32)
+!40 = !{!41, !41, i64 0}
+!41 = !{!"long", !42, i64 0}
+!42 = !{!"omnipotent char", !43, i64 0}
+!43 = !{!"Simple C/C++ TBAA"}
+!44 = !DILocation(line: 14, column: 14, scope: !32)
+!45 = !DILocation(line: 14, column: 5, scope: !32)
+!46 = !{!47, !47, i64 0}
+!47 = !{!"any pointer", !42, i64 0}
+!48 = !DILocation(line: 15, column: 6, scope: !32)
+!49 = !{i64 0, i64 1, !50, i64 8, i64 8, !46, i64 16, i64 1, !50}
+!50 = !{!51, !51, i64 0}
+!51 = !{!"bool", !42, i64 0}
+!52 = !DILocation(line: 15, column: 3, scope: !32)
+!53 = !DILocation(line: 16, column: 1, scope: !32)
+!54 = distinct !DISubprogram(name: "f11", linkageName: "_Z3f111A", scope: !2, file: !2, line: 17, type: !33, isLocal: false, isDefinition: true, scopeLine: 17, flags: DIFlagPrototyped, isOptimized: true, unit: !8, variables: !55)
+!55 = !{!56}
+!56 = !DILocalVariable(name: "p1", arg: 1, scope: !54, file: !2, line: 17, type: !12)
+!57 = !DILocation(line: 17, column: 12, scope: !54)
+!58 = !DILocation(line: 17, column: 22, scope: !54)
+!59 = !DILocation(line: 13, column: 12, scope: !32, inlinedAt: !60)
+!60 = distinct !DILocation(line: 17, column: 18, scope: !54)
+!61 = !DILocation(line: 14, column: 37, scope: !32, inlinedAt: !60)
+!62 = !DILocation(line: 14, column: 14, scope: !32, inlinedAt: !60)
+!63 = !DILocation(line: 14, column: 5, scope: !32, inlinedAt: !60)
+!64 = !DILocation(line: 15, column: 6, scope: !32, inlinedAt: !60)
+!65 = !DILocation(line: 15, column: 3, scope: !32, inlinedAt: !60)
+!66 = !DILocation(line: 16, column: 1, scope: !32, inlinedAt: !60)
+!67 = !DILocation(line: 17, column: 27, scope: !54)
+!68 = distinct !DISubprogram(name: "f16", linkageName: "_Z3f16v", scope: !2, file: !2, line: 18, type: !69, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: true, unit: !8, variables: !71)
+!69 = !DISubroutineType(types: !70)
+!70 = !{null}
+!71 = !{!72, !73}
+!72 = !DILocalVariable(name: "c", scope: !68, file: !2, line: 19, type: !12)
+!73 = !DILocalVariable(name: "d", scope: !68, file: !2, line: 20, type: !19)
+!74 = !DIExpression(DW_OP_LLVM_fragment, 8, 120)
+!75 = !DILocation(line: 17, column: 12, scope: !54, inlinedAt: !76)
+!76 = distinct !DILocation(line: 22, column: 3, scope: !68)
+!77 = !DIExpression(DW_OP_LLVM_fragment, 136, 56)
+!78 = !DILocation(line: 19, column: 5, scope: !68)
+!79 = !DILocation(line: 20, column: 7, scope: !68)
+!80 = !DILocation(line: 20, column: 5, scope: !68)
+!81 = !DIExpression(DW_OP_LLVM_fragment, 0, 8)
+!82 = !DIExpression(DW_OP_LLVM_fragment, 128, 8)
+!83 = !DILocation(line: 13, column: 12, scope: !32, inlinedAt: !84)
+!84 = distinct !DILocation(line: 17, column: 18, scope: !54, inlinedAt: !76)
+!85 = !DILocation(line: 14, column: 37, scope: !32, inlinedAt: !84)
+!86 = !DILocation(line: 14, column: 14, scope: !32, inlinedAt: !84)
+!87 = !DILocation(line: 22, column: 7, scope: !68)
+!88 = !DILocation(line: 14, column: 5, scope: !32, inlinedAt: !84)
+!89 = !DILocation(line: 15, column: 6, scope: !32, inlinedAt: !84)
+!90 = !DILocation(line: 15, column: 3, scope: !32, inlinedAt: !84)
+!91 = !DILocation(line: 16, column: 1, scope: !32, inlinedAt: !84)
+!92 = !DILocation(line: 23, column: 1, scope: !68)
+

+ 23 - 20
test/DebugInfo/ARM/big-endian-bitfield.ll

@@ -8,45 +8,48 @@
 ;     int n:8;
 ;   } s;
 
+source_filename = "test/DebugInfo/ARM/big-endian-bitfield.ll"
 target datalayout = "E-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
 
 %struct.S = type { i24 }
 
-@s = common global %struct.S zeroinitializer, align 4, !dbg !4
+@s = common global %struct.S zeroinitializer, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!12, !13, !14}
-!llvm.ident = !{!15}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!13, !14, !15}
+!llvm.ident = !{!16}
 
-!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 !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true))
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 1, size: 32, elements: !6)
-!6 = !{!7, !9, !10, !11}
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 6, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 267633)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm")
+!4 = !{}
+!5 = !{!0}
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 1, size: 32, elements: !7)
+!7 = !{!8, !10, !11, !12}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "j", scope: !6, file: !3, line: 2, baseType: !9, size: 5)
 ; CHECK: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name{{.*}}"j"
 ; CHECK-NOT:  DW_TAG
 ; CHECK:      DW_AT_data_bit_offset      [DW_FORM_data1]	(0x00)
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "j", scope: !5, file: !1, line: 2, baseType: !8, size: 5)
-!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "k", scope: !6, file: !3, line: 3, baseType: !9, size: 6, offset: 5)
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !6, file: !3, line: 4, baseType: !9, size: 5, offset: 11)
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !6, file: !3, line: 5, baseType: !9, size: 8, offset: 16)
+!13 = !{i32 2, !"Dwarf Version", i32 4}
 ; CHECK: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name{{.*}}"k"
 ; CHECK-NOT:  DW_TAG
 ; CHECK:      DW_AT_data_bit_offset      [DW_FORM_data1]	(0x05)
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "k", scope: !5, file: !1, line: 3, baseType: !8, size: 6, offset: 5)
+!14 = !{i32 2, !"Debug Info Version", i32 3}
 ; CHECK: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name{{.*}}"m"
 ; CHECK-NOT:  DW_TAG
 ; CHECK:      DW_AT_data_bit_offset      [DW_FORM_data1]	(0x0b)
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !5, file: !1, line: 4, baseType: !8, size: 5, offset: 11)
+!15 = !{i32 1, !"PIC Level", i32 2}
 ; CHECK: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name{{.*}}"n"
 ; CHECK-NOT:  DW_TAG
 ; CHECK:      DW_AT_data_bit_offset      [DW_FORM_data1]	(0x10)
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !5, file: !1, line: 5, baseType: !8, size: 8, offset: 16)
-!12 = !{i32 2, !"Dwarf Version", i32 4}
-!13 = !{i32 2, !"Debug Info Version", i32 3}
-!14 = !{i32 1, !"PIC Level", i32 2}
-!15 = !{!"clang version 3.9.0 (trunk 267633)"}
+!16 = !{!"clang version 3.9.0 (trunk 267633)"}
+

+ 24 - 21
test/DebugInfo/ARM/bitfield.ll

@@ -15,31 +15,34 @@
 ; CHECK:          DW_AT_bit_size   {{.*}} (0x1c)
 ; CHECK:          DW_AT_bit_offset {{.*}} (0xfffffffffffffff8)
 ; CHECK:          DW_AT_data_member_location {{.*}}00
+source_filename = "test/DebugInfo/ARM/bitfield.ll"
 target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
 target triple = "thumbv7-apple-ios"
 
 %struct.anon = type { i8, [5 x i8] }
 
-@a = common global %struct.anon zeroinitializer, align 1, !dbg !4
+@a = common global %struct.anon zeroinitializer, align 1, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!11, !12, !13, !14, !15}
-!llvm.ident = !{!16}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!12, !13, !14, !15, !16}
+!llvm.ident = !{!17}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 5, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "test.i", directory: "/")
+!4 = !{}
+!5 = !{!0}
+!6 = !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 48, align: 8, elements: !7)
+!7 = !{!8, !10}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !3, line: 2, baseType: !9, size: 8, align: 8)
+!9 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "reserved", scope: !6, file: !3, line: 4, baseType: !11, size: 28, align: 32, offset: 12)
+!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!12 = !{i32 2, !"Dwarf Version", i32 2}
+!13 = !{i32 2, !"Debug Info Version", i32 3}
+!14 = !{i32 1, !"wchar_size", i32 4}
+!15 = !{i32 1, !"min_enum_size", i32 4}
+!16 = !{i32 1, !"PIC Level", i32 2}
+!17 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}
 
-!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: "test.i", directory: "/")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true))
-!5 = !DICompositeType(tag: DW_TAG_structure_type, file: !1, line: 1, size: 48, align: 8, elements: !6)
-!6 = !{!7, !9}
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !1, line: 2, baseType: !8, size: 8, align: 8)
-!8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "reserved", scope: !5, file: !1, line: 4, baseType: !10, size: 28, align: 32, offset: 12)
-!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!11 = !{i32 2, !"Dwarf Version", i32 2}
-!12 = !{i32 2, !"Debug Info Version", i32 3}
-!13 = !{i32 1, !"wchar_size", i32 4}
-!14 = !{i32 1, !"min_enum_size", i32 4}
-!15 = !{i32 1, !"PIC Level", i32 2}
-!16 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}

+ 29 - 26
test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll

@@ -12,14 +12,15 @@
 ; CHECK: .loc 1 7 7
 ; CHECK: mov  r{{[0-9]}}, #0
 
+source_filename = "test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll"
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 target triple = "armv7--linux-gnueabihf"
 
-@ch = common global i8 0, align 1, !dbg !8
-@b = common global i32 0, align 4, !dbg !10
+@ch = common global i8 0, align 1, !dbg !0
+@b = common global i32 0, align 4, !dbg !5
 
 ; Function Attrs: nounwind
-define void @proc() #0 !dbg !4 {
+define void @proc() #0 !dbg !13 {
 entry:
   store i8 65, i8* @ch, align 1, !dbg !17
   store i32 0, i32* @b, align 4, !dbg !18
@@ -28,26 +29,28 @@ entry:
 
 attributes #0 = { nounwind "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"="cortex-a8" "target-features"="+neon,+vfp3" "unsafe-fp-math"="false" "use-soft-float"="false" }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!12, !13, !14, !15}
-!llvm.ident = !{!16}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, emissionKind: FullDebug)
-!1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "proc", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!5 = !DISubroutineType(types: !6)
-!6 = !{null}
-!7 = !{!8, !10}
-!8 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ch", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true))
-!9 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 2, type: !11, isLocal: false, isDefinition: true))
-!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!12 = !{i32 2, !"Dwarf Version", i32 4}
-!13 = !{i32 2, !"Debug Info Version", i32 3}
-!14 = !{i32 1, !"wchar_size", i32 4}
-!15 = !{i32 1, !"min_enum_size", i32 4}
-!16 = !{!"clang version 3.7.0 (http://llvm.org/git/clang.git 9b0abb9df531ef7928c8182120e1869affca17d5) (http://llvm.org/git/llvm.git b1e759524dd94f7ce1e24935daed8383927e96c1)"}
-!17 = !DILocation(line: 6, column: 8, scope: !4)
-!18 = !DILocation(line: 7, column: 7, scope: !4)
-!19 = !DILocation(line: 8, column: 1, scope: !4)
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10, !11}
+!llvm.ident = !{!12}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "ch", scope: !2, file: !3, line: 1, type: !4, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
+!3 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
+!4 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
+!5 = !DIGlobalVariableExpression(var: !6)
+!6 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 2, type: !7, isLocal: false, isDefinition: true)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !{i32 2, !"Dwarf Version", i32 4}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"wchar_size", i32 4}
+!11 = !{i32 1, !"min_enum_size", i32 4}
+!12 = !{!"clang version 3.7.0 (http://llvm.org/git/clang.git 9b0abb9df531ef7928c8182120e1869affca17d5) (http://llvm.org/git/llvm.git b1e759524dd94f7ce1e24935daed8383927e96c1)"}
+!13 = distinct !DISubprogram(name: "proc", scope: !3, file: !3, line: 4, type: !14, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !16)
+!14 = !DISubroutineType(types: !15)
+!15 = !{null}
+!16 = !{}
+!17 = !DILocation(line: 6, column: 8, scope: !13)
+!18 = !DILocation(line: 7, column: 7, scope: !13)
+!19 = !DILocation(line: 8, column: 1, scope: !13)
+

+ 12 - 10
test/DebugInfo/ARM/tls.ll

@@ -6,12 +6,13 @@
 ; Generated with clang with source
 ; __thread int x;
 
-@x = thread_local global i32 0, align 4, !dbg !4
+source_filename = "test/DebugInfo/ARM/tls.ll"
 
-!llvm.dbg.cu = !{!0}
+@x = thread_local global i32 0, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!4}
 !llvm.module.flags = !{!7, !8}
 !llvm.ident = !{!9}
-
 ; 6 byte of data
 ; CHECK: .byte 6 @ DW_AT_location
 ; DW_OP_const4u
@@ -22,13 +23,14 @@
 ; TODO: Add expected output for -emulated-tls tests.
 ; EMU-NOT: .long x(tlsldo)
 
-!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: "tls.c", directory: "/tmp")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6))
-!5 = !DIFile(filename: "tls.c", directory: "/tmp")
-!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "tls.c", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.5 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
 !7 = !{i32 2, !"Dwarf Version", i32 4}
 !8 = !{i32 1, !"Debug Info Version", i32 3}
 !9 = !{!"clang version 3.5 "}
+

+ 26 - 23
test/DebugInfo/COFF/anonymous-struct.ll

@@ -30,32 +30,35 @@
 ; CHECK:    Name: S
 ; CHECK:  }
 
+source_filename = "test/DebugInfo/COFF/anonymous-struct.ll"
 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i686-pc-windows-msvc18.0.0"
 
 %struct.S = type { i32, %struct.anon }
 %struct.anon = type { i32 }
 
-@s = common global %struct.S zeroinitializer, align 4, !dbg !4
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!14, !15}
-!llvm.ident = !{!16}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 274261) (llvm/trunk 274262)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s", scope: !0, file: !5, line: 5, type: !6, isLocal: false, isDefinition: true))
-!5 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !5, line: 2, size: 64, align: 32, elements: !7)
-!7 = !{!8, !10}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !5, line: 3, baseType: !9, size: 32, align: 32)
-!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = !DIDerivedType(tag: DW_TAG_member, scope: !6, file: !5, line: 4, baseType: !11, size: 32, align: 32, offset: 32)
-!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !6, file: !5, line: 4, size: 32, align: 32, elements: !12)
-!12 = !{!13}
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !11, file: !5, line: 4, baseType: !9, size: 32, align: 32)
-!14 = !{i32 2, !"CodeView", i32 1}
-!15 = !{i32 2, !"Debug Info Version", i32 3}
-!16 = !{!"clang version 3.9.0 (trunk 274261) (llvm/trunk 274262)"}
+@s = common global %struct.S zeroinitializer, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!15, !16}
+!llvm.ident = !{!17}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s", scope: !2, file: !6, line: 5, type: !7, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 274261) (llvm/trunk 274262)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
+!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !6, line: 2, size: 64, align: 32, elements: !8)
+!8 = !{!9, !11}
+!9 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !7, file: !6, line: 3, baseType: !10, size: 32, align: 32)
+!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!11 = !DIDerivedType(tag: DW_TAG_member, scope: !7, file: !6, line: 4, baseType: !12, size: 32, align: 32, offset: 32)
+!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !7, file: !6, line: 4, size: 32, align: 32, elements: !13)
+!13 = !{!14}
+!14 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !12, file: !6, line: 4, baseType: !10, size: 32, align: 32)
+!15 = !{i32 2, !"CodeView", i32 1}
+!16 = !{i32 2, !"Debug Info Version", i32 3}
+!17 = !{!"clang version 3.9.0 (trunk 274261) (llvm/trunk 274262)"}
+

Diff do ficheiro suprimidas por serem muito extensas
+ 12 - 4
test/DebugInfo/COFF/big-type.ll


+ 47 - 42
test/DebugInfo/COFF/bitfields.ll

@@ -173,6 +173,7 @@
 ; CHECK:    Name: S2
 ; CHECK:  }
 
+source_filename = "test/DebugInfo/COFF/bitfields.ll"
 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "x86_64-pc-windows-msvc18.0.0"
 
@@ -181,48 +182,52 @@ target triple = "x86_64-pc-windows-msvc18.0.0"
 %struct.anon = type <{ i8, i16 }>
 %struct.S2 = type { i32 }
 
-@s0 = common global %struct.S0 zeroinitializer, align 1, !dbg !4
-@s1 = common global %struct.S1 zeroinitializer, align 1, !dbg !10
-@s2 = common global %struct.S2 zeroinitializer, align 1, !dbg !29
+@s0 = common global %struct.S0 zeroinitializer, align 1, !dbg !0
+@s1 = common global %struct.S1 zeroinitializer, align 1, !dbg !6
+@s2 = common global %struct.S2 zeroinitializer, align 1, !dbg !28
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!33, !34, !35}
-!llvm.ident = !{!36}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!36, !37, !38}
+!llvm.ident = !{!39}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 273812) (llvm/trunk 273843)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
-!2 = !{}
-!3 = !{!4, !10, !29}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s0", scope: !0, file: !5, line: 7, type: !6, isLocal: false, isDefinition: true))
-!5 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !5, line: 3, size: 24, elements: !7)
-!7 = !{!8}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !5, line: 6, baseType: !9, size: 8, offset: 16, flags: DIFlagBitField, extraData: i64 8)
-!9 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)
-!10 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s1", scope: !0, file: !5, line: 18, type: !11, isLocal: false, isDefinition: true))
-!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S1", file: !5, line: 10, size: 128, elements: !12)
-!12 = !{!13, !18, !19, !21, !22, !23, !28}
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "x1", scope: !11, file: !5, line: 11, baseType: !14, size: 16)
-!14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !15, size: 16, elements: !16)
-!15 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
-!16 = !{!17}
-!17 = !DISubrange(count: 2)
-!18 = !DIDerivedType(tag: DW_TAG_member, name: "x2", scope: !11, file: !5, line: 12, baseType: !15, size: 8, offset: 16)
-!19 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !11, file: !5, line: 13, baseType: !20, size: 23, offset: 24, flags: DIFlagBitField, extraData: i64 24)
-!20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!21 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !11, file: !5, line: 14, baseType: !20, size: 23, offset: 56, flags: DIFlagBitField, extraData: i64 56)
-!22 = !DIDerivedType(tag: DW_TAG_member, name: "w", scope: !11, file: !5, line: 15, baseType: !20, size: 2, offset: 79, flags: DIFlagBitField, extraData: i64 56)
-!23 = !DIDerivedType(tag: DW_TAG_member, name: "v", scope: !11, file: !5, line: 16, baseType: !24, size: 24, offset: 88)
-!24 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !11, file: !5, line: 16, size: 24, elements: !25)
-!25 = !{!26, !27}
-!26 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !24, file: !5, line: 16, baseType: !15, size: 8)
-!27 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !24, file: !5, line: 16, baseType: !9, size: 16, offset: 8)
-!28 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !11, file: !5, line: 17, baseType: !9, size: 3, offset: 112, flags: DIFlagBitField, extraData: i64 112)
-!29 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s2", scope: !0, file: !5, line: 24, type: !30, isLocal: false, isDefinition: true))
-!30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S2", file: !5, line: 21, size: 32, elements: !31)
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s0", scope: !2, file: !8, line: 7, type: !33, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 273812) (llvm/trunk 273843)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
+!4 = !{}
+!5 = !{!0, !6, !28}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "s1", scope: !2, file: !8, line: 18, type: !9, isLocal: false, isDefinition: true)
+!8 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
+!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S1", file: !8, line: 10, size: 128, elements: !10)
+!10 = !{!11, !16, !17, !19, !20, !21, !27}
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "x1", scope: !9, file: !8, line: 11, baseType: !12, size: 16)
+!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 16, elements: !14)
+!13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+!14 = !{!15}
+!15 = !DISubrange(count: 2)
+!16 = !DIDerivedType(tag: DW_TAG_member, name: "x2", scope: !9, file: !8, line: 12, baseType: !13, size: 8, offset: 16)
+!17 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !9, file: !8, line: 13, baseType: !18, size: 23, offset: 24, flags: DIFlagBitField, extraData: i64 24)
+!18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!19 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !9, file: !8, line: 14, baseType: !18, size: 23, offset: 56, flags: DIFlagBitField, extraData: i64 56)
+!20 = !DIDerivedType(tag: DW_TAG_member, name: "w", scope: !9, file: !8, line: 15, baseType: !18, size: 2, offset: 79, flags: DIFlagBitField, extraData: i64 56)
+!21 = !DIDerivedType(tag: DW_TAG_member, name: "v", scope: !9, file: !8, line: 16, baseType: !22, size: 24, offset: 88)
+!22 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !9, file: !8, line: 16, size: 24, elements: !23)
+!23 = !{!24, !25}
+!24 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !22, file: !8, line: 16, baseType: !13, size: 8)
+!25 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !22, file: !8, line: 16, baseType: !26, size: 16, offset: 8)
+!26 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)
+!27 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !9, file: !8, line: 17, baseType: !26, size: 3, offset: 112, flags: DIFlagBitField, extraData: i64 112)
+!28 = distinct !DIGlobalVariableExpression(var: !29)
+!29 = !DIGlobalVariable(name: "s2", scope: !2, file: !8, line: 24, type: !30, isLocal: false, isDefinition: true)
+!30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S2", file: !8, line: 21, size: 32, elements: !31)
 !31 = !{!32}
-!32 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !30, file: !5, line: 23, baseType: !20, size: 1, flags: DIFlagBitField, extraData: i64 0)
-!33 = !{i32 2, !"CodeView", i32 1}
-!34 = !{i32 2, !"Debug Info Version", i32 3}
-!35 = !{i32 1, !"PIC Level", i32 2}
-!36 = !{!"clang version 3.9.0 (trunk 273812) (llvm/trunk 273843)"}
+!32 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !30, file: !8, line: 23, baseType: !18, size: 1, flags: DIFlagBitField, extraData: i64 0)
+!33 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !8, line: 3, size: 24, elements: !34)
+!34 = !{!35}
+!35 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !33, file: !8, line: 6, baseType: !26, size: 8, offset: 16, flags: DIFlagBitField, extraData: i64 8)
+!36 = !{i32 2, !"CodeView", i32 1}
+!37 = !{i32 2, !"Debug Info Version", i32 3}
+!38 = !{i32 1, !"PIC Level", i32 2}
+!39 = !{!"clang version 3.9.0 (trunk 273812) (llvm/trunk 273843)"}
+

+ 19 - 16
test/DebugInfo/COFF/enum.ll

@@ -24,25 +24,28 @@
 ; CHECK-NEXT:    Name: E
 ; CHECK-NEXT:  }
 
+source_filename = "test/DebugInfo/COFF/enum.ll"
 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i686-pc-windows-msvc18.0.0"
 
-@"\01?e@@3W4E@@A" = global i32 0, align 4, !dbg !9
+@"\01?e@@3W4E@@A" = global i32 0, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!10, !11}
-!llvm.ident = !{!12}
+!llvm.dbg.cu = !{!2}
+!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 272790) (llvm/trunk 272813)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !8)
-!1 = !DIFile(filename: "-", directory: "/")
-!2 = !{!3}
-!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !4, line: 1, baseType: !5, size: 32, align: 32, elements: !6)
-!4 = !DIFile(filename: "<stdin>", directory: "/")
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !{!7}
-!7 = !DIEnumerator(name: "BLAH", value: 0)
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "e", linkageName: "\01?e@@3W4E@@A", scope: !2, file: !6, line: 2, type: !5, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272790) (llvm/trunk 272813)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !10)
+!3 = !DIFile(filename: "-", directory: "/")
+!4 = !{!5}
+!5 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !6, line: 1, baseType: !7, size: 32, align: 32, elements: !8)
+!6 = !DIFile(filename: "<stdin>", directory: "/")
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !8 = !{!9}
-!9 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "e", linkageName: "\01?e@@3W4E@@A", scope: !0, file: !4, line: 2, type: !3, isLocal: false, isDefinition: true))
-!10 = !{i32 2, !"CodeView", i32 1}
-!11 = !{i32 2, !"Debug Info Version", i32 3}
-!12 = !{!"clang version 3.9.0 (trunk 272790) (llvm/trunk 272813)"}
+!9 = !DIEnumerator(name: "BLAH", value: 0)
+!10 = !{!0}
+!11 = !{i32 2, !"CodeView", i32 1}
+!12 = !{i32 2, !"Debug Info Version", i32 3}
+!13 = !{!"clang version 3.9.0 (trunk 272790) (llvm/trunk 272813)"}
+

+ 23 - 20
test/DebugInfo/COFF/global-dllimport.ll

@@ -2,28 +2,31 @@
 
 ; CHECK-NOT: S_GDATA32
 
+source_filename = "test/DebugInfo/COFF/global-dllimport.ll"
 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, !dbg !4
+@"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!13, !14}
-!llvm.ident = !{!15}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!14, !15}
+!llvm.ident = !{!16}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !2, file: !6, line: 4, type: !7, isLocal: false, isDefinition: true, declaration: !8)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/t.ii", directory: "/usr/local/google/home/majnemer/llvm/src")
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "id", scope: !9, file: !6, line: 2, baseType: !7, flags: DIFlagStaticMember)
+!9 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "numpunct<char>", file: !6, line: 2, size: 8, align: 8, elements: !10, templateParams: !11)
+!10 = !{!8}
+!11 = !{!12}
+!12 = !DITemplateTypeParameter(type: !13)
+!13 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!14 = !{i32 2, !"CodeView", i32 1}
+!15 = !{i32 2, !"Debug Info Version", i32 3}
+!16 = !{!"clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)"}
 
-!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 !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, 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, !"CodeView", i32 1}
-!14 = !{i32 2, !"Debug Info Version", i32 3}
-!15 = !{!"clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)"}

+ 17 - 15
test/DebugInfo/COFF/globals-discarded.ll

@@ -15,21 +15,23 @@ source_filename = "t.ii"
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.0.0"
 
-@x = global i32 42, !dbg !6
+@x = global i32 42, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!35, !36, !37}
-!llvm.ident = !{!38}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!9, !10, !11}
+!llvm.ident = !{!12}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 272215) (llvm/trunk 272226)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3)
-!1 = !DIFile(filename: "t.c", directory: "foo")
-!2 = !{}
-!3 = !{!4, !6}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_OptionsStorage", scope: !0, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true))
-!5 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
-!6 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 4, type: !5, isLocal: true, isDefinition: true))
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 4, type: !8, isLocal: true, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 272215) (llvm/trunk 272226)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5)
+!3 = !DIFile(filename: "t.c", directory: "foo")
+!4 = !{}
+!5 = !{!6, !0}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "_OptionsStorage", scope: !2, file: !3, line: 3, type: !8, isLocal: true, isDefinition: true)
+!8 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
+!9 = !{i32 2, !"CodeView", i32 1}
+!10 = !{i32 2, !"Debug Info Version", i32 3}
+!11 = !{i32 1, !"PIC Level", i32 2}
+!12 = !{!"clang version 3.9.0 (trunk 272215) (llvm/trunk 272226)"}
 
-!35 = !{i32 2, !"CodeView", i32 1}
-!36 = !{i32 2, !"Debug Info Version", i32 3}
-!37 = !{i32 1, !"PIC Level", i32 2}
-!38 = !{!"clang version 3.9.0 (trunk 272215) (llvm/trunk 272226)"}

+ 31 - 26
test/DebugInfo/COFF/globals.ll

@@ -116,32 +116,37 @@ target triple = "x86_64-pc-windows-msvc19.0.23918"
 
 $"\01?comdat@?$A@X@@2HB" = comdat any
 
-@"\01?first@@3HA" = internal global i32 0, align 4, !dbg !4
+@"\01?first@@3HA" = internal global i32 0, align 4, !dbg !0
 @"\01?comdat@?$A@X@@2HB" = linkonce_odr constant i32 3, comdat, align 4, !dbg !6
-@"\01?middle@@3PEBHEB" = thread_local global i32* @"\01?comdat@?$A@X@@2HB", align 8, !dbg !13
-@"\01?last@@3HA" = global i32 0, align 4, !dbg !15
+@"\01?middle@@3PEBHEB" = thread_local global i32* @"\01?comdat@?$A@X@@2HB", align 8, !dbg !15
+@"\01?last@@3HA" = global i32 0, align 4, !dbg !18
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!16, !17, !18}
-!llvm.ident = !{!19}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!20, !21, !22}
+!llvm.ident = !{!23}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "first", linkageName: "\01?first@@3HA", scope: !2, file: !3, line: 1, type: !9, isLocal: true, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 271937)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0, !6, !15, !18}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "comdat", linkageName: "\01?comdat@?$A@X@@2HB", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true, declaration: !10)
+!8 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
+!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "comdat", scope: !11, file: !3, line: 2, baseType: !8, flags: DIFlagStaticMember, extraData: i32 3)
+!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A<void>", file: !3, line: 2, size: 8, align: 8, elements: !12, templateParams: !13)
+!12 = !{!10}
+!13 = !{!14}
+!14 = !DITemplateTypeParameter(name: "T", type: null)
+!15 = distinct !DIGlobalVariableExpression(var: !16)
+!16 = !DIGlobalVariable(name: "middle", linkageName: "\01?middle@@3PEBHEB", scope: !2, file: !3, line: 3, type: !17, isLocal: false, isDefinition: true)
+!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
+!18 = distinct !DIGlobalVariableExpression(var: !19)
+!19 = !DIGlobalVariable(name: "last", linkageName: "\01?last@@3HA", scope: !2, file: !3, line: 4, type: !9, isLocal: false, isDefinition: true)
+!20 = !{i32 2, !"CodeView", i32 1}
+!21 = !{i32 2, !"Debug Info Version", i32 3}
+!22 = !{i32 1, !"PIC Level", i32 2}
+!23 = !{!"clang version 3.9.0 (trunk 271937)"}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 271937)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!3 = !{!4, !6, !13, !15}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "first", linkageName: "\01?first@@3HA", scope: !0, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true))
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "comdat", linkageName: "\01?comdat@?$A@X@@2HB", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, declaration: !8))
-!7 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5)
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "comdat", scope: !9, file: !1, line: 2, baseType: !7, flags: DIFlagStaticMember, extraData: i32 3)
-!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A<void>", file: !1, line: 2, size: 8, align: 8, elements: !10, templateParams: !11)
-!10 = !{!8}
-!11 = !{!12}
-!12 = !DITemplateTypeParameter(name: "T", type: null)
-!13 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "middle", linkageName: "\01?middle@@3PEBHEB", scope: !0, file: !1, line: 3, type: !14, isLocal: false, isDefinition: true))
-!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
-!15 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "last", linkageName: "\01?last@@3HA", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true))
-!16 = !{i32 2, !"CodeView", i32 1}
-!17 = !{i32 2, !"Debug Info Version", i32 3}
-!18 = !{i32 1, !"PIC Level", i32 2}
-!19 = !{!"clang version 3.9.0 (trunk 271937)"}

+ 40 - 38
test/DebugInfo/COFF/inheritance.ll

@@ -89,42 +89,44 @@ declare void @"\01?f@D@@UEAAXXZ"(%struct.D*) unnamed_addr #0
 
 attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-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 = !{!1}
-!llvm.module.flags = !{!31, !32, !33}
-!llvm.ident = !{!34}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!32, !33, !34}
+!llvm.ident = !{!35}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "d", linkageName: "\01?d@@3UD@@A", scope: !2, file: !6, line: 8, type: !7, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 95626d54d6db7e13087089396a80ebaccc4ffe7c) (http://llvm.org/git/llvm.git 374b6e2fa0b230d13c0fb9ee7af69b2146bfad8a)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIFile(filename: "t.cpp", directory: "C:\5Cbuild\5Cllvm\5Cbuild")
+!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !6, line: 4, size: 448, elements: !8, vtableHolder: !7, identifier: ".?AUD@@")
+!8 = !{!9, !18, !23, !24, !25, !27, !28}
+!9 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !7, baseType: !10, offset: 64)
+!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !6, line: 2, size: 192, elements: !11, vtableHolder: !10, identifier: ".?AUB@@")
+!11 = !{!12, !17}
+!12 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !10, baseType: !13, offset: 4, flags: DIFlagVirtual)
+!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !6, line: 1, size: 32, elements: !14, identifier: ".?AUA@@")
+!14 = !{!15}
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !13, file: !6, line: 1, baseType: !16, size: 32)
+!16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!17 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !10, file: !6, line: 2, baseType: !16, size: 32, offset: 64)
+!18 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !7, baseType: !19, offset: 192)
+!19 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !6, line: 3, size: 192, elements: !20, vtableHolder: !19, identifier: ".?AUC@@")
+!20 = !{!21, !22}
+!21 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !19, baseType: !13, offset: 4, flags: DIFlagVirtual)
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !6, line: 3, baseType: !16, size: 32, offset: 64)
+!23 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !7, baseType: !13, offset: 4, flags: DIFlagIndirectVirtualBase)
+!24 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: null, size: 64)
+!25 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$D", scope: !6, file: !6, baseType: !26, size: 64, flags: DIFlagArtificial)
+!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !24, size: 64)
+!27 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !7, file: !6, line: 6, baseType: !16, size: 32, offset: 320)
+!28 = !DISubprogram(name: "f", linkageName: "\01?f@D@@UEAAXXZ", scope: !7, file: !6, line: 5, type: !29, isLocal: false, isDefinition: false, scopeLine: 5, containingType: !7, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: true)
+!29 = !DISubroutineType(types: !30)
+!30 = !{null, !31}
+!31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!32 = !{i32 2, !"CodeView", i32 1}
+!33 = !{i32 2, !"Debug Info Version", i32 3}
+!34 = !{i32 1, !"PIC Level", i32 2}
+!35 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 95626d54d6db7e13087089396a80ebaccc4ffe7c) (http://llvm.org/git/llvm.git 374b6e2fa0b230d13c0fb9ee7af69b2146bfad8a)"}
 
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "d", linkageName: "\01?d@@3UD@@A", scope: !1, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 95626d54d6db7e13087089396a80ebaccc4ffe7c) (http://llvm.org/git/llvm.git 374b6e2fa0b230d13c0fb9ee7af69b2146bfad8a)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!3 = !{}
-!4 = !{!0}
-!5 = !DIFile(filename: "t.cpp", directory: "C:\5Cbuild\5Cllvm\5Cbuild")
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !5, line: 4, size: 448, elements: !7, vtableHolder: !6, identifier: ".?AUD@@")
-!7 = !{!8, !17, !22, !23, !24, !26, !27}
-!8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9, offset: 64)
-!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !5, line: 2, size: 192, elements: !10, vtableHolder: !9, identifier: ".?AUB@@")
-!10 = !{!11, !16}
-!11 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !9, baseType: !12, offset: 4, flags: DIFlagVirtual)
-!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !5, line: 1, size: 32, elements: !13, identifier: ".?AUA@@")
-!13 = !{!14}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !12, file: !5, line: 1, baseType: !15, size: 32)
-!15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!16 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !9, file: !5, line: 2, baseType: !15, size: 32, offset: 64)
-!17 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !18, offset: 192)
-!18 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !5, line: 3, size: 192, elements: !19, vtableHolder: !18, identifier: ".?AUC@@")
-!19 = !{!20, !21}
-!20 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !18, baseType: !12, offset: 4, flags: DIFlagVirtual)
-!21 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !18, file: !5, line: 3, baseType: !15, size: 32, offset: 64)
-!22 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !12, offset: 4, flags: DIFlagIndirectVirtualBase)
-!23 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: null, size: 64)
-!24 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$D", scope: !5, file: !5, baseType: !25, size: 64, flags: DIFlagArtificial)
-!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !23, size: 64)
-!26 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 6, baseType: !15, size: 32, offset: 320)
-!27 = !DISubprogram(name: "f", linkageName: "\01?f@D@@UEAAXXZ", scope: !6, file: !5, line: 5, type: !28, isLocal: false, isDefinition: false, scopeLine: 5, containingType: !6, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: true)
-!28 = !DISubroutineType(types: !29)
-!29 = !{null, !30}
-!30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!31 = !{i32 2, !"CodeView", i32 1}
-!32 = !{i32 2, !"Debug Info Version", i32 3}
-!33 = !{i32 1, !"PIC Level", i32 2}
-!34 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 95626d54d6db7e13087089396a80ebaccc4ffe7c) (http://llvm.org/git/llvm.git 374b6e2fa0b230d13c0fb9ee7af69b2146bfad8a)"}

+ 48 - 45
test/DebugInfo/COFF/inlining-files.ll

@@ -41,68 +41,71 @@
 ; OBJ:  ]
 
 ; ModuleID = 't.cpp'
+source_filename = "test/DebugInfo/COFF/inlining-files.ll"
 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, !dbg !9
+@x = common global i32 0, align 4, !dbg !0
 
 ; Function Attrs: norecurse nounwind uwtable
-define void @f() #0 !dbg !4 {
+define void @f() #0 !dbg !12 {
 entry:
-  %0 = load volatile i32, i32* @x, align 4, !dbg !16, !tbaa !17
-  %inc = add nsw i32 %0, 1, !dbg !16
-  store volatile i32 %inc, i32* @x, align 4, !dbg !16, !tbaa !17
-  %1 = load volatile i32, i32* @x, align 4, !dbg !21, !tbaa !17
-  %inc.i = add nsw i32 %1, 1, !dbg !21
-  store volatile i32 %inc.i, i32* @x, align 4, !dbg !21, !tbaa !17
-  %2 = load volatile i32, i32* @x, align 4, !dbg !23, !tbaa !17
+  %0 = load volatile i32, i32* @x, align 4, !dbg !15, !tbaa !16
+  %inc = add nsw i32 %0, 1, !dbg !15
+  store volatile i32 %inc, i32* @x, align 4, !dbg !15, !tbaa !16
+  %1 = load volatile i32, i32* @x, align 4, !dbg !20, !tbaa !16
+  %inc.i = add nsw i32 %1, 1, !dbg !20
+  store volatile i32 %inc.i, i32* @x, align 4, !dbg !20, !tbaa !16
+  %2 = load volatile i32, i32* @x, align 4, !dbg !23, !tbaa !16
   %inc1.i = add nsw i32 %2, 1, !dbg !23
-  store volatile i32 %inc1.i, i32* @x, align 4, !dbg !23, !tbaa !17
-  %3 = load volatile i32, i32* @x, align 4, !dbg !26, !tbaa !17
+  store volatile i32 %inc1.i, i32* @x, align 4, !dbg !23, !tbaa !16
+  %3 = load volatile i32, i32* @x, align 4, !dbg !26, !tbaa !16
   %inc2.i = add nsw i32 %3, 1, !dbg !26
-  store volatile i32 %inc2.i, i32* @x, align 4, !dbg !26, !tbaa !17
-  %4 = load volatile i32, i32* @x, align 4, !dbg !27, !tbaa !17
+  store volatile i32 %inc2.i, i32* @x, align 4, !dbg !26, !tbaa !16
+  %4 = load volatile i32, i32* @x, align 4, !dbg !27, !tbaa !16
   %inc3.i = add nsw i32 %4, 1, !dbg !27
-  store volatile i32 %inc3.i, i32* @x, align 4, !dbg !27, !tbaa !17
-  %5 = load volatile i32, i32* @x, align 4, !dbg !29, !tbaa !17
+  store volatile i32 %inc3.i, i32* @x, align 4, !dbg !27, !tbaa !16
+  %5 = load volatile i32, i32* @x, align 4, !dbg !29, !tbaa !16
   %inc1 = add nsw i32 %5, 1, !dbg !29
-  store volatile i32 %inc1, i32* @x, align 4, !dbg !29, !tbaa !17
+  store volatile i32 %inc1, i32* @x, align 4, !dbg !29, !tbaa !16
   ret void, !dbg !30
 }
 
 attributes #0 = { norecurse nounwind uwtable "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!12, !13, !14}
-!llvm.ident = !{!15}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10}
+!llvm.ident = !{!11}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !8)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!5 = !DISubroutineType(types: !6)
-!6 = !{null}
-!7 = distinct !DISubprogram(name: "file_change", scope: !1, file: !1, line: 2, type: !5, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!8 = !{!9}
-!9 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !10, isLocal: false, isDefinition: true))
-!10 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !11)
-!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!12 = !{i32 2, !"CodeView", i32 1}
-!13 = !{i32 2, !"Debug Info Version", i32 3}
-!14 = !{i32 1, !"PIC Level", i32 2}
-!15 = !{!"clang version 3.9.0 "}
-!16 = !DILocation(line: 8, column: 3, scope: !4)
-!17 = !{!18, !18, i64 0}
-!18 = !{!"int", !19, i64 0}
-!19 = !{!"omnipotent char", !20, i64 0}
-!20 = !{!"Simple C/C++ TBAA"}
-!21 = !DILocation(line: 3, column: 4, scope: !7, inlinedAt: !22)
-!22 = distinct !DILocation(line: 9, column: 3, scope: !4)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !{i32 2, !"CodeView", i32 1}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"PIC Level", i32 2}
+!11 = !{!"clang version 3.9.0 "}
+!12 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 7, type: !13, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!13 = !DISubroutineType(types: !14)
+!14 = !{null}
+!15 = !DILocation(line: 8, column: 3, scope: !12)
+!16 = !{!17, !17, i64 0}
+!17 = !{!"int", !18, i64 0}
+!18 = !{!"omnipotent char", !19, i64 0}
+!19 = !{!"Simple C/C++ TBAA"}
+!20 = !DILocation(line: 3, column: 4, scope: !21, inlinedAt: !22)
+!21 = distinct !DISubprogram(name: "file_change", scope: !3, file: !3, line: 2, type: !13, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!22 = distinct !DILocation(line: 9, column: 3, scope: !12)
 !23 = !DILocation(line: 1, column: 1, scope: !24, inlinedAt: !22)
-!24 = !DILexicalBlockFile(scope: !7, file: !25, discriminator: 0)
+!24 = !DILexicalBlockFile(scope: !21, file: !25, discriminator: 0)
 !25 = !DIFile(filename: "./t.inc", directory: "D:\5Csrc\5Cllvm\5Cbuild")
 !26 = !DILocation(line: 2, column: 1, scope: !24, inlinedAt: !22)
 !27 = !DILocation(line: 5, column: 4, scope: !28, inlinedAt: !22)
-!28 = !DILexicalBlockFile(scope: !7, file: !1, discriminator: 0)
-!29 = !DILocation(line: 10, column: 3, scope: !4)
-!30 = !DILocation(line: 11, column: 1, scope: !4)
+!28 = !DILexicalBlockFile(scope: !21, file: !3, discriminator: 0)
+!29 = !DILocation(line: 10, column: 3, scope: !12)
+!30 = !DILocation(line: 11, column: 1, scope: !12)
+

+ 56 - 55
test/DebugInfo/COFF/inlining-header.ll

@@ -61,7 +61,6 @@
 ; OBJ:   }
 ; OBJ: ]
 
-
 ; OBJ: Subsection [
 ; OBJ:   SubSectionType: Symbols (0xF1)
 ; OBJ:   ProcStart {
@@ -106,65 +105,67 @@ source_filename = "t.cpp"
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.0.24210"
 
-@"\01?x@@3HC" = global i32 0, align 4, !dbg !4
+@"\01?x@@3HC" = global i32 0, align 4, !dbg !0
 
 ; Function Attrs: norecurse nounwind uwtable
-define i32 @main() local_unnamed_addr #0 !dbg !11 {
+define i32 @main() local_unnamed_addr #0 !dbg !12 {
 entry:
-  %0 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !14, !tbaa !15
-  %add = add nsw i32 %0, 1, !dbg !14
-  store volatile i32 %add, i32* @"\01?x@@3HC", align 4, !dbg !14, !tbaa !15
-  %1 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !19, !tbaa !15
-  %add.i = add nsw i32 %1, 2, !dbg !19
-  store volatile i32 %add.i, i32* @"\01?x@@3HC", align 4, !dbg !19, !tbaa !15
-  %2 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !24, !tbaa !15
-  %add.i.i = add nsw i32 %2, 3, !dbg !24
-  store volatile i32 %add.i.i, i32* @"\01?x@@3HC", align 4, !dbg !24, !tbaa !15
-  %3 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !28, !tbaa !15
-  %add1.i = add nsw i32 %3, 2, !dbg !28
-  store volatile i32 %add1.i, i32* @"\01?x@@3HC", align 4, !dbg !28, !tbaa !15
-  %4 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !29, !tbaa !15
-  %add1 = add nsw i32 %4, 1, !dbg !29
-  store volatile i32 %add1, i32* @"\01?x@@3HC", align 4, !dbg !29, !tbaa !15
-  %5 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !30, !tbaa !15
-  ret i32 %5, !dbg !31
+  %0 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !15, !tbaa !16
+  %add = add nsw i32 %0, 1, !dbg !15
+  store volatile i32 %add, i32* @"\01?x@@3HC", align 4, !dbg !15, !tbaa !16
+  %1 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !20, !tbaa !16
+  %add.i = add nsw i32 %1, 2, !dbg !20
+  store volatile i32 %add.i, i32* @"\01?x@@3HC", align 4, !dbg !20, !tbaa !16
+  %2 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !25, !tbaa !16
+  %add.i.i = add nsw i32 %2, 3, !dbg !25
+  store volatile i32 %add.i.i, i32* @"\01?x@@3HC", align 4, !dbg !25, !tbaa !16
+  %3 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !29, !tbaa !16
+  %add1.i = add nsw i32 %3, 2, !dbg !29
+  store volatile i32 %add1.i, i32* @"\01?x@@3HC", align 4, !dbg !29, !tbaa !16
+  %4 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !30, !tbaa !16
+  %add1 = add nsw i32 %4, 1, !dbg !30
+  store volatile i32 %add1, i32* @"\01?x@@3HC", align 4, !dbg !30, !tbaa !16
+  %5 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !31, !tbaa !16
+  ret i32 %5, !dbg !32
 }
 
 attributes #0 = { norecurse nounwind 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" "no-signed-zeros-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 = !{!7, !8, !9}
-!llvm.ident = !{!10}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10}
+!llvm.ident = !{!11}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 275430) (llvm/trunk 275433)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !{i32 2, !"CodeView", i32 1}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"PIC Level", i32 2}
+!11 = !{!"clang version 3.9.0 (trunk 275430) (llvm/trunk 275433)"}
+!12 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 8, type: !13, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!7}
+!15 = !DILocation(line: 9, column: 5, scope: !12)
+!16 = !{!17, !17, i64 0}
+!17 = !{!"int", !18, i64 0}
+!18 = !{!"omnipotent char", !19, i64 0}
+!19 = !{!"Simple C++ TBAA"}
+!20 = !DILocation(line: 4, column: 5, scope: !21, inlinedAt: !24)
+!21 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXXZ", scope: !3, file: !3, line: 3, type: !22, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!22 = !DISubroutineType(types: !23)
+!23 = !{null}
+!24 = distinct !DILocation(line: 10, column: 3, scope: !12)
+!25 = !DILocation(line: 2, column: 5, scope: !26, inlinedAt: !28)
+!26 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !27, file: !27, line: 1, type: !22, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!27 = !DIFile(filename: "./t.h", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!28 = distinct !DILocation(line: 5, column: 3, scope: !21, inlinedAt: !24)
+!29 = !DILocation(line: 6, column: 5, scope: !21, inlinedAt: !24)
+!30 = !DILocation(line: 11, column: 5, scope: !12)
+!31 = !DILocation(line: 12, column: 10, scope: !12)
+!32 = !DILocation(line: 12, column: 3, scope: !12)
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 275430) (llvm/trunk 275433)", 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 !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !6)
-!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!7 = !{i32 2, !"CodeView", i32 1}
-!8 = !{i32 2, !"Debug Info Version", i32 3}
-!9 = !{i32 1, !"PIC Level", i32 2}
-!10 = !{!"clang version 3.9.0 (trunk 275430) (llvm/trunk 275433)"}
-!11 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 8, type: !12, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!12 = !DISubroutineType(types: !13)
-!13 = !{!6}
-!14 = !DILocation(line: 9, column: 5, scope: !11)
-!15 = !{!16, !16, i64 0}
-!16 = !{!"int", !17, i64 0}
-!17 = !{!"omnipotent char", !18, i64 0}
-!18 = !{!"Simple C++ TBAA"}
-!19 = !DILocation(line: 4, column: 5, scope: !20, inlinedAt: !23)
-!20 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXXZ", scope: !1, file: !1, line: 3, type: !21, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!21 = !DISubroutineType(types: !22)
-!22 = !{null}
-!23 = distinct !DILocation(line: 10, column: 3, scope: !11)
-!24 = !DILocation(line: 2, column: 5, scope: !25, inlinedAt: !27)
-!25 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !26, file: !26, line: 1, type: !21, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!26 = !DIFile(filename: "./t.h", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!27 = distinct !DILocation(line: 5, column: 3, scope: !20, inlinedAt: !23)
-!28 = !DILocation(line: 6, column: 5, scope: !20, inlinedAt: !23)
-!29 = !DILocation(line: 11, column: 5, scope: !11)
-!30 = !DILocation(line: 12, column: 10, scope: !11)
-!31 = !DILocation(line: 12, column: 3, scope: !11)

+ 34 - 31
test/DebugInfo/COFF/inlining-levels.ll

@@ -38,51 +38,54 @@
 ; OBJ: ]
 
 ; ModuleID = 't.cpp'
+source_filename = "test/DebugInfo/COFF/inlining-levels.ll"
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc18.0.0"
 
-@"\01?x@@3HC" = global i32 0, align 4, !dbg !14
+@"\01?x@@3HC" = global i32 0, align 4, !dbg !0
 
 ; Function Attrs: norecurse nounwind uwtable
-define i32 @main() #0 !dbg !4 {
+define i32 @main() #0 !dbg !12 {
 entry:
-  %0 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !20, !tbaa !24
-  %inc.i.i.i = add nsw i32 %0, 1, !dbg !20
-  store volatile i32 %inc.i.i.i, i32* @"\01?x@@3HC", align 4, !dbg !20, !tbaa !24
+  %0 = load volatile i32, i32* @"\01?x@@3HC", align 4, !dbg !15, !tbaa !24
+  %inc.i.i.i = add nsw i32 %0, 1, !dbg !15
+  store volatile i32 %inc.i.i.i, i32* @"\01?x@@3HC", align 4, !dbg !15, !tbaa !24
   ret i32 0, !dbg !28
 }
 
 attributes #0 = { norecurse nounwind uwtable "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!16, !17, !18}
-!llvm.ident = !{!19}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10}
+!llvm.ident = !{!11}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !13)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!5 = !DISubroutineType(types: !6)
-!6 = !{!7}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!8 = distinct !DISubprogram(name: "h", linkageName: "\01?h@@YAXXZ", scope: !1, file: !1, line: 9, type: !9, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!9 = !DISubroutineType(types: !10)
-!10 = !{null}
-!11 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXXZ", scope: !1, file: !1, line: 6, type: !9, isLocal: true, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!12 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 2, type: !9, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
-!13 = !{!14}
-!14 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", linkageName: "\01?x@@3HC", scope: !0, file: !1, line: 1, type: !15, isLocal: false, isDefinition: true))
-!15 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
-!16 = !{i32 2, !"CodeView", i32 1}
-!17 = !{i32 2, !"Debug Info Version", i32 3}
-!18 = !{i32 1, !"PIC Level", i32 2}
-!19 = !{!"clang version 3.9.0 "}
-!20 = !DILocation(line: 4, column: 3, scope: !12, inlinedAt: !21)
-!21 = distinct !DILocation(line: 7, column: 3, scope: !11, inlinedAt: !22)
-!22 = distinct !DILocation(line: 10, column: 3, scope: !8, inlinedAt: !23)
-!23 = distinct !DILocation(line: 13, column: 3, scope: !4)
+!8 = !{i32 2, !"CodeView", i32 1}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"PIC Level", i32 2}
+!11 = !{!"clang version 3.9.0 "}
+!12 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 12, type: !13, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!7}
+!15 = !DILocation(line: 4, column: 3, scope: !16, inlinedAt: !19)
+!16 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !3, file: !3, line: 2, type: !17, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!17 = !DISubroutineType(types: !18)
+!18 = !{null}
+!19 = distinct !DILocation(line: 7, column: 3, scope: !20, inlinedAt: !21)
+!20 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXXZ", scope: !3, file: !3, line: 6, type: !17, isLocal: true, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!21 = distinct !DILocation(line: 10, column: 3, scope: !22, inlinedAt: !23)
+!22 = distinct !DISubprogram(name: "h", linkageName: "\01?h@@YAXXZ", scope: !3, file: !3, line: 9, type: !17, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
+!23 = distinct !DILocation(line: 13, column: 3, scope: !12)
 !24 = !{!25, !25, i64 0}
 !25 = !{!"int", !26, i64 0}
 !26 = !{!"omnipotent char", !27, i64 0}
 !27 = !{!"Simple C/C++ TBAA"}
-!28 = !DILocation(line: 14, column: 1, scope: !4)
+!28 = !DILocation(line: 14, column: 1, scope: !12)
+

+ 23 - 24
test/DebugInfo/COFF/int8-char-type.ll

@@ -26,30 +26,29 @@ target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.0.24210"
 
 @x = global i8 0, align 1, !dbg !0
-@y = global i8 0, align 1, !dbg !5
-
-!llvm.dbg.cu = !{!1}
-!llvm.module.flags = !{!11, !12, !13}
-!llvm.ident = !{!14}
-
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", scope: !1, file: !6, line: 4, type: !9, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "-", directory: "C:\5Csrc\5Cllvm\5Cbuild")
-!3 = !{}
-!4 = !{!0, !5}
-!5 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "y", scope: !1, file: !6, line: 5, type: !7, isLocal: false, isDefinition: true))
-!6 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Cllvm\5Cbuild")
-!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !6, line: 3, baseType: !8)
-
+@y = global i8 0, align 1, !dbg !6
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!13, !14, !15}
+!llvm.ident = !{!16}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !8, line: 4, type: !11, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "-", directory: "C:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0, !6}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "y", scope: !2, file: !8, line: 5, type: !9, isLocal: false, isDefinition: true)
+!8 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Cllvm\5Cbuild")
+!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !8, line: 3, baseType: !10)
+!10 = !DIBasicType(size: 8, align: 8, encoding: DW_ATE_unsigned)
+!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "int8_t", file: !8, line: 2, baseType: !12)
+!12 = !DIBasicType(size: 8, align: 8, encoding: DW_ATE_signed)
+!13 = !{i32 2, !"CodeView", i32 1}
 ; Manually modified to use DW_ATE_unsigned
-!8 = !DIBasicType(size: 8, align: 8, encoding: DW_ATE_unsigned)
-
-!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "int8_t", file: !6, line: 2, baseType: !10)
-
+!14 = !{i32 2, !"Debug Info Version", i32 3}
+!15 = !{i32 1, !"PIC Level", i32 2}
 ; Manually modified to use DW_ATE_signed
-!10 = !DIBasicType(size: 8, align: 8, encoding: DW_ATE_signed)
+!16 = !{!"clang version 4.0.0 "}
 
-!11 = !{i32 2, !"CodeView", i32 1}
-!12 = !{i32 2, !"Debug Info Version", i32 3}
-!13 = !{i32 1, !"PIC Level", i32 2}
-!14 = !{!"clang version 4.0.0 "}

Diff do ficheiro suprimidas por serem muito extensas
+ 11 - 3
test/DebugInfo/COFF/long-type-name.ll


+ 61 - 58
test/DebugInfo/COFF/register-variables.ll

@@ -189,33 +189,34 @@
 ; OBJ: ]
 
 ; ModuleID = 't.cpp'
+source_filename = "test/DebugInfo/COFF/register-variables.ll"
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc18.0.0"
 
-@x = internal global i32 0, align 4, !dbg !23
+@x = internal global i32 0, align 4, !dbg !0
 
 ; Function Attrs: nounwind uwtable
-define void @f(i32 %p) #0 !dbg !4 {
+define void @f(i32 %p) #0 !dbg !12 {
 entry:
-  tail call void @llvm.dbg.value(metadata i32 %p, i64 0, metadata !9, metadata !29), !dbg !30
-  %tobool = icmp eq i32 %p, 0, !dbg !31
-  %call2 = tail call i32 @getint() #3, !dbg !32
-  br i1 %tobool, label %if.else, label %if.then, !dbg !33
+  tail call void @llvm.dbg.value(metadata i32 %p, i64 0, metadata !16, metadata !23), !dbg !24
+  %tobool = icmp eq i32 %p, 0, !dbg !25
+  %call2 = tail call i32 @getint() #3, !dbg !26
+  br i1 %tobool, label %if.else, label %if.then, !dbg !27
 
 if.then:                                          ; preds = %entry
-  tail call void @llvm.dbg.value(metadata i32 %call2, i64 0, metadata !10, metadata !29), !dbg !34
-  tail call void @llvm.dbg.value(metadata i32 %call2, i64 0, metadata !20, metadata !29), !dbg !35
+  tail call void @llvm.dbg.value(metadata i32 %call2, i64 0, metadata !17, metadata !23), !dbg !28
+  tail call void @llvm.dbg.value(metadata i32 %call2, i64 0, metadata !29, metadata !23), !dbg !35
   %add.i = add nsw i32 %call2, 1, !dbg !37
-  tail call void @llvm.dbg.value(metadata i32 %add.i, i64 0, metadata !21, metadata !29), !dbg !38
+  tail call void @llvm.dbg.value(metadata i32 %add.i, i64 0, metadata !34, metadata !23), !dbg !38
   %0 = load volatile i32, i32* @x, align 4, !dbg !39, !tbaa !40
   %inc.i = add nsw i32 %0, 1, !dbg !39
   store volatile i32 %inc.i, i32* @x, align 4, !dbg !39, !tbaa !40
-  tail call void @llvm.dbg.value(metadata i32 %add.i, i64 0, metadata !13, metadata !29), !dbg !44
+  tail call void @llvm.dbg.value(metadata i32 %add.i, i64 0, metadata !20, metadata !23), !dbg !44
   tail call void @putint(i32 %add.i) #3, !dbg !45
   br label %if.end, !dbg !46
 
 if.else:                                          ; preds = %entry
-  tail call void @llvm.dbg.value(metadata i32 %call2, i64 0, metadata !14, metadata !29), !dbg !47
+  tail call void @llvm.dbg.value(metadata i32 %call2, i64 0, metadata !21, metadata !23), !dbg !47
   tail call void @putint(i32 %call2) #3, !dbg !48
   br label %if.end
 
@@ -235,56 +236,58 @@ attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-
 attributes #2 = { nounwind readnone }
 attributes #3 = { nounwind }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!25, !26, !27}
-!llvm.ident = !{!28}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10}
+!llvm.ident = !{!11}
 
-!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: !22)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !8)
-!5 = !DISubroutineType(types: !6)
-!6 = !{null, !7}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!8 = !{!9, !10, !13, !14}
-!9 = !DILocalVariable(name: "p", arg: 1, scope: !4, file: !1, line: 9, type: !7)
-!10 = !DILocalVariable(name: "a", scope: !11, file: !1, line: 11, type: !7)
-!11 = distinct !DILexicalBlock(scope: !12, file: !1, line: 10, column: 10)
-!12 = distinct !DILexicalBlock(scope: !4, file: !1, line: 10, column: 7)
-!13 = !DILocalVariable(name: "b", scope: !11, file: !1, line: 12, type: !7)
-!14 = !DILocalVariable(name: "c", scope: !15, file: !1, line: 15, type: !7)
-!15 = distinct !DILexicalBlock(scope: !12, file: !1, line: 14, column: 10)
-!16 = distinct !DISubprogram(name: "inlineinc", scope: !1, file: !1, line: 4, type: !17, isLocal: true, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !19)
-!17 = !DISubroutineType(types: !18)
-!18 = !{!7, !7}
-!19 = !{!20, !21}
-!20 = !DILocalVariable(name: "a", arg: 1, scope: !16, file: !1, line: 4, type: !7)
-!21 = !DILocalVariable(name: "b", scope: !16, file: !1, line: 5, type: !7)
-!22 = !{!23}
-!23 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !24, isLocal: false, isDefinition: true))
-!24 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
-!25 = !{i32 2, !"CodeView", i32 1}
-!26 = !{i32 2, !"Debug Info Version", i32 3}
-!27 = !{i32 1, !"PIC Level", i32 2}
-!28 = !{!"clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)"}
-!29 = !DIExpression()
-!30 = !DILocation(line: 9, column: 12, scope: !4)
-!31 = !DILocation(line: 10, column: 7, scope: !12)
-!32 = !DILocation(line: 15, column: 13, scope: !15)
-!33 = !DILocation(line: 10, column: 7, scope: !4)
-!34 = !DILocation(line: 11, column: 9, scope: !11)
-!35 = !DILocation(line: 4, column: 33, scope: !16, inlinedAt: !36)
-!36 = distinct !DILocation(line: 12, column: 13, scope: !11)
-!37 = !DILocation(line: 5, column: 13, scope: !16, inlinedAt: !36)
-!38 = !DILocation(line: 5, column: 7, scope: !16, inlinedAt: !36)
-!39 = !DILocation(line: 6, column: 3, scope: !16, inlinedAt: !36)
+!8 = !{i32 2, !"CodeView", i32 1}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"PIC Level", i32 2}
+!11 = !{!"clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)"}
+!12 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 9, type: !13, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !15)
+!13 = !DISubroutineType(types: !14)
+!14 = !{null, !7}
+!15 = !{!16, !17, !20, !21}
+!16 = !DILocalVariable(name: "p", arg: 1, scope: !12, file: !3, line: 9, type: !7)
+!17 = !DILocalVariable(name: "a", scope: !18, file: !3, line: 11, type: !7)
+!18 = distinct !DILexicalBlock(scope: !19, file: !3, line: 10, column: 10)
+!19 = distinct !DILexicalBlock(scope: !12, file: !3, line: 10, column: 7)
+!20 = !DILocalVariable(name: "b", scope: !18, file: !3, line: 12, type: !7)
+!21 = !DILocalVariable(name: "c", scope: !22, file: !3, line: 15, type: !7)
+!22 = distinct !DILexicalBlock(scope: !19, file: !3, line: 14, column: 10)
+!23 = !DIExpression()
+!24 = !DILocation(line: 9, column: 12, scope: !12)
+!25 = !DILocation(line: 10, column: 7, scope: !19)
+!26 = !DILocation(line: 15, column: 13, scope: !22)
+!27 = !DILocation(line: 10, column: 7, scope: !12)
+!28 = !DILocation(line: 11, column: 9, scope: !18)
+!29 = !DILocalVariable(name: "a", arg: 1, scope: !30, file: !3, line: 4, type: !7)
+!30 = distinct !DISubprogram(name: "inlineinc", scope: !3, file: !3, line: 4, type: !31, isLocal: true, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !33)
+!31 = !DISubroutineType(types: !32)
+!32 = !{!7, !7}
+!33 = !{!29, !34}
+!34 = !DILocalVariable(name: "b", scope: !30, file: !3, line: 5, type: !7)
+!35 = !DILocation(line: 4, column: 33, scope: !30, inlinedAt: !36)
+!36 = distinct !DILocation(line: 12, column: 13, scope: !18)
+!37 = !DILocation(line: 5, column: 13, scope: !30, inlinedAt: !36)
+!38 = !DILocation(line: 5, column: 7, scope: !30, inlinedAt: !36)
+!39 = !DILocation(line: 6, column: 3, scope: !30, inlinedAt: !36)
 !40 = !{!41, !41, i64 0}
 !41 = !{!"int", !42, i64 0}
 !42 = !{!"omnipotent char", !43, i64 0}
 !43 = !{!"Simple C/C++ TBAA"}
-!44 = !DILocation(line: 12, column: 9, scope: !11)
-!45 = !DILocation(line: 13, column: 5, scope: !11)
-!46 = !DILocation(line: 14, column: 3, scope: !11)
-!47 = !DILocation(line: 15, column: 9, scope: !15)
-!48 = !DILocation(line: 16, column: 5, scope: !15)
-!49 = !DILocation(line: 18, column: 1, scope: !4)
+!44 = !DILocation(line: 12, column: 9, scope: !18)
+!45 = !DILocation(line: 13, column: 5, scope: !18)
+!46 = !DILocation(line: 14, column: 3, scope: !18)
+!47 = !DILocation(line: 15, column: 9, scope: !22)
+!48 = !DILocation(line: 16, column: 5, scope: !22)
+!49 = !DILocation(line: 18, column: 1, scope: !12)
+

+ 47 - 46
test/DebugInfo/COFF/scopes.ll

@@ -70,7 +70,6 @@
 ; CHECK-NEXT:    Name: method
 ; CHECK-NEXT:  }
 
-
 ; ModuleID = 't.cpp'
 source_filename = "t.cpp"
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
@@ -79,67 +78,69 @@ target triple = "x86_64-pc-windows-msvc19.0.23918"
 %"struct.foo::bar::GlobalRecord" = type { i32 }
 %struct.LocalRecord = type { i32 }
 
-@"\01?g@bar@foo@@3UGlobalRecord@12@A" = global %"struct.foo::bar::GlobalRecord" zeroinitializer, align 4, !dbg !4
+@"\01?g@bar@foo@@3UGlobalRecord@12@A" = global %"struct.foo::bar::GlobalRecord" zeroinitializer, align 4, !dbg !0
 
 ; Function Attrs: nounwind uwtable
-define void @"\01?baz@bar@foo@@YAXXZ"() #0 !dbg !19 {
+define void @"\01?baz@bar@foo@@YAXXZ"() #0 !dbg !20 {
 entry:
   %l = alloca %struct.LocalRecord, align 4
-  call void @llvm.dbg.declare(metadata %struct.LocalRecord* %l, metadata !22, metadata !26), !dbg !27
-  ret void, !dbg !28
+  call void @llvm.dbg.declare(metadata %struct.LocalRecord* %l, metadata !23, metadata !27), !dbg !28
+  ret void, !dbg !29
 }
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
 ; Function Attrs: nounwind uwtable
-define void @"\01?method@GlobalRecord@bar@foo@@QEAAXXZ"(%"struct.foo::bar::GlobalRecord"* %this) #0 align 2 !dbg !29 {
+define void @"\01?method@GlobalRecord@bar@foo@@QEAAXXZ"(%"struct.foo::bar::GlobalRecord"* %this) #0 align 2 !dbg !30 {
 entry:
   %this.addr = alloca %"struct.foo::bar::GlobalRecord"*, align 8
   store %"struct.foo::bar::GlobalRecord"* %this, %"struct.foo::bar::GlobalRecord"** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %"struct.foo::bar::GlobalRecord"** %this.addr, metadata !30, metadata !26), !dbg !32
+  call void @llvm.dbg.declare(metadata %"struct.foo::bar::GlobalRecord"** %this.addr, metadata !31, metadata !27), !dbg !33
   %this1 = load %"struct.foo::bar::GlobalRecord"*, %"struct.foo::bar::GlobalRecord"** %this.addr, align 8
-  ret void, !dbg !33
+  ret void, !dbg !34
 }
 
 attributes #0 = { nounwind 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 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!15, !16, !17}
-!llvm.ident = !{!18}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!3 = !{!4}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "g", linkageName: "\01?g@bar@foo@@3UGlobalRecord@12@A", scope: !5, file: !1, line: 12, type: !7, isLocal: false, isDefinition: true))
-!5 = !DINamespace(name: "bar", scope: !6, file: !1, line: 2)
-!6 = !DINamespace(name: "foo", scope: null, file: !1, line: 1)
-!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GlobalRecord", scope: !5, file: !1, line: 9, size: 32, align: 32, elements: !8, identifier: ".?AUGlobalRecord@bar@foo@@")
-!8 = !{!9, !11}
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !7, file: !1, line: 10, baseType: !10, size: 32, align: 32)
-!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!11 = !DISubprogram(name: "method", linkageName: "\01?method@GlobalRecord@bar@foo@@QEAAXXZ", scope: !7, file: !1, line: 11, type: !12, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false)
-!12 = !DISubroutineType(types: !13)
-!13 = !{null, !14}
-!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!15 = !{i32 2, !"CodeView", i32 1}
-!16 = !{i32 2, !"Debug Info Version", i32 3}
-!17 = !{i32 1, !"PIC Level", i32 2}
-!18 = !{!"clang version 3.9.0 "}
-!19 = distinct !DISubprogram(name: "baz", linkageName: "\01?baz@bar@foo@@YAXXZ", scope: !5, file: !1, line: 3, type: !20, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!20 = !DISubroutineType(types: !21)
-!21 = !{null}
-!22 = !DILocalVariable(name: "l", scope: !19, file: !1, line: 6, type: !23)
-!23 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "LocalRecord", scope: !19, file: !1, line: 4, size: 32, align: 32, elements: !24)
-!24 = !{!25}
-!25 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !23, file: !1, line: 5, baseType: !10, size: 32, align: 32)
-!26 = !DIExpression()
-!27 = !DILocation(line: 6, column: 5, scope: !19)
-!28 = !DILocation(line: 7, column: 1, scope: !19)
-!29 = distinct !DISubprogram(name: "method", linkageName: "\01?method@GlobalRecord@bar@foo@@QEAAXXZ", scope: !7, file: !1, line: 13, type: !12, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !11, variables: !2)
-!30 = !DILocalVariable(name: "this", arg: 1, scope: !29, type: !31, flags: DIFlagArtificial | DIFlagObjectPointer)
-!31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
-!32 = !DILocation(line: 0, scope: !29)
-!33 = !DILocation(line: 13, column: 30, scope: !29)
+!llvm.dbg.cu = !{!13}
+!llvm.module.flags = !{!16, !17, !18}
+!llvm.ident = !{!19}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "g", linkageName: "\01?g@bar@foo@@3UGlobalRecord@12@A", scope: !2, file: !3, line: 12, type: !5, isLocal: false, isDefinition: true)
+!2 = !DINamespace(name: "bar", scope: !4, file: !3, line: 2)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !DINamespace(name: "foo", scope: null, file: !3, line: 1)
+!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GlobalRecord", scope: !2, file: !3, line: 9, size: 32, align: 32, elements: !6, identifier: ".?AUGlobalRecord@bar@foo@@")
+!6 = !{!7, !9}
+!7 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !5, file: !3, line: 10, baseType: !8, size: 32, align: 32)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = !DISubprogram(name: "method", linkageName: "\01?method@GlobalRecord@bar@foo@@QEAAXXZ", scope: !5, file: !3, line: 11, type: !10, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false)
+!10 = !DISubroutineType(types: !11)
+!11 = !{null, !12}
+!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !14, globals: !15)
+!14 = !{}
+!15 = !{!0}
+!16 = !{i32 2, !"CodeView", i32 1}
+!17 = !{i32 2, !"Debug Info Version", i32 3}
+!18 = !{i32 1, !"PIC Level", i32 2}
+!19 = !{!"clang version 3.9.0 "}
+!20 = distinct !DISubprogram(name: "baz", linkageName: "\01?baz@bar@foo@@YAXXZ", scope: !2, file: !3, line: 3, type: !21, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !13, variables: !14)
+!21 = !DISubroutineType(types: !22)
+!22 = !{null}
+!23 = !DILocalVariable(name: "l", scope: !20, file: !3, line: 6, type: !24)
+!24 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "LocalRecord", scope: !20, file: !3, line: 4, size: 32, align: 32, elements: !25)
+!25 = !{!26}
+!26 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !24, file: !3, line: 5, baseType: !8, size: 32, align: 32)
+!27 = !DIExpression()
+!28 = !DILocation(line: 6, column: 5, scope: !20)
+!29 = !DILocation(line: 7, column: 1, scope: !20)
+!30 = distinct !DISubprogram(name: "method", linkageName: "\01?method@GlobalRecord@bar@foo@@QEAAXXZ", scope: !5, file: !3, line: 13, type: !10, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !13, declaration: !9, variables: !14)
+!31 = !DILocalVariable(name: "this", arg: 1, scope: !30, type: !32, flags: DIFlagArtificial | DIFlagObjectPointer)
+!32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
+!33 = !DILocation(line: 0, scope: !30)
+!34 = !DILocation(line: 13, column: 30, scope: !30)
+

+ 75 - 70
test/DebugInfo/COFF/types-array-advanced.ll

@@ -122,97 +122,102 @@
 ; CHECK:   }
 ; CHECK: ]
 
+source_filename = "test/DebugInfo/COFF/types-array-advanced.ll"
 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i686-pc-windows-msvc18.0.31101"
 
 %struct.incomplete_struct = type { i32 }
 
-@"\01?multi_dim_arr@@3PAY146DA" = global [2 x [5 x [7 x i8]]] zeroinitializer, align 1, !dbg !4
-@"\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A" = global [3 x i8]* null, align 4, !dbg !11
-@"\01?incomplete_struct_arr@@3PAUincomplete_struct@@A" = global [3 x %struct.incomplete_struct] zeroinitializer, align 4, !dbg !20
-@"\01?typedef_arr@@3SDHD" = constant [4 x i32] zeroinitializer, align 4, !dbg !21
+@"\01?multi_dim_arr@@3PAY146DA" = global [2 x [5 x [7 x i8]]] zeroinitializer, align 1, !dbg !0
+@"\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A" = global [3 x i8]* null, align 4, !dbg !6
+@"\01?incomplete_struct_arr@@3PAUincomplete_struct@@A" = global [3 x %struct.incomplete_struct] zeroinitializer, align 4, !dbg !16
+@"\01?typedef_arr@@3SDHD" = constant [4 x i32] zeroinitializer, align 4, !dbg !18
 
 ; Function Attrs: nounwind
-define void @"\01?foo@@YAXH@Z"(i32 %x) #0 !dbg !31 {
+define void @"\01?foo@@YAXH@Z"(i32 %x) #0 !dbg !35 {
 entry:
   %x.addr = alloca i32, align 4
   %saved_stack = alloca i8*, align 4
   store i32 %x, i32* %x.addr, align 4
-  call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !34, metadata !35), !dbg !36
-  %0 = load i32, i32* %x.addr, align 4, !dbg !37
-  %1 = call i8* @llvm.stacksave(), !dbg !38
-  store i8* %1, i8** %saved_stack, align 4, !dbg !38
-  %vla = alloca i32, i32 %0, align 4, !dbg !38
-  call void @llvm.dbg.declare(metadata i32* %vla, metadata !39, metadata !43), !dbg !44
-  %arrayidx = getelementptr inbounds i32, i32* %vla, i32 0, !dbg !45
-  store i32 0, i32* %arrayidx, align 4, !dbg !46
-  %2 = load i8*, i8** %saved_stack, align 4, !dbg !47
-  call void @llvm.stackrestore(i8* %2), !dbg !47
-  ret void, !dbg !47
+  call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !38, metadata !39), !dbg !40
+  %0 = load i32, i32* %x.addr, align 4, !dbg !41
+  %1 = call i8* @llvm.stacksave(), !dbg !42
+  store i8* %1, i8** %saved_stack, align 4, !dbg !42
+  %vla = alloca i32, i32 %0, align 4, !dbg !42
+  call void @llvm.dbg.declare(metadata i32* %vla, metadata !43, metadata !47), !dbg !48
+  %arrayidx = getelementptr inbounds i32, i32* %vla, i32 0, !dbg !49
+  store i32 0, i32* %arrayidx, align 4, !dbg !50
+  %2 = load i8*, i8** %saved_stack, align 4, !dbg !51
+  call void @llvm.stackrestore(i8* %2), !dbg !51
+  ret void, !dbg !51
 }
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
 ; Function Attrs: nounwind
-declare i8* @llvm.stacksave() #2
+declare i8* @llvm.stacksave() #0
 
 ; Function Attrs: nounwind
-declare void @llvm.stackrestore(i8*) #2
+declare void @llvm.stackrestore(i8*) #0
 
 attributes #0 = { nounwind }
 attributes #1 = { nounwind readnone }
-attributes #2 = { nounwind }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!28, !29}
-!llvm.ident = !{!30}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!32, !33}
+!llvm.ident = !{!34}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "multi_dim_arr", linkageName: "\01?multi_dim_arr@@3PAY146DA", scope: !2, file: !3, line: 1, type: !26, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 273874)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "/")
+!4 = !{}
+!5 = !{!0, !6, !16, !18}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "p_incomplete_struct_arr", linkageName: "\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A", scope: !2, file: !3, line: 3, type: !8, isLocal: false, isDefinition: true)
+!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 32, align: 32)
+!9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, elements: !14)
+!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "incomplete_struct", file: !3, line: 4, size: 32, align: 32, elements: !11, identifier: ".?AUincomplete_struct@@")
+!11 = !{!12}
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "s1", scope: !10, file: !3, line: 5, baseType: !13, size: 32, align: 32)
+!13 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!14 = !{!15}
+!15 = !DISubrange(count: 3)
+!16 = distinct !DIGlobalVariableExpression(var: !17)
+!17 = !DIGlobalVariable(name: "incomplete_struct_arr", linkageName: "\01?incomplete_struct_arr@@3PAUincomplete_struct@@A", scope: !2, file: !3, line: 6, type: !9, isLocal: false, isDefinition: true)
+!18 = distinct !DIGlobalVariableExpression(var: !19)
+!19 = !DIGlobalVariable(name: "typedef_arr", linkageName: "\01?typedef_arr@@3SDHD", scope: !2, file: !3, line: 14, type: !20, isLocal: false, isDefinition: true)
+!20 = !DICompositeType(tag: DW_TAG_array_type, baseType: !21, size: 128, align: 32, elements: !24)
+!21 = !DIDerivedType(tag: DW_TAG_typedef, name: "T_INT", file: !3, line: 13, baseType: !22)
+!22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !23)
+!23 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !13)
+!24 = !{!25}
+!25 = !DISubrange(count: 4)
+!26 = !DICompositeType(tag: DW_TAG_array_type, baseType: !27, size: 560, align: 8, elements: !28)
+!27 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!28 = !{!29, !30, !31}
+!29 = !DISubrange(count: 2)
+!30 = !DISubrange(count: 5)
+!31 = !DISubrange(count: 7)
+!32 = !{i32 2, !"CodeView", i32 1}
+!33 = !{i32 2, !"Debug Info Version", i32 3}
+!34 = !{!"clang version 3.9.0 (trunk 273874)"}
+!35 = distinct !DISubprogram(name: "foo", linkageName: "\01?foo@@YAXH@Z", scope: !3, file: !3, line: 8, type: !36, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!36 = !DISubroutineType(types: !37)
+!37 = !{null, !13}
+!38 = !DILocalVariable(name: "x", arg: 1, scope: !35, file: !3, line: 8, type: !13)
+!39 = !DIExpression()
+!40 = !DILocation(line: 8, column: 14, scope: !35)
+!41 = !DILocation(line: 9, column: 21, scope: !35)
+!42 = !DILocation(line: 9, column: 4, scope: !35)
+!43 = !DILocalVariable(name: "dyn_size_arr", scope: !35, file: !3, line: 9, type: !44)
+!44 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, align: 32, elements: !45)
+!45 = !{!46}
+!46 = !DISubrange(count: -1)
+!47 = !DIExpression(DW_OP_deref)
+!48 = !DILocation(line: 9, column: 8, scope: !35)
+!49 = !DILocation(line: 10, column: 4, scope: !35)
+!50 = !DILocation(line: 10, column: 20, scope: !35)
+!51 = !DILocation(line: 11, column: 1, scope: !35)
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 273874)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "t.cpp", directory: "/")
-!2 = !{}
-!3 = !{!4, !11, !20, !21}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "multi_dim_arr", linkageName: "\01?multi_dim_arr@@3PAY146DA", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true))
-!5 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 560, align: 8, elements: !7)
-!6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!7 = !{!8, !9, !10}
-!8 = !DISubrange(count: 2)
-!9 = !DISubrange(count: 5)
-!10 = !DISubrange(count: 7)
-!11 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "p_incomplete_struct_arr", linkageName: "\01?p_incomplete_struct_arr@@3PAY02Uincomplete_struct@@A", scope: !0, file: !1, line: 3, type: !12, isLocal: false, isDefinition: true))
-!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 32, align: 32)
-!13 = !DICompositeType(tag: DW_TAG_array_type, baseType: !14, elements: !18)
-!14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "incomplete_struct", file: !1, line: 4, size: 32, align: 32, elements: !15, identifier: ".?AUincomplete_struct@@")
-!15 = !{!16}
-!16 = !DIDerivedType(tag: DW_TAG_member, name: "s1", scope: !14, file: !1, line: 5, baseType: !17, size: 32, align: 32)
-!17 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!18 = !{!19}
-!19 = !DISubrange(count: 3)
-!20 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "incomplete_struct_arr", linkageName: "\01?incomplete_struct_arr@@3PAUincomplete_struct@@A", scope: !0, file: !1, line: 6, type: !13, isLocal: false, isDefinition: true))
-!21 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "typedef_arr", linkageName: "\01?typedef_arr@@3SDHD", scope: !0, file: !1, line: 14, type: !22, isLocal: false, isDefinition: true))
-!22 = !DICompositeType(tag: DW_TAG_array_type, baseType: !23, size: 128, align: 32, elements: !26)
-!23 = !DIDerivedType(tag: DW_TAG_typedef, name: "T_INT", file: !1, line: 13, baseType: !24)
-!24 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !25)
-!25 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !17)
-!26 = !{!27}
-!27 = !DISubrange(count: 4)
-!28 = !{i32 2, !"CodeView", i32 1}
-!29 = !{i32 2, !"Debug Info Version", i32 3}
-!30 = !{!"clang version 3.9.0 (trunk 273874)"}
-!31 = distinct !DISubprogram(name: "foo", linkageName: "\01?foo@@YAXH@Z", scope: !1, file: !1, line: 8, type: !32, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!32 = !DISubroutineType(types: !33)
-!33 = !{null, !17}
-!34 = !DILocalVariable(name: "x", arg: 1, scope: !31, file: !1, line: 8, type: !17)
-!35 = !DIExpression()
-!36 = !DILocation(line: 8, column: 14, scope: !31)
-!37 = !DILocation(line: 9, column: 21, scope: !31)
-!38 = !DILocation(line: 9, column: 4, scope: !31)
-!39 = !DILocalVariable(name: "dyn_size_arr", scope: !31, file: !1, line: 9, type: !40)
-!40 = !DICompositeType(tag: DW_TAG_array_type, baseType: !17, align: 32, elements: !41)
-!41 = !{!42}
-!42 = !DISubrange(count: -1)
-!43 = !DIExpression(DW_OP_deref)
-!44 = !DILocation(line: 9, column: 8, scope: !31)
-!45 = !DILocation(line: 10, column: 4, scope: !31)
-!46 = !DILocation(line: 10, column: 20, scope: !31)
-!47 = !DILocation(line: 11, column: 1, scope: !31)

+ 17 - 15
test/DebugInfo/COFF/types-nested-class.ll

@@ -79,20 +79,22 @@ target triple = "i686-pc-windows-msvc19.0.23918"
 
 %struct.A = type { i8 }
 
-@"\01?a@@3UA@@A" = global %struct.A zeroinitializer, align 1, !dbg !4
+@"\01?a@@3UA@@A" = global %struct.A zeroinitializer, align 1, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!8, !9}
-!llvm.ident = !{!10}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!9, !10}
+!llvm.ident = !{!11}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", linkageName: "\01?a@@3UA@@A", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "hello.cpp", directory: "D:\5Csrc\5Chello")
+!4 = !{}
+!5 = !{!0}
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 8, align: 8, elements: !7, identifier: ".?AUA@@")
+!7 = !{!8}
+!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", scope: !6, file: !3, line: 2, size: 8, align: 8, flags: DIFlagFwdDecl, identifier: ".?AUNested@A@@")
+!9 = !{i32 2, !"CodeView", i32 1}
+!10 = !{i32 2, !"Debug Info Version", i32 3}
+!11 = !{!"clang version 3.9.0 "}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "hello.cpp", directory: "D:\5Csrc\5Chello")
-!2 = !{}
-!3 = !{!4}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", linkageName: "\01?a@@3UA@@A", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true))
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !6, identifier: ".?AUA@@")
-!6 = !{!7}
-!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", scope: !5, file: !1, line: 2, size: 8, align: 8, flags: DIFlagFwdDecl, identifier: ".?AUNested@A@@")
-!8 = !{i32 2, !"CodeView", i32 1}
-!9 = !{i32 2, !"Debug Info Version", i32 3}
-!10 = !{!"clang version 3.9.0 "}

+ 82 - 71
test/DebugInfo/COFF/types-ptr-to-member.ll

@@ -184,78 +184,89 @@ target triple = "x86_64-pc-windows-msvc19.0.23918"
 %0 = type opaque
 %1 = type opaque
 
-@"\01?pmd_a@@3PEQA@@HEQ1@" = global i32 -1, align 8, !dbg !4
-@"\01?pmd_b@@3PEQC@@HEQ1@" = global i32 -1, align 8, !dbg !10
-@"\01?pmd_c@@3PEQD@@HEQ1@" = global { i32, i32 } { i32 0, i32 -1 }, align 8, !dbg !20
-@"\01?pmd_d@@3PEQE@@HEQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 8, !dbg !23
-@"\01?pmf_a@@3P8A@@EAAXXZEQ1@" = global i8* null, align 8, !dbg !26
-@"\01?pmf_b@@3P8C@@EAAXXZEQ1@" = global { i8*, i32 } zeroinitializer, align 8, !dbg !31
-@"\01?pmf_c@@3P8D@@EAAXXZEQ1@" = global { i8*, i32, i32 } zeroinitializer, align 8, !dbg !36
-@"\01?pmf_d@@3P8E@@EAAXXZEQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 8, !dbg !41
-@"\01?ppmd@@3PEAPEQIncomplete@@HEA" = global %0* null, align 8, !dbg !46
-@"\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA" = global %1* null, align 8, !dbg !50
+@"\01?pmd_a@@3PEQA@@HEQ1@" = global i32 -1, align 8, !dbg !0
+@"\01?pmd_b@@3PEQC@@HEQ1@" = global i32 -1, align 8, !dbg !6
+@"\01?pmd_c@@3PEQD@@HEQ1@" = global { i32, i32 } { i32 0, i32 -1 }, align 8, !dbg !21
+@"\01?pmd_d@@3PEQE@@HEQ1@" = global { i32, i32, i32 } { i32 0, i32 0, i32 -1 }, align 8, !dbg !25
+@"\01?pmf_a@@3P8A@@EAAXXZEQ1@" = global i8* null, align 8, !dbg !29
+@"\01?pmf_b@@3P8C@@EAAXXZEQ1@" = global { i8*, i32 } zeroinitializer, align 8, !dbg !35
+@"\01?pmf_c@@3P8D@@EAAXXZEQ1@" = global { i8*, i32, i32 } zeroinitializer, align 8, !dbg !41
+@"\01?pmf_d@@3P8E@@EAAXXZEQ1@" = global { i8*, i32, i32, i32 } zeroinitializer, align 8, !dbg !47
+@"\01?ppmd@@3PEAPEQIncomplete@@HEA" = global %0* null, align 8, !dbg !53
+@"\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA" = global %1* null, align 8, !dbg !58
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!56, !57, !58}
-!llvm.ident = !{!59}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!66, !67, !68}
+!llvm.ident = !{!69}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 273036) (llvm/trunk 273053)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!3 = !{!4, !10, !20, !23, !26, !31, !36, !41, !46, !50}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmd_a", linkageName: "\01?pmd_a@@3PEQA@@HEQ1@", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 32, flags: DIFlagSingleInheritance, extraData: !7)
-!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 32, align: 32, elements: !8, identifier: ".?AUA@@")
-!8 = !{!9}
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !7, file: !1, line: 1, baseType: !6, size: 32, align: 32)
-!10 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmd_b", linkageName: "\01?pmd_b@@3PEQC@@HEQ1@", scope: !0, file: !1, line: 7, type: !11, isLocal: false, isDefinition: true))
-!11 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 32, flags: DIFlagMultipleInheritance, extraData: !12)
-!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !1, line: 3, size: 96, align: 32, elements: !13, identifier: ".?AUC@@")
-!13 = !{!14, !15, !19}
-!14 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !12, baseType: !7)
-!15 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !12, baseType: !16, offset: 32)
-!16 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !1, line: 2, size: 32, align: 32, elements: !17, identifier: ".?AUB@@")
-!17 = !{!18}
-!18 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !16, file: !1, line: 2, baseType: !6, size: 32, align: 32)
-!19 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !12, file: !1, line: 3, baseType: !6, size: 32, align: 32, offset: 64)
-!20 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmd_c", linkageName: "\01?pmd_c@@3PEQD@@HEQ1@", scope: !0, file: !1, line: 8, type: !21, isLocal: false, isDefinition: true))
-!21 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 64, flags: DIFlagVirtualInheritance, extraData: !22)
-!22 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !1, line: 4, size: 256, align: 64, flags: DIFlagFwdDecl, identifier: ".?AUD@@")
-!23 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmd_d", linkageName: "\01?pmd_d@@3PEQE@@HEQ1@", scope: !0, file: !1, line: 9, type: !24, isLocal: false, isDefinition: true))
-!24 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 96, extraData: !25)
-!25 = !DICompositeType(tag: DW_TAG_structure_type, name: "E", file: !1, line: 5, flags: DIFlagFwdDecl, identifier: ".?AUE@@")
-!26 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmf_a", linkageName: "\01?pmf_a@@3P8A@@EAAXXZEQ1@", scope: !0, file: !1, line: 10, type: !27, isLocal: false, isDefinition: true))
-!27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, size: 64, flags: DIFlagSingleInheritance, extraData: !7)
-!28 = !DISubroutineType(types: !29)
-!29 = !{null, !30}
-!30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!31 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmf_b", linkageName: "\01?pmf_b@@3P8C@@EAAXXZEQ1@", scope: !0, file: !1, line: 11, type: !32, isLocal: false, isDefinition: true))
-!32 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !33, size: 128, flags: DIFlagMultipleInheritance, extraData: !12)
-!33 = !DISubroutineType(types: !34)
-!34 = !{null, !35}
-!35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!36 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmf_c", linkageName: "\01?pmf_c@@3P8D@@EAAXXZEQ1@", scope: !0, file: !1, line: 12, type: !37, isLocal: false, isDefinition: true))
-!37 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !38, size: 128, flags: DIFlagVirtualInheritance, extraData: !22)
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "pmd_a", linkageName: "\01?pmd_a@@3PEQA@@HEQ1@", scope: !2, file: !3, line: 6, type: !65, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 273036) (llvm/trunk 273053)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0, !6, !21, !25, !29, !35, !41, !47, !53, !58}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "pmd_b", linkageName: "\01?pmd_b@@3PEQC@@HEQ1@", scope: !2, file: !3, line: 7, type: !8, isLocal: false, isDefinition: true)
+!8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 32, flags: DIFlagMultipleInheritance, extraData: !10)
+!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !3, line: 3, size: 96, align: 32, elements: !11, identifier: ".?AUC@@")
+!11 = !{!12, !16, !20}
+!12 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !10, baseType: !13)
+!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 32, align: 32, elements: !14, identifier: ".?AUA@@")
+!14 = !{!15}
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !13, file: !3, line: 1, baseType: !9, size: 32, align: 32)
+!16 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !10, baseType: !17, offset: 32)
+!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !3, line: 2, size: 32, align: 32, elements: !18, identifier: ".?AUB@@")
+!18 = !{!19}
+!19 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !17, file: !3, line: 2, baseType: !9, size: 32, align: 32)
+!20 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !10, file: !3, line: 3, baseType: !9, size: 32, align: 32, offset: 64)
+!21 = distinct !DIGlobalVariableExpression(var: !22)
+!22 = !DIGlobalVariable(name: "pmd_c", linkageName: "\01?pmd_c@@3PEQD@@HEQ1@", scope: !2, file: !3, line: 8, type: !23, isLocal: false, isDefinition: true)
+!23 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 64, flags: DIFlagVirtualInheritance, extraData: !24)
+!24 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !3, line: 4, size: 256, align: 64, flags: DIFlagFwdDecl, identifier: ".?AUD@@")
+!25 = distinct !DIGlobalVariableExpression(var: !26)
+!26 = !DIGlobalVariable(name: "pmd_d", linkageName: "\01?pmd_d@@3PEQE@@HEQ1@", scope: !2, file: !3, line: 9, type: !27, isLocal: false, isDefinition: true)
+!27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 96, extraData: !28)
+!28 = !DICompositeType(tag: DW_TAG_structure_type, name: "E", file: !3, line: 5, flags: DIFlagFwdDecl, identifier: ".?AUE@@")
+!29 = distinct !DIGlobalVariableExpression(var: !30)
+!30 = !DIGlobalVariable(name: "pmf_a", linkageName: "\01?pmf_a@@3P8A@@EAAXXZEQ1@", scope: !2, file: !3, line: 10, type: !31, isLocal: false, isDefinition: true)
+!31 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !32, size: 64, flags: DIFlagSingleInheritance, extraData: !13)
+!32 = !DISubroutineType(types: !33)
+!33 = !{null, !34}
+!34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!35 = distinct !DIGlobalVariableExpression(var: !36)
+!36 = !DIGlobalVariable(name: "pmf_b", linkageName: "\01?pmf_b@@3P8C@@EAAXXZEQ1@", scope: !2, file: !3, line: 11, type: !37, isLocal: false, isDefinition: true)
+!37 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !38, size: 128, flags: DIFlagMultipleInheritance, extraData: !10)
 !38 = !DISubroutineType(types: !39)
 !39 = !{null, !40}
-!40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !22, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!41 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "pmf_d", linkageName: "\01?pmf_d@@3P8E@@EAAXXZEQ1@", scope: !0, file: !1, line: 13, type: !42, isLocal: false, isDefinition: true))
-!42 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !43, size: 192, extraData: !25)
-!43 = !DISubroutineType(types: !44)
-!44 = !{null, !45}
-!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !25, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!46 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ppmd", linkageName: "\01?ppmd@@3PEAPEQIncomplete@@HEA", scope: !0, file: !1, line: 15, type: !47, isLocal: false, isDefinition: true))
-!47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !48, size: 64, align: 64)
-!48 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, extraData: !49)
-!49 = !DICompositeType(tag: DW_TAG_structure_type, name: "Incomplete", file: !1, line: 14, flags: DIFlagFwdDecl, identifier: ".?AUIncomplete@@")
-!50 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ppmf", linkageName: "\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA", scope: !0, file: !1, line: 16, type: !51, isLocal: false, isDefinition: true))
-!51 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !52, size: 64, align: 64)
-!52 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !53, extraData: !49)
-!53 = !DISubroutineType(types: !54)
-!54 = !{null, !55}
-!55 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !49, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!56 = !{i32 2, !"CodeView", i32 1}
-!57 = !{i32 2, !"Debug Info Version", i32 3}
-!58 = !{i32 1, !"PIC Level", i32 2}
-!59 = !{!"clang version 3.9.0 (trunk 273036) (llvm/trunk 273053)"}
+!40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!41 = distinct !DIGlobalVariableExpression(var: !42)
+!42 = !DIGlobalVariable(name: "pmf_c", linkageName: "\01?pmf_c@@3P8D@@EAAXXZEQ1@", scope: !2, file: !3, line: 12, type: !43, isLocal: false, isDefinition: true)
+!43 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !44, size: 128, flags: DIFlagVirtualInheritance, extraData: !24)
+!44 = !DISubroutineType(types: !45)
+!45 = !{null, !46}
+!46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !24, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!47 = distinct !DIGlobalVariableExpression(var: !48)
+!48 = !DIGlobalVariable(name: "pmf_d", linkageName: "\01?pmf_d@@3P8E@@EAAXXZEQ1@", scope: !2, file: !3, line: 13, type: !49, isLocal: false, isDefinition: true)
+!49 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !50, size: 192, extraData: !28)
+!50 = !DISubroutineType(types: !51)
+!51 = !{null, !52}
+!52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!53 = distinct !DIGlobalVariableExpression(var: !54)
+!54 = !DIGlobalVariable(name: "ppmd", linkageName: "\01?ppmd@@3PEAPEQIncomplete@@HEA", scope: !2, file: !3, line: 15, type: !55, isLocal: false, isDefinition: true)
+!55 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !56, size: 64, align: 64)
+!56 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, extraData: !57)
+!57 = !DICompositeType(tag: DW_TAG_structure_type, name: "Incomplete", file: !3, line: 14, flags: DIFlagFwdDecl, identifier: ".?AUIncomplete@@")
+!58 = distinct !DIGlobalVariableExpression(var: !59)
+!59 = !DIGlobalVariable(name: "ppmf", linkageName: "\01?ppmf@@3PEAP8Incomplete@@EAAXXZEA", scope: !2, file: !3, line: 16, type: !60, isLocal: false, isDefinition: true)
+!60 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !61, size: 64, align: 64)
+!61 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !62, extraData: !57)
+!62 = !DISubroutineType(types: !63)
+!63 = !{null, !64}
+!64 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !57, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!65 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 32, flags: DIFlagSingleInheritance, extraData: !13)
+!66 = !{i32 2, !"CodeView", i32 1}
+!67 = !{i32 2, !"Debug Info Version", i32 3}
+!68 = !{i32 1, !"PIC Level", i32 2}
+!69 = !{!"clang version 3.9.0 (trunk 273036) (llvm/trunk 273053)"}
+

+ 65 - 64
test/DebugInfo/COFF/udts.ll

@@ -1,7 +1,7 @@
 ; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
+source_filename = "test/DebugInfo/COFF/udts.ll"
 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i686-pc-windows-msvc18.0.0"
-
 ; C++ source to regenerate:
 ; $ cat t.cpp
 ; void f() {
@@ -50,90 +50,91 @@ target triple = "i686-pc-windows-msvc18.0.0"
 ; CHECK-NEXT: UDTName: U
 ; CHECK-NOT: UDT {
 
-
 %struct.U = type { i32 }
 %struct.S = type { i32 }
 %union.pun = type { i32 }
 
-@"\01?u@@3UU@@A" = global %struct.U zeroinitializer, align 4, !dbg !4
+@"\01?u@@3UU@@A" = global %struct.U zeroinitializer, align 4, !dbg !0
 
 ; Function Attrs: nounwind uwtable
-define void @"\01?f@@YAXXZ"() #0 !dbg !14 {
+define void @"\01?f@@YAXXZ"() #0 !dbg !15 {
 entry:
   %f = alloca i32, align 4
-  call void @llvm.dbg.declare(metadata i32* %f, metadata !17, metadata !19), !dbg !20
-  ret void, !dbg !21
+  call void @llvm.dbg.declare(metadata i32* %f, metadata !18, metadata !20), !dbg !21
+  ret void, !dbg !22
 }
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
 ; Function Attrs: nounwind uwtable
-define float @"\01?g@@YAMPEAUS@@@Z"(%struct.S* %s) #0 !dbg !22 {
+define float @"\01?g@@YAMPEAUS@@@Z"(%struct.S* %s) #0 !dbg !23 {
 entry:
   %s.addr = alloca %struct.S*, align 8
   %p = alloca %union.pun, align 4
   store %struct.S* %s, %struct.S** %s.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.S** %s.addr, metadata !30, metadata !19), !dbg !31
-  call void @llvm.dbg.declare(metadata %union.pun* %p, metadata !32, metadata !19), !dbg !37
-  %0 = load %struct.S*, %struct.S** %s.addr, align 8, !dbg !38
-  %x = getelementptr inbounds %struct.S, %struct.S* %0, i32 0, i32 0, !dbg !39
-  %1 = load i32, i32* %x, align 4, !dbg !39
-  %x1 = bitcast %union.pun* %p to i32*, !dbg !40
-  store i32 %1, i32* %x1, align 4, !dbg !41
-  %f = bitcast %union.pun* %p to float*, !dbg !42
-  %2 = load float, float* %f, align 4, !dbg !42
-  ret float %2, !dbg !43
+  call void @llvm.dbg.declare(metadata %struct.S** %s.addr, metadata !31, metadata !20), !dbg !32
+  call void @llvm.dbg.declare(metadata %union.pun* %p, metadata !33, metadata !20), !dbg !38
+  %0 = load %struct.S*, %struct.S** %s.addr, align 8, !dbg !39
+  %x = getelementptr inbounds %struct.S, %struct.S* %0, i32 0, i32 0, !dbg !40
+  %1 = load i32, i32* %x, align 4, !dbg !40
+  %x1 = bitcast %union.pun* %p to i32*, !dbg !41
+  store i32 %1, i32* %x1, align 4, !dbg !42
+  %f = bitcast %union.pun* %p to float*, !dbg !43
+  %2 = load float, float* %f, align 4, !dbg !43
+  ret float %2, !dbg !44
 }
 
 attributes #0 = { nounwind 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 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!10, !11, !12}
-!llvm.ident = !{!13}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!11, !12, !13}
+!llvm.ident = !{!14}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "u", linkageName: "\01?u@@3UU@@A", scope: !2, file: !3, line: 13, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "U", file: !3, line: 12, baseType: !7)
+!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 12, size: 32, align: 32, elements: !8, identifier: ".?AUU@@")
+!8 = !{!9}
+!9 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !7, file: !3, line: 12, baseType: !10, size: 32, align: 32)
+!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!11 = !{i32 2, !"CodeView", i32 1}
+!12 = !{i32 2, !"Debug Info Version", i32 3}
+!13 = !{i32 1, !"PIC Level", i32 2}
+!14 = !{!"clang version 3.9.0 "}
+!15 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !3, file: !3, line: 1, type: !16, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!16 = !DISubroutineType(types: !17)
+!17 = !{null}
+!18 = !DILocalVariable(name: "f", scope: !15, file: !3, line: 3, type: !19)
+!19 = !DIDerivedType(tag: DW_TAG_typedef, name: "FOO", scope: !15, file: !3, line: 2, baseType: !10)
+!20 = !DIExpression()
+!21 = !DILocation(line: 3, column: 7, scope: !15)
+!22 = !DILocation(line: 4, column: 1, scope: !15)
+!23 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAMPEAUS@@@Z", scope: !3, file: !3, line: 7, type: !24, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!24 = !DISubroutineType(types: !25)
+!25 = !{!26, !27}
+!26 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
+!27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64, align: 64)
+!28 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 6, size: 32, align: 32, elements: !29, identifier: ".?AUS@@")
+!29 = !{!30}
+!30 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !28, file: !3, line: 6, baseType: !10, size: 32, align: 32)
+!31 = !DILocalVariable(name: "s", arg: 1, scope: !23, file: !3, line: 7, type: !27)
+!32 = !DILocation(line: 7, column: 12, scope: !23)
+!33 = !DILocalVariable(name: "p", scope: !23, file: !3, line: 8, type: !34)
+!34 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "pun", scope: !23, file: !3, line: 8, size: 32, align: 32, elements: !35)
+!35 = !{!36, !37}
+!36 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !34, file: !3, line: 8, baseType: !10, size: 32, align: 32)
+!37 = !DIDerivedType(tag: DW_TAG_member, name: "f", scope: !34, file: !3, line: 8, baseType: !26, size: 32, align: 32)
+!38 = !DILocation(line: 8, column: 33, scope: !23)
+!39 = !DILocation(line: 9, column: 9, scope: !23)
+!40 = !DILocation(line: 9, column: 12, scope: !23)
+!41 = !DILocation(line: 9, column: 5, scope: !23)
+!42 = !DILocation(line: 9, column: 7, scope: !23)
+!43 = !DILocation(line: 10, column: 12, scope: !23)
+!44 = !DILocation(line: 10, column: 3, scope: !23)
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!3 = !{!4}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "u", linkageName: "\01?u@@3UU@@A", scope: !0, file: !1, line: 13, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIDerivedType(tag: DW_TAG_typedef, name: "U", file: !1, line: 12, baseType: !6)
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !1, line: 12, size: 32, align: 32, elements: !7, identifier: ".?AUU@@")
-!7 = !{!8}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !1, line: 12, baseType: !9, size: 32, align: 32)
-!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = !{i32 2, !"CodeView", i32 1}
-!11 = !{i32 2, !"Debug Info Version", i32 3}
-!12 = !{i32 1, !"PIC Level", i32 2}
-!13 = !{!"clang version 3.9.0 "}
-!14 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 1, type: !15, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!15 = !DISubroutineType(types: !16)
-!16 = !{null}
-!17 = !DILocalVariable(name: "f", scope: !14, file: !1, line: 3, type: !18)
-!18 = !DIDerivedType(tag: DW_TAG_typedef, name: "FOO", scope: !14, file: !1, line: 2, baseType: !9)
-!19 = !DIExpression()
-!20 = !DILocation(line: 3, column: 7, scope: !14)
-!21 = !DILocation(line: 4, column: 1, scope: !14)
-!22 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAMPEAUS@@@Z", scope: !1, file: !1, line: 7, type: !23, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!23 = !DISubroutineType(types: !24)
-!24 = !{!25, !26}
-!25 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
-!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !27, size: 64, align: 64)
-!27 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 6, size: 32, align: 32, elements: !28, identifier: ".?AUS@@")
-!28 = !{!29}
-!29 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !27, file: !1, line: 6, baseType: !9, size: 32, align: 32)
-!30 = !DILocalVariable(name: "s", arg: 1, scope: !22, file: !1, line: 7, type: !26)
-!31 = !DILocation(line: 7, column: 12, scope: !22)
-!32 = !DILocalVariable(name: "p", scope: !22, file: !1, line: 8, type: !33)
-!33 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "pun", scope: !22, file: !1, line: 8, size: 32, align: 32, elements: !34)
-!34 = !{!35, !36}
-!35 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !33, file: !1, line: 8, baseType: !9, size: 32, align: 32)
-!36 = !DIDerivedType(tag: DW_TAG_member, name: "f", scope: !33, file: !1, line: 8, baseType: !25, size: 32, align: 32)
-!37 = !DILocation(line: 8, column: 33, scope: !22)
-!38 = !DILocation(line: 9, column: 9, scope: !22)
-!39 = !DILocation(line: 9, column: 12, scope: !22)
-!40 = !DILocation(line: 9, column: 5, scope: !22)
-!41 = !DILocation(line: 9, column: 7, scope: !22)
-!42 = !DILocation(line: 10, column: 12, scope: !22)
-!43 = !DILocation(line: 10, column: 3, scope: !22)

+ 100 - 97
test/DebugInfo/COFF/virtual-method-kinds.ll

@@ -121,7 +121,7 @@ $"\01??_7A@@6B@" = comdat largest
 
 $"\01??_R4A@@6B@" = comdat any
 
-@"\01?p@@3PEAUC@@EA" = global %struct.C* null, align 8, !dbg !4
+@"\01?p@@3PEAUC@@EA" = global %struct.C* null, align 8, !dbg !0
 @0 = private unnamed_addr constant [3 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"\01??_R4C@@6B@" to i8*), i8* bitcast (void (%struct.C*)* @"\01?f@C@@UEAAXXZ" to i8*), i8* bitcast (void (%struct.C*)* @"\01?g@C@@UEAAXXZ" to i8*)], comdat($"\01??_7C@@6B@")
 @"\01??_R4C@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"\01??_R0?AUC@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"\01??_R3C@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"\01??_R4C@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
 @"\01??_7type_info@@6B@" = external constant i8*
@@ -149,47 +149,48 @@ $"\01??_R4A@@6B@" = comdat any
 @"\01??_7A@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ([3 x i8*], [3 x i8*]* @2, i32 0, i32 1)
 
 ; Function Attrs: uwtable
-define internal void @"\01??__Ep@@YAXXZ"() #0 !dbg !39 {
+define internal void @"\01??__Ep@@YAXXZ"() #0 !dbg !40 {
 entry:
-  %call = call i8* @"\01??2@YAPEAX_K@Z"(i64 8) #5, !dbg !42
-  %0 = bitcast i8* %call to %struct.C*, !dbg !42
-  %call1 = call %struct.C* @"\01??0C@@QEAA@XZ"(%struct.C* %0) #6, !dbg !43
-  store %struct.C* %0, %struct.C** @"\01?p@@3PEAUC@@EA", align 8, !dbg !42
-  ret void, !dbg !43
+  %call = call i8* @"\01??2@YAPEAX_K@Z"(i64 8) #5, !dbg !43
+  %0 = bitcast i8* %call to %struct.C*, !dbg !43
+  %call1 = call %struct.C* @"\01??0C@@QEAA@XZ"(%struct.C* %0) #6, !dbg !44
+  store %struct.C* %0, %struct.C** @"\01?p@@3PEAUC@@EA", align 8, !dbg !43
+  ret void, !dbg !44
 }
 
 ; Function Attrs: nobuiltin
 declare noalias i8* @"\01??2@YAPEAX_K@Z"(i64) #1
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr %struct.C* @"\01??0C@@QEAA@XZ"(%struct.C* returned %this) unnamed_addr #2 comdat align 2 !dbg !44 {
+
+define linkonce_odr %struct.C* @"\01??0C@@QEAA@XZ"(%struct.C* returned %this) unnamed_addr #2 comdat align 2 !dbg !45 {
 entry:
   %this.addr = alloca %struct.C*, align 8
   store %struct.C* %this, %struct.C** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !46, metadata !47), !dbg !48
+  call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !47, metadata !48), !dbg !49
   %this1 = load %struct.C*, %struct.C** %this.addr, align 8
-  %0 = bitcast %struct.C* %this1 to %struct.B*, !dbg !49
-  %call = call %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* %0) #6, !dbg !49
-  %1 = bitcast %struct.C* %this1 to i32 (...)***, !dbg !49
-  store i32 (...)** bitcast (i8** @"\01??_7C@@6B@" to i32 (...)**), i32 (...)*** %1, align 8, !dbg !49
-  ret %struct.C* %this1, !dbg !49
+  %0 = bitcast %struct.C* %this1 to %struct.B*, !dbg !50
+  %call = call %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* %0) #6, !dbg !50
+  %1 = bitcast %struct.C* %this1 to i32 (...)***, !dbg !50
+  store i32 (...)** bitcast (i8** @"\01??_7C@@6B@" to i32 (...)**), i32 (...)*** %1, align 8, !dbg !50
+  ret %struct.C* %this1, !dbg !50
 }
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #3
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* returned %this) unnamed_addr #2 comdat align 2 !dbg !50 {
+define linkonce_odr %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* returned %this) unnamed_addr #2 comdat align 2 !dbg !51 {
 entry:
   %this.addr = alloca %struct.B*, align 8
   store %struct.B* %this, %struct.B** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.B** %this.addr, metadata !52, metadata !47), !dbg !54
+  call void @llvm.dbg.declare(metadata %struct.B** %this.addr, metadata !53, metadata !48), !dbg !55
   %this1 = load %struct.B*, %struct.B** %this.addr, align 8
-  %0 = bitcast %struct.B* %this1 to %struct.A*, !dbg !55
-  %call = call %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* %0) #6, !dbg !55
-  %1 = bitcast %struct.B* %this1 to i32 (...)***, !dbg !55
-  store i32 (...)** bitcast (i8** @"\01??_7B@@6B@" to i32 (...)**), i32 (...)*** %1, align 8, !dbg !55
-  ret %struct.B* %this1, !dbg !55
+  %0 = bitcast %struct.B* %this1 to %struct.A*, !dbg !56
+  %call = call %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* %0) #6, !dbg !56
+  %1 = bitcast %struct.B* %this1 to i32 (...)***, !dbg !56
+  store i32 (...)** bitcast (i8** @"\01??_7B@@6B@" to i32 (...)**), i32 (...)*** %1, align 8, !dbg !56
+  ret %struct.B* %this1, !dbg !56
 }
 
 declare void @"\01?f@C@@UEAAXXZ"(%struct.C*) unnamed_addr #4
@@ -197,15 +198,15 @@ declare void @"\01?f@C@@UEAAXXZ"(%struct.C*) unnamed_addr #4
 declare void @"\01?g@C@@UEAAXXZ"(%struct.C*) unnamed_addr #4
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* returned %this) unnamed_addr #2 comdat align 2 !dbg !56 {
+define linkonce_odr %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* returned %this) unnamed_addr #2 comdat align 2 !dbg !57 {
 entry:
   %this.addr = alloca %struct.A*, align 8
   store %struct.A* %this, %struct.A** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.A** %this.addr, metadata !58, metadata !47), !dbg !60
+  call void @llvm.dbg.declare(metadata %struct.A** %this.addr, metadata !59, metadata !48), !dbg !61
   %this1 = load %struct.A*, %struct.A** %this.addr, align 8
-  %0 = bitcast %struct.A* %this1 to i32 (...)***, !dbg !61
-  store i32 (...)** bitcast (i8** @"\01??_7A@@6B@" to i32 (...)**), i32 (...)*** %0, align 8, !dbg !61
-  ret %struct.A* %this1, !dbg !61
+  %0 = bitcast %struct.A* %this1 to i32 (...)***, !dbg !62
+  store i32 (...)** bitcast (i8** @"\01??_7A@@6B@" to i32 (...)**), i32 (...)*** %0, align 8, !dbg !62
+  ret %struct.A* %this1, !dbg !62
 }
 
 declare void @_purecall() unnamed_addr
@@ -215,9 +216,9 @@ declare void @"\01?g@B@@UEAAXXZ"(%struct.B*) unnamed_addr #4
 declare void @"\01?f@A@@UEAAXXZ"(%struct.A*) unnamed_addr #4
 
 ; Function Attrs: uwtable
-define internal void @_GLOBAL__sub_I_t.cpp() #0 !dbg !62 {
+define internal void @_GLOBAL__sub_I_t.cpp() #0 !dbg !63 {
 entry:
-  call void @"\01??__Ep@@YAXXZ"(), !dbg !64
+  call void @"\01??__Ep@@YAXXZ"(), !dbg !65
   ret void
 }
 
@@ -229,72 +230,74 @@ attributes #4 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-
 attributes #5 = { builtin }
 attributes #6 = { nounwind }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!35, !36, !37}
-!llvm.ident = !{!38}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!3 = !{!4}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "p", linkageName: "\01?p@@3PEAUC@@EA", scope: !0, file: !1, line: 13, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !1, line: 9, size: 64, align: 64, elements: !7, vtableHolder: !12, identifier: ".?AUC@@")
-!7 = !{!8, !30, !34}
-!8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9)
-!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !1, line: 5, size: 64, align: 64, elements: !10, vtableHolder: !12, identifier: ".?AUB@@")
-!10 = !{!11, !25, !29}
-!11 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !9, baseType: !12)
-!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 64, align: 64, elements: !13, vtableHolder: !12, identifier: ".?AUA@@")
-!13 = !{!14, !20, !24}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !1, file: !1, baseType: !15, size: 64, flags: DIFlagArtificial)
-!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64)
-!16 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !17, size: 64)
-!17 = !DISubroutineType(types: !18)
-!18 = !{!19}
-!19 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!20 = !DISubprogram(name: "f", linkageName: "\01?f@A@@UEAAXXZ", scope: !12, file: !1, line: 2, type: !21, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !12, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: false)
-!21 = !DISubroutineType(types: !22)
-!22 = !{null, !23}
-!23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!24 = !DISubprogram(name: "g", linkageName: "\01?g@A@@UEAAXXZ", scope: !12, file: !1, line: 3, type: !21, isLocal: false, isDefinition: false, scopeLine: 3, containingType: !12, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 1, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: false)
-!25 = !DISubprogram(name: "f", linkageName: "\01?f@B@@UEAAXXZ", scope: !9, file: !1, line: 6, type: !26, isLocal: false, isDefinition: false, scopeLine: 6, containingType: !9, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
-!26 = !DISubroutineType(types: !27)
-!27 = !{null, !28}
-!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!29 = !DISubprogram(name: "g", linkageName: "\01?g@B@@UEAAXXZ", scope: !9, file: !1, line: 7, type: !26, isLocal: false, isDefinition: false, scopeLine: 7, containingType: !9, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 1, flags: DIFlagPrototyped, isOptimized: false)
-!30 = !DISubprogram(name: "f", linkageName: "\01?f@C@@UEAAXXZ", scope: !6, file: !1, line: 10, type: !31, isLocal: false, isDefinition: false, scopeLine: 10, containingType: !6, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
-!31 = !DISubroutineType(types: !32)
-!32 = !{null, !33}
-!33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!34 = !DISubprogram(name: "g", linkageName: "\01?g@C@@UEAAXXZ", scope: !6, file: !1, line: 11, type: !31, isLocal: false, isDefinition: false, scopeLine: 11, containingType: !6, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 1, flags: DIFlagPrototyped, isOptimized: false)
-!35 = !{i32 2, !"CodeView", i32 1}
-!36 = !{i32 2, !"Debug Info Version", i32 3}
-!37 = !{i32 1, !"PIC Level", i32 2}
-!38 = !{!"clang version 3.9.0 "}
-!39 = distinct !DISubprogram(name: "??__Ep@@YAXXZ", scope: !1, file: !1, line: 13, type: !40, isLocal: true, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!40 = !DISubroutineType(types: !41)
-!41 = !{null}
-!42 = !DILocation(line: 13, column: 8, scope: !39)
-!43 = !DILocation(line: 13, column: 12, scope: !39)
-!44 = distinct !DISubprogram(name: "C", linkageName: "\01??0C@@QEAA@XZ", scope: !6, file: !1, line: 9, type: !31, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !45, variables: !2)
-!45 = !DISubprogram(name: "C", scope: !6, type: !31, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
-!46 = !DILocalVariable(name: "this", arg: 1, scope: !44, type: !5, flags: DIFlagArtificial | DIFlagObjectPointer)
-!47 = !DIExpression()
-!48 = !DILocation(line: 0, scope: !44)
-!49 = !DILocation(line: 9, column: 8, scope: !44)
-!50 = distinct !DISubprogram(name: "B", linkageName: "\01??0B@@QEAA@XZ", scope: !9, file: !1, line: 5, type: !26, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !51, variables: !2)
-!51 = !DISubprogram(name: "B", scope: !9, type: !26, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
-!52 = !DILocalVariable(name: "this", arg: 1, scope: !50, type: !53, flags: DIFlagArtificial | DIFlagObjectPointer)
-!53 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
-!54 = !DILocation(line: 0, scope: !50)
-!55 = !DILocation(line: 5, column: 8, scope: !50)
-!56 = distinct !DISubprogram(name: "A", linkageName: "\01??0A@@QEAA@XZ", scope: !12, file: !1, line: 1, type: !21, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !57, variables: !2)
-!57 = !DISubprogram(name: "A", scope: !12, type: !21, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
-!58 = !DILocalVariable(name: "this", arg: 1, scope: !56, type: !59, flags: DIFlagArtificial | DIFlagObjectPointer)
-!59 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64)
-!60 = !DILocation(line: 0, scope: !56)
-!61 = !DILocation(line: 1, column: 8, scope: !56)
-!62 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_t.cpp", scope: !1, file: !1, type: !63, isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, variables: !2)
-!63 = !DISubroutineType(types: !2)
-!64 = !DILocation(line: 0, scope: !62)
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!36, !37, !38}
+!llvm.ident = !{!39}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "p", linkageName: "\01?p@@3PEAUC@@EA", scope: !2, file: !3, line: 13, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
+!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !3, line: 9, size: 64, align: 64, elements: !8, vtableHolder: !13, identifier: ".?AUC@@")
+!8 = !{!9, !31, !35}
+!9 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !7, baseType: !10)
+!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !3, line: 5, size: 64, align: 64, elements: !11, vtableHolder: !13, identifier: ".?AUB@@")
+!11 = !{!12, !26, !30}
+!12 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !10, baseType: !13)
+!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 64, align: 64, elements: !14, vtableHolder: !13, identifier: ".?AUA@@")
+!14 = !{!15, !21, !25}
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !3, file: !3, baseType: !16, size: 64, flags: DIFlagArtificial)
+!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 64)
+!17 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !18, size: 64)
+!18 = !DISubroutineType(types: !19)
+!19 = !{!20}
+!20 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!21 = !DISubprogram(name: "f", linkageName: "\01?f@A@@UEAAXXZ", scope: !13, file: !3, line: 2, type: !22, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !13, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: false)
+!22 = !DISubroutineType(types: !23)
+!23 = !{null, !24}
+!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!25 = !DISubprogram(name: "g", linkageName: "\01?g@A@@UEAAXXZ", scope: !13, file: !3, line: 3, type: !22, isLocal: false, isDefinition: false, scopeLine: 3, containingType: !13, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 1, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: false)
+!26 = !DISubprogram(name: "f", linkageName: "\01?f@B@@UEAAXXZ", scope: !10, file: !3, line: 6, type: !27, isLocal: false, isDefinition: false, scopeLine: 6, containingType: !10, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
+!27 = !DISubroutineType(types: !28)
+!28 = !{null, !29}
+!29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!30 = !DISubprogram(name: "g", linkageName: "\01?g@B@@UEAAXXZ", scope: !10, file: !3, line: 7, type: !27, isLocal: false, isDefinition: false, scopeLine: 7, containingType: !10, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 1, flags: DIFlagPrototyped, isOptimized: false)
+!31 = !DISubprogram(name: "f", linkageName: "\01?f@C@@UEAAXXZ", scope: !7, file: !3, line: 10, type: !32, isLocal: false, isDefinition: false, scopeLine: 10, containingType: !7, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
+!32 = !DISubroutineType(types: !33)
+!33 = !{null, !34}
+!34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!35 = !DISubprogram(name: "g", linkageName: "\01?g@C@@UEAAXXZ", scope: !7, file: !3, line: 11, type: !32, isLocal: false, isDefinition: false, scopeLine: 11, containingType: !7, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 1, flags: DIFlagPrototyped, isOptimized: false)
+!36 = !{i32 2, !"CodeView", i32 1}
+!37 = !{i32 2, !"Debug Info Version", i32 3}
+!38 = !{i32 1, !"PIC Level", i32 2}
+!39 = !{!"clang version 3.9.0 "}
+!40 = distinct !DISubprogram(name: "??__Ep@@YAXXZ", scope: !3, file: !3, line: 13, type: !41, isLocal: true, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!41 = !DISubroutineType(types: !42)
+!42 = !{null}
+!43 = !DILocation(line: 13, column: 8, scope: !40)
+!44 = !DILocation(line: 13, column: 12, scope: !40)
+!45 = distinct !DISubprogram(name: "C", linkageName: "\01??0C@@QEAA@XZ", scope: !7, file: !3, line: 9, type: !32, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !46, variables: !4)
+!46 = !DISubprogram(name: "C", scope: !7, type: !32, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!47 = !DILocalVariable(name: "this", arg: 1, scope: !45, type: !6, flags: DIFlagArtificial | DIFlagObjectPointer)
+!48 = !DIExpression()
+!49 = !DILocation(line: 0, scope: !45)
+!50 = !DILocation(line: 9, column: 8, scope: !45)
+!51 = distinct !DISubprogram(name: "B", linkageName: "\01??0B@@QEAA@XZ", scope: !10, file: !3, line: 5, type: !27, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !52, variables: !4)
+!52 = !DISubprogram(name: "B", scope: !10, type: !27, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!53 = !DILocalVariable(name: "this", arg: 1, scope: !51, type: !54, flags: DIFlagArtificial | DIFlagObjectPointer)
+!54 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
+!55 = !DILocation(line: 0, scope: !51)
+!56 = !DILocation(line: 5, column: 8, scope: !51)
+!57 = distinct !DISubprogram(name: "A", linkageName: "\01??0A@@QEAA@XZ", scope: !13, file: !3, line: 1, type: !22, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !58, variables: !4)
+!58 = !DISubprogram(name: "A", scope: !13, type: !22, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!59 = !DILocalVariable(name: "this", arg: 1, scope: !57, type: !60, flags: DIFlagArtificial | DIFlagObjectPointer)
+!60 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64)
+!61 = !DILocation(line: 0, scope: !57)
+!62 = !DILocation(line: 1, column: 8, scope: !57)
+!63 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_t.cpp", scope: !3, file: !3, type: !64, isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !2, variables: !4)
+!64 = !DISubroutineType(types: !4)
+!65 = !DILocation(line: 0, scope: !63)
+

+ 65 - 61
test/DebugInfo/COFF/vtable-optzn-array.ll

@@ -40,36 +40,37 @@ target triple = "x86_64-pc-windows-msvc"
 
 $"\01??_DUseCompleteType@@QEAA@XZ" = comdat any
 
-@"\01?force_fwd_decl@@3UGetFwdDecl@@A" = global %struct.GetFwdDecl zeroinitializer, align 1, !dbg !4
-@"\01?require_complete@@3UUseCompleteType@@A" = global %struct.UseCompleteType zeroinitializer, align 8, !dbg !10
+@"\01?force_fwd_decl@@3UGetFwdDecl@@A" = global %struct.GetFwdDecl zeroinitializer, align 1, !dbg !0
+@"\01?require_complete@@3UUseCompleteType@@A" = global %struct.UseCompleteType zeroinitializer, align 8, !dbg !6
 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_t.cpp, i8* null }]
 
 ; Function Attrs: nounwind
-define internal void @"\01??__Erequire_complete@@YAXXZ"() #0 !dbg !25 {
+define internal void @"\01??__Erequire_complete@@YAXXZ"() #0 !dbg !27 {
 entry:
-  %call = call %struct.UseCompleteType* @"\01??0UseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* @"\01?require_complete@@3UUseCompleteType@@A"), !dbg !28
-  %0 = call i32 @atexit(void ()* @"\01??__Frequire_complete@@YAXXZ") #2, !dbg !28
-  ret void, !dbg !28
+  %call = call %struct.UseCompleteType* @"\01??0UseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* @"\01?require_complete@@3UUseCompleteType@@A"), !dbg !30
+  %0 = call i32 @atexit(void ()* @"\01??__Frequire_complete@@YAXXZ") #2, !dbg !30
+  ret void, !dbg !30
 }
 
 declare %struct.UseCompleteType* @"\01??0UseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* returned) unnamed_addr #1
 
 ; Function Attrs: nounwind
-define linkonce_odr void @"\01??_DUseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* %this) unnamed_addr #0 comdat align 2 !dbg !29 {
+define linkonce_odr void @"\01??_DUseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* %this) unnamed_addr #0 comdat align 2 !dbg !31 {
 entry:
   %this.addr = alloca %struct.UseCompleteType*, align 8
   store %struct.UseCompleteType* %this, %struct.UseCompleteType** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.UseCompleteType** %this.addr, metadata !30, metadata !32), !dbg !33
+  call void @llvm.dbg.declare(metadata %struct.UseCompleteType** %this.addr, metadata !32, metadata !34), !dbg !35
   %this1 = load %struct.UseCompleteType*, %struct.UseCompleteType** %this.addr, align 8
-  call void @"\01??1UseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* %this1), !dbg !34
-  ret void, !dbg !34
+  call void @"\01??1UseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* %this1), !dbg !36
+  ret void, !dbg !36
 }
 
 ; Function Attrs: nounwind
-define internal void @"\01??__Frequire_complete@@YAXXZ"() #0 !dbg !35 {
+
+define internal void @"\01??__Frequire_complete@@YAXXZ"() #0 !dbg !37 {
 entry:
-  call void @"\01??_DUseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* @"\01?require_complete@@3UUseCompleteType@@A"), !dbg !36
-  ret void, !dbg !37
+  call void @"\01??_DUseCompleteType@@QEAA@XZ"(%struct.UseCompleteType* @"\01?require_complete@@3UUseCompleteType@@A"), !dbg !38
+  ret void, !dbg !39
 }
 
 ; Function Attrs: nounwind
@@ -81,9 +82,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #3
 declare void @"\01??1UseCompleteType@@QEAA@XZ"(%struct.UseCompleteType*) unnamed_addr #1
 
 ; Function Attrs: nounwind
-define internal void @_GLOBAL__sub_I_t.cpp() #0 !dbg !39 {
+define internal void @_GLOBAL__sub_I_t.cpp() #0 !dbg !41 {
 entry:
-  call void @"\01??__Erequire_complete@@YAXXZ"(), !dbg !41
+  call void @"\01??__Erequire_complete@@YAXXZ"(), !dbg !43
   ret void
 }
 
@@ -92,49 +93,52 @@ attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-
 attributes #2 = { nounwind }
 attributes #3 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!22, !23}
-!llvm.ident = !{!24}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 4.0.0 (trunk 281056) (llvm/trunk 281051)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Cllvm\5Cbuild")
-!2 = !{}
-!3 = !{!4, !10}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "force_fwd_decl", linkageName: "\01?force_fwd_decl@@3UGetFwdDecl@@A", scope: !0, file: !5, line: 5, type: !6, isLocal: false, isDefinition: true))
-!5 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm\5Cbuild")
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GetFwdDecl", file: !5, line: 2, size: 8, align: 8, elements: !7, identifier: ".?AUGetFwdDecl@@")
-!7 = !{!8}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "format", scope: !6, file: !5, line: 3, baseType: !9, flags: DIFlagStaticMember)
-!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "UnicodeString", file: !5, line: 1, flags: DIFlagFwdDecl, identifier: ".?AUUnicodeString@@")
-!10 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "require_complete", linkageName: "\01?require_complete@@3UUseCompleteType@@A", scope: !0, file: !5, line: 15, type: !11, isLocal: false, isDefinition: true))
-!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "UseCompleteType", file: !5, line: 10, size: 64, align: 64, elements: !12, identifier: ".?AUUseCompleteType@@")
-!12 = !{!13, !17, !21}
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "currencySpcAfterSym", scope: !11, file: !5, line: 13, baseType: !14, size: 64, align: 64)
-!14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 64, align: 64, elements: !15)
-!15 = !{!16}
-!16 = !DISubrange(count: 1)
-!17 = !DISubprogram(name: "UseCompleteType", scope: !11, file: !5, line: 11, type: !18, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false)
-!18 = !DISubroutineType(types: !19)
-!19 = !{null, !20}
-!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!21 = !DISubprogram(name: "~UseCompleteType", scope: !11, file: !5, line: 12, type: !18, isLocal: false, isDefinition: false, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false)
-!22 = !{i32 2, !"CodeView", i32 1}
-!23 = !{i32 2, !"Debug Info Version", i32 3}
-!24 = !{!"clang version 4.0.0 (trunk 281056) (llvm/trunk 281051)"}
-!25 = distinct !DISubprogram(name: "??__Erequire_complete@@YAXXZ", scope: !5, file: !5, line: 15, type: !26, isLocal: true, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!26 = !DISubroutineType(types: !27)
-!27 = !{null}
-!28 = !DILocation(line: 15, scope: !25)
-!29 = distinct !DISubprogram(name: "~UseCompleteType", linkageName: "\01??_DUseCompleteType@@QEAA@XZ", scope: !11, file: !5, line: 12, type: !18, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !21, variables: !2)
-!30 = !DILocalVariable(name: "this", arg: 1, scope: !29, type: !31, flags: DIFlagArtificial | DIFlagObjectPointer)
-!31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, align: 64)
-!32 = !DIExpression()
-!33 = !DILocation(line: 0, scope: !29)
-!34 = !DILocation(line: 15, scope: !29)
-!35 = distinct !DISubprogram(name: "??__Frequire_complete@@YAXXZ", scope: !1, file: !1, line: 15, type: !26, isLocal: true, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!36 = !DILocation(line: 15, scope: !35)
-!37 = !DILocation(line: 15, scope: !38)
-!38 = !DILexicalBlockFile(scope: !35, file: !5, discriminator: 0)
-!39 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_t.cpp", scope: !1, file: !1, type: !40, isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, variables: !2)
-!40 = !DISubroutineType(types: !2)
-!41 = !DILocation(line: 0, scope: !39)
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!24, !25}
+!llvm.ident = !{!26}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "force_fwd_decl", linkageName: "\01?force_fwd_decl@@3UGetFwdDecl@@A", scope: !2, file: !8, line: 5, type: !21, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 4.0.0 (trunk 281056) (llvm/trunk 281051)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0, !6}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "require_complete", linkageName: "\01?require_complete@@3UUseCompleteType@@A", scope: !2, file: !8, line: 15, type: !9, isLocal: false, isDefinition: true)
+!8 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm\5Cbuild")
+!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "UseCompleteType", file: !8, line: 10, size: 64, align: 64, elements: !10, identifier: ".?AUUseCompleteType@@")
+!10 = !{!11, !16, !20}
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "currencySpcAfterSym", scope: !9, file: !8, line: 13, baseType: !12, size: 64, align: 64)
+!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 64, align: 64, elements: !14)
+!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "UnicodeString", file: !8, line: 1, flags: DIFlagFwdDecl, identifier: ".?AUUnicodeString@@")
+!14 = !{!15}
+!15 = !DISubrange(count: 1)
+!16 = !DISubprogram(name: "UseCompleteType", scope: !9, file: !8, line: 11, type: !17, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false)
+!17 = !DISubroutineType(types: !18)
+!18 = !{null, !19}
+!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!20 = !DISubprogram(name: "~UseCompleteType", scope: !9, file: !8, line: 12, type: !17, isLocal: false, isDefinition: false, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false)
+!21 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GetFwdDecl", file: !8, line: 2, size: 8, align: 8, elements: !22, identifier: ".?AUGetFwdDecl@@")
+!22 = !{!23}
+!23 = !DIDerivedType(tag: DW_TAG_member, name: "format", scope: !21, file: !8, line: 3, baseType: !13, flags: DIFlagStaticMember)
+!24 = !{i32 2, !"CodeView", i32 1}
+!25 = !{i32 2, !"Debug Info Version", i32 3}
+!26 = !{!"clang version 4.0.0 (trunk 281056) (llvm/trunk 281051)"}
+!27 = distinct !DISubprogram(name: "??__Erequire_complete@@YAXXZ", scope: !8, file: !8, line: 15, type: !28, isLocal: true, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!28 = !DISubroutineType(types: !29)
+!29 = !{null}
+!30 = !DILocation(line: 15, scope: !27)
+!31 = distinct !DISubprogram(name: "~UseCompleteType", linkageName: "\01??_DUseCompleteType@@QEAA@XZ", scope: !9, file: !8, line: 12, type: !17, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !20, variables: !4)
+!32 = !DILocalVariable(name: "this", arg: 1, scope: !31, type: !33, flags: DIFlagArtificial | DIFlagObjectPointer)
+!33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
+!34 = !DIExpression()
+!35 = !DILocation(line: 0, scope: !31)
+!36 = !DILocation(line: 15, scope: !31)
+!37 = distinct !DISubprogram(name: "??__Frequire_complete@@YAXXZ", scope: !3, file: !3, line: 15, type: !28, isLocal: true, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!38 = !DILocation(line: 15, scope: !37)
+!39 = !DILocation(line: 15, scope: !40)
+!40 = !DILexicalBlockFile(scope: !37, file: !8, discriminator: 0)
+!41 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_t.cpp", scope: !3, file: !3, type: !42, isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !2, variables: !4)
+!42 = !DISubroutineType(types: !4)
+!43 = !DILocation(line: 0, scope: !41)
+

+ 19 - 14
test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll

@@ -1,25 +1,30 @@
 ; RUN: llc %s -o /dev/null
 ; Here variable bar is optimized away. Do not trip over while trying to generate debug info.
 
+source_filename = "test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll"
 
-define i32 @foo() nounwind uwtable readnone ssp !dbg !5 {
+; Function Attrs: nounwind readnone ssp uwtable
+define i32 @foo() #0 !dbg !6 {
 entry:
-  ret i32 42, !dbg !15
+  ret i32 42, !dbg !11
 }
 
+attributes #0 = { nounwind readnone ssp uwtable }
+
 !llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!18}
+!llvm.module.flags = !{!10}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: FullDebug, file: !17, enums: !1, retainedTypes: !1, globals: !12)
-!1 = !{}
-!5 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, file: !17, scope: !6, type: !7)
-!6 = !DIFile(filename: "fb.c", directory: "/private/tmp")
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3)
+!1 = !DIFile(filename: "fb.c", directory: "/private/tmp")
+!2 = !{}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "bar", scope: !6, file: !1, line: 2, type: !9, isLocal: true, isDefinition: true)
+!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0)
 !7 = !DISubroutineType(types: !8)
 !8 = !{!9}
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!12 = !{!14}
-!14 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "bar", line: 2, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !9))
-!15 = !DILocation(line: 3, column: 3, scope: !16)
-!16 = distinct !DILexicalBlock(line: 1, column: 11, file: !17, scope: !5)
-!17 = !DIFile(filename: "fb.c", directory: "/private/tmp")
-!18 = !{i32 1, !"Debug Info Version", i32 3}
+!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!10 = !{i32 1, !"Debug Info Version", i32 3}
+!11 = !DILocation(line: 3, column: 3, scope: !12)
+!12 = distinct !DILexicalBlock(scope: !6, file: !1, line: 1, column: 11)
+

+ 13 - 11
test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll

@@ -1,14 +1,16 @@
 ; RUN: llc %s -o /dev/null
-@0 = internal constant i32 1, !dbg !5
+source_filename = "test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll"
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!9}
+@0 = internal constant i32 1, !dbg !0
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: FullDebug, file: !8, enums: !2, retainedTypes: !2, globals: !3)
-!2 = !{}
-!3 = !{!5}
-!5 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7))
-!6 = !DIFile(filename: "g.c", directory: "/private/tmp")
-!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!8 = !DIFile(filename: "g.c", directory: "/private/tmp")
-!9 = !{i32 1, !"Debug Info Version", i32 3}
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "g.c", directory: "/private/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}

+ 50 - 46
test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll

@@ -5,56 +5,60 @@
 ; CHECK:	DW_TAG_structure_type
 ; CHECK-NEXT:	DW_AT_name
 
+source_filename = "test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll"
 
-@i = common global i32 0, !dbg !16                          ; <i32*> [#uses=2]
+@i = common global i32 0, !dbg !0
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
 
-define i32 @bar() nounwind ssp !dbg !6 {
+; Function Attrs: nounwind ssp
+define i32 @bar() #1 !dbg !8 {
 entry:
-  %0 = load i32, i32* @i, align 4, !dbg !17            ; <i32> [#uses=2]
-  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19
-  tail call void @llvm.dbg.declare(metadata !29, metadata !60, metadata !DIExpression()), !dbg !21
-  %1 = mul nsw i32 %0, %0, !dbg !22               ; <i32> [#uses=2]
-  store i32 %1, i32* @i, align 4, !dbg !17
-  ret i32 %1, !dbg !23
+  %0 = load i32, i32* @i, align 4, !dbg !11
+  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !13, metadata !24), !dbg !25
+  tail call void @llvm.dbg.declare(metadata !5, metadata !18, metadata !24), !dbg !26
+  %1 = mul nsw i32 %0, %0, !dbg !27
+  store i32 %1, i32* @i, align 4, !dbg !11
+  ret i32 %1, !dbg !28
 }
 
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!28}
-
-!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: 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, 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)
-!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-
-!59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
-!60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-
-!11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
-!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
-!13 = !{!14, !15}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
-!15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5))
-!17 = !DILocation(line: 15, scope: !18)
-!18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
-!19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
-!20 = !{}
-!21 = !DILocation(line: 9, scope: !11, inlinedAt: !17)
-!22 = !DILocation(line: 11, scope: !11, inlinedAt: !17)
-!23 = !DILocation(line: 16, scope: !18)
-!24 = !{!9, !10}
-!26 = !{!16}
-!27 = !DIFile(filename: "bar.c", directory: "/tmp/")
-!28 = !{i32 1, !"Debug Info Version", i32 3}
-!29 = !{null}
+attributes #0 = { nounwind readnone }
+attributes #1 = { nounwind ssp }
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "i", scope: !2, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "bar.c", directory: "/tmp/")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+!8 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: !2, file: !2, line: 14, type: !9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !4)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!3}
+!11 = !DILocation(line: 15, scope: !12)
+!12 = distinct !DILexicalBlock(scope: !8, file: !2, line: 14)
+!13 = !DILocalVariable(name: "j", arg: 1, scope: !14, file: !2, line: 9, type: !3)
+!14 = distinct !DISubprogram(name: "foo", scope: !2, file: !2, line: 9, type: !15, isLocal: true, isDefinition: true, scopeLine: 9, virtualIndex: 6, isOptimized: true, unit: !4, variables: !17)
+!15 = !DISubroutineType(types: !16)
+!16 = !{!3, !3}
+!17 = !{!13, !18}
+!18 = !DILocalVariable(name: "xyz", scope: !19, file: !2, line: 10, type: !20)
+!19 = distinct !DILexicalBlock(scope: !14, file: !2, line: 9)
+!20 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !14, file: !2, line: 10, size: 64, align: 32, elements: !21)
+!21 = !{!22, !23}
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32)
+!23 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32, offset: 32)
+!24 = !DIExpression()
+!25 = !DILocation(line: 9, scope: !14, inlinedAt: !11)
+!26 = !DILocation(line: 9, scope: !19, inlinedAt: !11)
+!27 = !DILocation(line: 11, scope: !19, inlinedAt: !11)
+!28 = !DILocation(line: 16, scope: !12)
+

+ 49 - 36
test/DebugInfo/Generic/accel-table-hash-collisions.ll

@@ -50,43 +50,56 @@
 ; CHECK:    Name: {{[0-9a-f]*}} "setStmt"
 ; CHECK:    Name: {{[0-9a-f]*}} "_ZN4llvm5TwineC1Ei"
 
+source_filename = "test/DebugInfo/Generic/accel-table-hash-collisions.ll"
 
-
-@ForceTopDown = common global i32 0, align 4, !dbg !4
+@ForceTopDown = common global i32 0, align 4, !dbg !0
 @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_ = common global i32 0, align 4, !dbg !6
-@_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE = common global i32 0, align 4, !dbg !7
-@_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv = common global i32 0, align 4, !dbg !8
-@_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE = common global i32 0, align 4, !dbg !9
-@_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE = common global i32 0, align 4, !dbg !10
-@k1 = common global i32 0, align 4, !dbg !11
-@is = common global i32 0, align 4, !dbg !12
-@setStmt = common global i32 0, align 4, !dbg !13
-@_ZN4llvm5TwineC1Ei = common global i32 0, align 4, !dbg !14
-@_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE = common global i32 0, align 4, !dbg !15
-@_ZN4llvm22MachineModuleInfoMachOD2Ev = common global i32 0, align 4, !dbg !16
+@_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE = common global i32 0, align 4, !dbg !9
+@_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv = common global i32 0, align 4, !dbg !11
+@_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE = common global i32 0, align 4, !dbg !13
+@_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE = common global i32 0, align 4, !dbg !15
+@k1 = common global i32 0, align 4, !dbg !17
+@is = common global i32 0, align 4, !dbg !19
+@setStmt = common global i32 0, align 4, !dbg !21
+@_ZN4llvm5TwineC1Ei = common global i32 0, align 4, !dbg !23
+@_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE = common global i32 0, align 4, !dbg !25
+@_ZN4llvm22MachineModuleInfoMachOD2Ev = common global i32 0, align 4, !dbg !27
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!29, !30, !31}
+!llvm.ident = !{!32}
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!17, !18, !19}
-!llvm.ident = !{!20}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "ForceTopDown", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "hash-collisions.c", directory: "/tmp")
+!4 = !{}
+!5 = !{!0, !6, !9, !11, !13, !15, !17, !19, !21, !23, !25, !27}
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = !DIGlobalVariableExpression(var: !10)
+!10 = !DIGlobalVariable(name: "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE", scope: !2, file: !3, line: 3, type: !8, isLocal: false, isDefinition: true)
+!11 = !DIGlobalVariableExpression(var: !12)
+!12 = !DIGlobalVariable(name: "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
+!13 = !DIGlobalVariableExpression(var: !14)
+!14 = !DIGlobalVariable(name: "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE", scope: !2, file: !3, line: 5, type: !8, isLocal: false, isDefinition: true)
+!15 = !DIGlobalVariableExpression(var: !16)
+!16 = !DIGlobalVariable(name: "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE", scope: !2, file: !3, line: 6, type: !8, isLocal: false, isDefinition: true)
+!17 = !DIGlobalVariableExpression(var: !18)
+!18 = !DIGlobalVariable(name: "k1", scope: !2, file: !3, line: 7, type: !8, isLocal: false, isDefinition: true)
+!19 = !DIGlobalVariableExpression(var: !20)
+!20 = !DIGlobalVariable(name: "is", scope: !2, file: !3, line: 8, type: !8, isLocal: false, isDefinition: true)
+!21 = !DIGlobalVariableExpression(var: !22)
+!22 = !DIGlobalVariable(name: "setStmt", scope: !2, file: !3, line: 9, type: !8, isLocal: false, isDefinition: true)
+!23 = !DIGlobalVariableExpression(var: !24)
+!24 = !DIGlobalVariable(name: "_ZN4llvm5TwineC1Ei", scope: !2, file: !3, line: 10, type: !8, isLocal: false, isDefinition: true)
+!25 = !DIGlobalVariableExpression(var: !26)
+!26 = !DIGlobalVariable(name: "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE", scope: !2, file: !3, line: 11, type: !8, isLocal: false, isDefinition: true)
+!27 = !DIGlobalVariableExpression(var: !28)
+!28 = !DIGlobalVariable(name: "_ZN4llvm22MachineModuleInfoMachOD2Ev", scope: !2, file: !3, line: 12, type: !8, isLocal: false, isDefinition: true)
+!29 = !{i32 2, !"Dwarf Version", i32 2}
+!30 = !{i32 2, !"Debug Info Version", i32 3}
+!31 = !{i32 1, !"PIC Level", i32 2}
+!32 = !{!"clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)"}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "hash-collisions.c", directory: "/tmp")
-!2 = !{}
-!3 = !{!4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ForceTopDown", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true))
-!7 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true))
-!8 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true))
-!9 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true))
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true))
-!11 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "k1", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true))
-!12 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "is", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true))
-!13 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "setStmt", scope: !0, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true))
-!14 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZN4llvm5TwineC1Ei", scope: !0, file: !1, line: 10, type: !5, isLocal: false, isDefinition: true))
-!15 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE", scope: !0, file: !1, line: 11, type: !5, isLocal: false, isDefinition: true))
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "_ZN4llvm22MachineModuleInfoMachOD2Ev", scope: !0, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true))
-!17 = !{i32 2, !"Dwarf Version", i32 2}
-!18 = !{i32 2, !"Debug Info Version", i32 3}
-!19 = !{i32 1, !"PIC Level", i32 2}
-!20 = !{!"clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)"}

+ 36 - 33
test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll

@@ -37,17 +37,19 @@
 ; CHECK:     DW_AT_name {{.*}}"a.cpp"
 ; CHECK:     DW_AT_name {{.*}} "func"
 
-@x = global i32 (i32)* @_Z4funci, align 8, !dbg !10
-@y = global i32 (i32)* @_Z4funci, align 8, !dbg !18
+source_filename = "test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll"
+
+@x = global i32 (i32)* @_Z4funci, align 8, !dbg !0
+@y = global i32 (i32)* @_Z4funci, align 8, !dbg !7
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !4 {
+define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !18 {
   %1 = alloca i32, align 4
   store i32 %i, i32* %1, align 4
-  call void @llvm.dbg.declare(metadata i32* %1, metadata !22, metadata !DIExpression()), !dbg !23
-  %2 = load i32, i32* %1, align 4, !dbg !24
-  %3 = mul nsw i32 %2, 2, !dbg !24
-  ret i32 %3, !dbg !24
+  call void @llvm.dbg.declare(metadata i32* %1, metadata !19, metadata !20), !dbg !21
+  %2 = load i32, i32* %1, align 4, !dbg !22
+  %3 = mul nsw i32 %2, 2, !dbg !22
+  ret i32 %3, !dbg !22
 }
 
 ; Function Attrs: nounwind readnone
@@ -56,30 +58,31 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 attributes #0 = { inlinehint nounwind uwtable }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!12, !0}
-!llvm.module.flags = !{!19, !20}
-!llvm.ident = !{!21, !21}
+!llvm.dbg.cu = !{!10, !13}
+!llvm.module.flags = !{!15, !16}
+!llvm.ident = !{!17, !17}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
+!3 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)
+!4 = !DISubroutineType(types: !5)
+!5 = !{!6, !6}
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DIGlobalVariableExpression(var: !8)
+!8 = !DIGlobalVariable(name: "y", scope: null, file: !9, line: 4, type: !3, isLocal: false, isDefinition: true)
+!9 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
+!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !9, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !12, imports: !11)
+!11 = !{}
+!12 = !{!7}
+!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !14, imports: !11)
+!14 = !{!0}
+!15 = !{i32 2, !"Dwarf Version", i32 4}
+!16 = !{i32 1, !"Debug Info Version", i32 3}
+!17 = !{!"clang version 3.5.0 "}
+!18 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", scope: !2, file: !2, line: 1, type: !4, isLocal: false, isDefinition: true, scopeLine: 1, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !13, variables: !11)
+!19 = !DILocalVariable(name: "i", arg: 1, scope: !18, file: !2, line: 1, type: !6)
+!20 = !DIExpression()
+!21 = !DILocation(line: 1, scope: !18)
+!22 = !DILocation(line: 2, scope: !18)
 
-!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: !9, imports: !2)
-!1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", 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: "a.cpp", directory: "/tmp/dbginfo")
-!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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !11))
-!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6)
-!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !13, enums: !2, retainedTypes: !2, globals: !17, imports: !2)
-!13 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
-!15 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !12, scopeLine: 1, file: !13, scope: !16, type: !6, variables: !2)
-!16 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
-!17 = !{!18}
-!18 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !11))
-!19 = !{i32 2, !"Dwarf Version", i32 4}
-!20 = !{i32 1, !"Debug Info Version", i32 3}
-!21 = !{!"clang version 3.5.0 "}
-!22 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8)
-!23 = !DILocation(line: 1, scope: !4)
-!24 = !DILocation(line: 2, scope: !4)

+ 36 - 32
test/DebugInfo/Generic/cross-cu-linkonce.ll

@@ -25,17 +25,19 @@
 ; CHECK: DW_TAG_compile_unit
 ; CHECK-NOT: DW_TAG_subprogram
 
-@x = global i32 (i32)* @_Z4funci, align 8, !dbg !11
-@y = global i32 (i32)* @_Z4funci, align 8, !dbg !16
+source_filename = "test/DebugInfo/Generic/cross-cu-linkonce.ll"
+
+@x = global i32 (i32)* @_Z4funci, align 8, !dbg !0
+@y = global i32 (i32)* @_Z4funci, align 8, !dbg !7
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !4 {
+define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !19 {
   %1 = alloca i32, align 4
   store i32 %i, i32* %1, align 4
-  call void @llvm.dbg.declare(metadata i32* %1, metadata !20, metadata !DIExpression()), !dbg !21
-  %2 = load i32, i32* %1, align 4, !dbg !22
-  %3 = mul nsw i32 %2, 2, !dbg !22
-  ret i32 %3, !dbg !22
+  call void @llvm.dbg.declare(metadata i32* %1, metadata !20, metadata !21), !dbg !22
+  %2 = load i32, i32* %1, align 4, !dbg !23
+  %3 = mul nsw i32 %2, 2, !dbg !23
+  ret i32 %3, !dbg !23
 }
 
 ; Function Attrs: nounwind readnone
@@ -44,30 +46,32 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 attributes #0 = { inlinehint nounwind uwtable "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0, !13}
-!llvm.module.flags = !{!17, !18}
-!llvm.ident = !{!19, !19}
+!llvm.dbg.cu = !{!9, !13}
+!llvm.module.flags = !{!16, !17}
+!llvm.ident = !{!18, !18}
 
-!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: !10, imports: !2)
-!1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", 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: "func.h", directory: "/tmp/dbginfo")
-!6 = !DIFile(filename: "func.h", directory: "/tmp/dbginfo")
-!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 = !{!11}
-!11 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12))
-!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !7)
-!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !14, enums: !2, retainedTypes: !2, globals: !15, imports: !2)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "func.h", directory: "/tmp/dbginfo")
+!3 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)
+!4 = !DISubroutineType(types: !5)
+!5 = !{!6, !6}
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DIGlobalVariableExpression(var: !8)
+!8 = !DIGlobalVariable(name: "y", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !10, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !12, imports: !11)
+!10 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
+!11 = !{}
+!12 = !{!0}
+!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !14, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !15, imports: !11)
 !14 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
-!15 = !{!16}
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12))
-!17 = !{i32 2, !"Dwarf Version", i32 4}
-!18 = !{i32 1, !"Debug Info Version", i32 3}
-!19 = !{!"clang version 3.5.0 "}
-!20 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !6, type: !9)
-!21 = !DILocation(line: 1, scope: !4)
-!22 = !DILocation(line: 2, scope: !4)
-!24 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !13, scopeLine: 1, file: !5, scope: !6, type: !7, variables: !2)
+!15 = !{!7}
+!16 = !{i32 2, !"Dwarf Version", i32 4}
+!17 = !{i32 1, !"Debug Info Version", i32 3}
+!18 = !{!"clang version 3.5.0 "}
+!19 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", scope: !2, file: !2, line: 1, type: !4, isLocal: false, isDefinition: true, scopeLine: 1, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !9, variables: !11)
+!20 = !DILocalVariable(name: "i", arg: 1, scope: !19, file: !2, line: 1, type: !6)
+!21 = !DIExpression()
+!22 = !DILocation(line: 1, scope: !19)
+!23 = !DILocation(line: 2, scope: !19)
+

+ 16 - 14
test/DebugInfo/Generic/dbg-at-specficiation.ll

@@ -3,19 +3,21 @@
 ; Do not unnecessarily use AT_specification DIE.
 ; CHECK-NOT: AT_specification
 
-@a = common global [10 x i32] zeroinitializer, align 16, !dbg !5
+source_filename = "test/DebugInfo/Generic/dbg-at-specficiation.ll"
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!12}
+@a = common global [10 x i32] zeroinitializer, align 16, !dbg !0
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 140253)", isOptimized: true, emissionKind: FullDebug, file: !11, enums: !2, retainedTypes: !2, globals: !3)
-!2 = !{}
-!3 = !{!5}
-!5 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7))
-!6 = !DIFile(filename: "x.c", directory: "/private/tmp")
-!7 = !DICompositeType(tag: DW_TAG_array_type, size: 320, align: 32, baseType: !8, elements: !9)
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !{!10}
-!10 = !DISubrange(count: 10)
-!11 = !DIFile(filename: "x.c", directory: "/private/tmp")
-!12 = !{i32 1, !"Debug Info Version", i32 3}
+!llvm.dbg.cu = !{!7}
+!llvm.module.flags = !{!10}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "x.c", directory: "/private/tmp")
+!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 320, align: 32, elements: !5)
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = !{!6}
+!6 = !DISubrange(count: 10)
+!7 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.0 (trunk 140253)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !8, retainedTypes: !8, globals: !9)
+!8 = !{}
+!9 = !{!0}
+!10 = !{i32 1, !"Debug Info Version", i32 3}

+ 22 - 21
test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll

@@ -1,6 +1,5 @@
 ; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
 
-
 ; This module is generated from the following c-code:
 ;
 ; > union X;
@@ -11,32 +10,34 @@
 ; >
 ; > struct Y y;
 
-
 ; CHECK: Type: Y from /tmp/minimal.c:3 DW_TAG_structure_type
 ; CHECK: Type: x from /tmp/minimal.c:4 DW_TAG_member
 ; CHECK: Type: DW_TAG_pointer_type
 ; CHECK: Type: X from /tmp/minimal.c:1 DW_TAG_structure_type
 
+source_filename = "test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll"
 
 %struct.Y = type { %struct.X* }
 %struct.X = type opaque
 
-@y = common global %struct.Y zeroinitializer, align 8, !dbg !4
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!10, !11}
-!llvm.ident = !{!12}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "minimal.c", directory: "/tmp")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "y", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true))
-!5 = !DICompositeType(tag: DW_TAG_structure_type, name: "Y", file: !1, line: 3, size: 64, align: 64, elements: !6)
-!6 = !{!7}
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !5, file: !1, line: 4, baseType: !8, size: 64, align: 64)
-!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
-!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", file: !1, line: 1, flags: DIFlagFwdDecl)
-!10 = !{i32 2, !"Dwarf Version", i32 4}
-!11 = !{i32 2, !"Debug Info Version", i32 3}
-!12 = !{!"clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)"}
+@y = common global %struct.Y zeroinitializer, align 8, !dbg !0
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!11, !12}
+!llvm.ident = !{!13}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "y", scope: !2, file: !3, line: 7, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "minimal.c", directory: "/tmp")
+!4 = !{}
+!5 = !{!0}
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "Y", file: !3, line: 3, size: 64, align: 64, elements: !7)
+!7 = !{!8}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !3, line: 4, baseType: !9, size: 64, align: 64)
+!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
+!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", file: !3, line: 1, flags: DIFlagFwdDecl)
+!11 = !{i32 2, !"Dwarf Version", i32 4}
+!12 = !{i32 2, !"Debug Info Version", i32 3}
+!13 = !{!"clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)"}
+

+ 65 - 56
test/DebugInfo/Generic/dwarf-public-names.ll

@@ -49,82 +49,91 @@
 ; CHECK-DAG: "C::static_member_variable"
 ; CHECK-DAG: "C::member_function"
 
+source_filename = "test/DebugInfo/Generic/dwarf-public-names.ll"
+
 %struct.C = type { i8 }
 
-@_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !25
-@global_variable = global %struct.C zeroinitializer, align 1, !dbg !26
-@_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !27
+@_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !0
+@global_variable = global %struct.C zeroinitializer, align 1, !dbg !15
+@_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !17
 
-define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 !dbg !3 {
+; Function Attrs: nounwind uwtable
+define void @_ZN1C15member_functionEv(%struct.C* %this) #0 align 2 !dbg !23 {
 entry:
   %this.addr = alloca %struct.C*, align 8
   store %struct.C* %this, %struct.C** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !28, metadata !DIExpression()), !dbg !30
+  call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !24, metadata !26), !dbg !27
   %this1 = load %struct.C*, %struct.C** %this.addr
-  store i32 0, i32* @_ZN1C22static_member_variableE, align 4, !dbg !31
-  ret void, !dbg !32
+  store i32 0, i32* @_ZN1C22static_member_variableE, align 4, !dbg !28
+  ret void, !dbg !29
 }
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
-define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 !dbg !18 {
+; Function Attrs: nounwind uwtable
+define i32 @_ZN1C22static_member_functionEv() #0 align 2 !dbg !30 {
 entry:
-  %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !33
-  ret i32 %0, !dbg !33
+  %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !31
+  ret i32 %0, !dbg !31
 }
 
-define i32 @_Z15global_functionv() nounwind uwtable !dbg !19 {
+; Function Attrs: nounwind uwtable
+define i32 @_Z15global_functionv() #0 !dbg !32 {
 entry:
-  ret i32 -1, !dbg !34
+  ret i32 -1, !dbg !33
 }
 
-define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable !dbg !20 {
+; Function Attrs: nounwind uwtable
+define void @_ZN2ns25global_namespace_functionEv() #0 !dbg !34 {
 entry:
-  call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !35
-  ret void, !dbg !36
+  call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !37
+  ret void, !dbg !38
 }
 
 attributes #0 = { nounwind uwtable }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!38}
+!llvm.dbg.cu = !{!20}
+!llvm.module.flags = !{!22}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !2, file: !3, line: 7, type: !6, isLocal: false, isDefinition: true, declaration: !5)
+!2 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !3, line: 1, size: 8, align: 8, elements: !4)
+!3 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")
+!4 = !{!5, !7, !12}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", scope: !2, file: !3, line: 4, baseType: !6, flags: DIFlagStaticMember)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: false, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, variables: !11)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10}
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !2, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!11 = !{}
+!12 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !2, file: !3, line: 3, type: !13, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, variables: !11)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!6}
+!15 = !DIGlobalVariableExpression(var: !16)
+!16 = !DIGlobalVariable(name: "global_variable", scope: null, file: !3, line: 17, type: !2, isLocal: false, isDefinition: true) ; previously: invalid DW_TAG_base_type
+!17 = !DIGlobalVariableExpression(var: !18)
+!18 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !19, file: !3, line: 27, type: !6, isLocal: false, isDefinition: true)
+!19 = !DINamespace(name: "ns", scope: null, file: !3, line: 23)
+!20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !21, imports: !11) ; previously: invalid DW_TAG_base_type
+!21 = !{!0, !15, !17}
+!22 = !{i32 1, !"Debug Info Version", i32 3}
+!23 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: null, file: !3, line: 9, type: !8, isLocal: false, isDefinition: true, scopeLine: 9, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, declaration: !7, variables: !11)
+!24 = !DILocalVariable(name: "this", arg: 1, scope: !23, file: !3, line: 9, type: !25, flags: DIFlagArtificial | DIFlagObjectPointer)
+!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !2, size: 64, align: 64)
+!26 = !DIExpression()
+!27 = !DILocation(line: 9, scope: !23)
+!28 = !DILocation(line: 10, scope: !23)
+!29 = !DILocation(line: 11, scope: !23)
+!30 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: null, file: !3, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, declaration: !12, variables: !11)
+!31 = !DILocation(line: 14, scope: !30)
+!32 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !3, file: !3, line: 19, type: !13, isLocal: false, isDefinition: true, scopeLine: 19, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, variables: !11)
+!33 = !DILocation(line: 20, scope: !32)
+!34 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !19, file: !3, line: 24, type: !35, isLocal: false, isDefinition: true, scopeLine: 24, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, variables: !11)
+!35 = !DISubroutineType(types: !36)
+!36 = !{null}
+!37 = !DILocation(line: 25, scope: !34)
+!38 = !DILocation(line: 26, scope: !34)
 
-!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 = !{}
-!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}
-!7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8)
-!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, size: 8, align: 8, file: !37, elements: !9)
-!9 = !{!10, !12, !14}
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", line: 4, flags: DIFlagStaticMember, file: !37, scope: !8, baseType: !11)
-!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!12 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !4, scope: !8, type: !5, variables: !13)
-!13 = !{} ; previously: invalid DW_TAG_base_type
-!14 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !4, scope: !8, type: !15, variables: !17)
-!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, 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}
-!24 = !{!25, !26, !27}
-!25 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, declaration: !10))
-!26 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8))
-!27 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11))
-!28 = !DILocalVariable(name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29)
-!29 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
-!30 = !DILocation(line: 9, scope: !3)
-!31 = !DILocation(line: 10, scope: !3)
-!32 = !DILocation(line: 11, scope: !3)
-!33 = !DILocation(line: 14, scope: !18)
-!34 = !DILocation(line: 20, scope: !19)
-!35 = !DILocation(line: 25, scope: !20)
-!36 = !DILocation(line: 26, scope: !20)
-!37 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")
-!38 = !{i32 1, !"Debug Info Version", i32 3}

+ 34 - 30
test/DebugInfo/Generic/enum.ll

@@ -33,15 +33,17 @@
 ; CHECK: DW_TAG_enumerator
 ; CHECK-NEXT: DW_AT_name{{.*}} = "X"
 
-@a = global i64 0, align 8, !dbg !18
+source_filename = "test/DebugInfo/Generic/enum.ll"
+
+@a = global i64 0, align 8, !dbg !0
 
 ; Function Attrs: nounwind uwtable
-define void @_Z4funcv() #0 !dbg !13 {
+define void @_Z4funcv() #0 !dbg !17 {
 entry:
   %b = alloca i32, align 4
-  call void @llvm.dbg.declare(metadata i32* %b, metadata !20, metadata !DIExpression()), !dbg !22
-  store i32 0, i32* %b, align 4, !dbg !22
-  ret void, !dbg !23
+  call void @llvm.dbg.declare(metadata i32* %b, metadata !20, metadata !22), !dbg !23
+  store i32 0, i32* %b, align 4, !dbg !23
+  ret void, !dbg !24
 }
 
 ; Function Attrs: nounwind readnone
@@ -50,30 +52,32 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 attributes #0 = { nounwind uwtable "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!19, !24}
+!llvm.dbg.cu = !{!8}
+!llvm.module.flags = !{!15, !16}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !11, globals: !17, imports: !11)
-!1 = !DIFile(filename: "enum.cpp", directory: "/tmp")
-!2 = !{!3, !8}
-!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e1", line: 1, size: 64, align: 64, file: !1, elements: !4)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "enum.cpp", directory: "/tmp")
+!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e1", file: !2, line: 1, size: 64, align: 64, elements: !4)
 !4 = !{!5, !6, !7}
-!5 = !DIEnumerator(name: "I", value: 0) ; [ DW_TAG_enumerator ] [I :: 0]
-!6 = !DIEnumerator(name: "J", value: 4294967295) ; [ DW_TAG_enumerator ] [J :: 4294967295]
-!7 = !DIEnumerator(name: "K", value: -1152921504606846976) ; [ DW_TAG_enumerator ] [K :: 17293822569102704640]
-!8 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e2", line: 2, size: 32, align: 32, file: !1, elements: !9)
-!9 = !{!10}
-!10 = !DIEnumerator(name: "X", value: 0) ; [ DW_TAG_enumerator ] [X :: 0]
-!11 = !{}
-!13 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !14, type: !15, variables: !11)
-!14 = !DIFile(filename: "enum.cpp", directory: "/tmp")
-!15 = !DISubroutineType(types: !16)
-!16 = !{null}
-!17 = !{!18}
-!18 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !3))
-!19 = !{i32 2, !"Dwarf Version", i32 3}
-!20 = !DILocalVariable(name: "b", line: 4, scope: !13, file: !14, type: !21)
-!21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!22 = !DILocation(line: 4, scope: !13)
-!23 = !DILocation(line: 5, scope: !13)
-!24 = !{i32 1, !"Debug Info Version", i32 3}
+!5 = !DIEnumerator(name: "I", value: 0)
+!6 = !DIEnumerator(name: "J", value: 4294967295) ; [ DW_TAG_enumerator ] [I :: 0]
+!7 = !DIEnumerator(name: "K", value: -1152921504606846976) ; [ DW_TAG_enumerator ] [J :: 4294967295]
+!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !13, globals: !14, imports: !13) ; [ DW_TAG_enumerator ] [K :: 17293822569102704640]
+!9 = !{!3, !10}
+!10 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e2", file: !2, line: 2, size: 32, align: 32, elements: !11)
+!11 = !{!12}
+!12 = !DIEnumerator(name: "X", value: 0) ; [ DW_TAG_enumerator ] [X :: 0]
+!13 = !{}
+!14 = !{!0}
+!15 = !{i32 2, !"Dwarf Version", i32 3}
+!16 = !{i32 1, !"Debug Info Version", i32 3}
+!17 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", scope: !2, file: !2, line: 3, type: !18, isLocal: false, isDefinition: true, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !8, variables: !13)
+!18 = !DISubroutineType(types: !19)
+!19 = !{null}
+!20 = !DILocalVariable(name: "b", scope: !17, file: !2, line: 4, type: !21)
+!21 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!22 = !DIExpression()
+!23 = !DILocation(line: 4, scope: !17)
+!24 = !DILocation(line: 5, scope: !17)
+

+ 16 - 13
test/DebugInfo/Generic/global.ll

@@ -15,8 +15,10 @@
 ; CHECK: debug_info contents
 ; CHECK: DW_TAG_variable
 
+source_filename = "test/DebugInfo/Generic/global.ll"
+
 ; Function Attrs: nounwind readnone uwtable
-define i32 @main() #0 !dbg !4 {
+define i32 @main() #0 !dbg !9 {
 entry:
   ret i32 0, !dbg !12
 }
@@ -24,18 +26,19 @@ entry:
 attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
 
 !llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!11, !13}
+!llvm.module.flags = !{!7, !8}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !9, imports: !2)
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.4 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
 !1 = !DIFile(filename: "global.cpp", directory: "/tmp")
 !2 = !{}
-!4 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
-!5 = !DIFile(filename: "global.cpp", directory: "/tmp")
-!6 = !DISubroutineType(types: !7)
-!7 = !{!8}
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !{!10}
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", linkageName: "_ZL1i", line: 1, isLocal: true, isDefinition: true, scope: null, file: !5, type: !8))
-!11 = !{i32 2, !"Dwarf Version", i32 3}
-!12 = !DILocation(line: 4, scope: !4)
-!13 = !{i32 1, !"Debug Info Version", i32 3}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", scope: null, file: !1, line: 1, type: !6, isLocal: true, isDefinition: true)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !{i32 2, !"Dwarf Version", i32 3}
+!8 = !{i32 1, !"Debug Info Version", i32 3}
+!9 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
+!10 = !DISubroutineType(types: !11)
+!11 = !{!6}
+!12 = !DILocation(line: 4, scope: !9)
+

+ 60 - 66
test/DebugInfo/Generic/gvn.ll

@@ -13,101 +13,95 @@
 ;   a = f2(1);
 ;   f1(&a);
 ; }
+source_filename = "test/DebugInfo/Generic/gvn.ll"
 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
 target triple = "arm64-apple-ios"
 
-@a = common global i32 0, align 4, !dbg !16
-@b = common global i32 0, align 4, !dbg !17
+@a = common global i32 0, align 4, !dbg !0
+@b = common global i32 0, align 4, !dbg !6
 
 ; Function Attrs: nounwind
 define void @f3() #0 !dbg !12 {
 entry:
   ; Verify that the call still has a debug location after GVN.
   ; CHECK: %call = tail call i32 @f2(i32 1) #{{[0-9]}}, !dbg
-  %call = tail call i32 @f2(i32 1) #3, !dbg !36
-  store i32 %call, i32* @a, align 4, !dbg !36, !tbaa !25
-  tail call void @llvm.dbg.value(metadata i32* @a, i64 0, metadata !11, metadata !21) #3, !dbg !39
-  %0 = load i32, i32* @b, align 4, !dbg !39, !tbaa !25
-  %tobool.i = icmp eq i32 %0, 0, !dbg !39
-  br i1 %tobool.i, label %if.end.i, label %land.lhs.true.i.thread, !dbg !40
+  %call = tail call i32 @f2(i32 1) #0, !dbg !15
+  store i32 %call, i32* @a, align 4, !dbg !15, !tbaa !24
+  tail call void @llvm.dbg.value(metadata i32* @a, i64 0, metadata !22, metadata !28) #0, !dbg !29
+  %0 = load i32, i32* @b, align 4, !dbg !29, !tbaa !24
+  %tobool.i = icmp eq i32 %0, 0, !dbg !29
+  br i1 %tobool.i, label %if.end.i, label %land.lhs.true.i.thread, !dbg !30
 
 land.lhs.true.i.thread:                           ; preds = %entry
-  store i32 1, i32* @a, align 4, !dbg !41, !tbaa !25
-  br label %if.then.3.i, !dbg !42
+  store i32 1, i32* @a, align 4, !dbg !32, !tbaa !24
+  br label %if.then.3.i, !dbg !33
 
-if.end.i:                                         ; preds = %entry
   ; This instruction has no debug location -- in this
   ; particular case it was removed by a bug in SimplifyCFG.
+if.end.i:                                         ; preds = %entry
   %.pr = load i32, i32* @a, align 4
-
   ; GVN is supposed to replace the load of %.pr with a direct reference to %call.
   ; CHECK: %tobool2.i = icmp eq i32 %call, 0, !dbg
-  %tobool2.i = icmp eq i32 %.pr, 0, !dbg !43
-  br i1 %tobool2.i, label %f1.exit, label %if.then.3.i, !dbg !43
+  %tobool2.i = icmp eq i32 %.pr, 0, !dbg !34
+  br i1 %tobool2.i, label %f1.exit, label %if.then.3.i, !dbg !34
 
 if.then.3.i:                                      ; preds = %if.end.i, %land.lhs.true.i.thread
-  %call.i = tail call i32 bitcast (i32 (...)* @f4 to i32 ()*)() #3, !dbg !44
-  br label %f1.exit, !dbg !44
+  %call.i = tail call i32 bitcast (i32 (...)* @f4 to i32 ()*)() #0, !dbg !35
+  br label %f1.exit, !dbg !35
 
-f1.exit:                                          ; preds = %if.end.i, %if.then.3.i
-  ret void, !dbg !45
+f1.exit:                                          ; preds = %if.then.3.i, %if.end.i
+  ret void, !dbg !36
 }
 
 declare i32 @f2(i32)
+
 declare i32 @f4(...)
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 
 attributes #0 = { nounwind }
-attributes #2 = { nounwind readnone }
-attributes #3 = { nounwind }
+attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!18, !19}
-!llvm.ident = !{!20}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!9, !10}
+!llvm.ident = !{!11}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !15)
-!1 = !DIFile(filename: "test.c", directory: "/")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !10)
-!6 = !DISubroutineType(types: !7)
-!7 = !{null, !8}
-!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
-!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = !{!11}
-!11 = !DILocalVariable(name: "p1", arg: 1, scope: !4, file: !1, line: 2, type: !8)
-!12 = distinct !DISubprogram(name: "f3", scope: !1, file: !1, line: 9, type: !13, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "test.c", directory: "/")
+!4 = !{}
+!5 = !{!0, !6}
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = !{i32 2, !"Dwarf Version", i32 2}
+!10 = !{i32 2, !"Debug Info Version", i32 3}
+!11 = !{!"clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)"}
+!12 = distinct !DISubprogram(name: "f3", scope: !3, file: !3, line: 9, type: !13, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !4)
 !13 = !DISubroutineType(types: !14)
 !14 = !{null}
-!15 = !{!16, !17}
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true))
-!17 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true))
-!18 = !{i32 2, !"Dwarf Version", i32 2}
-!19 = !{i32 2, !"Debug Info Version", i32 3}
-!20 = !{!"clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)"}
-!21 = !DIExpression()
-!22 = !DILocation(line: 2, scope: !4)
-!23 = !DILocation(line: 3, scope: !24)
-!24 = distinct !DILexicalBlock(scope: !4, file: !1, line: 3)
-!25 = !{!26, !26, i64 0}
-!26 = !{!"int", !27, i64 0}
-!27 = !{!"omnipotent char", !28, i64 0}
-!28 = !{!"Simple C/C++ TBAA"}
-!29 = !DILocation(line: 3, scope: !4)
-!30 = !DILocation(line: 4, scope: !24)
-!31 = !DILocation(line: 5, scope: !32)
-!32 = distinct !DILexicalBlock(scope: !4, file: !1, line: 5)
-!33 = !DILocation(line: 5, scope: !4)
-!34 = !DILocation(line: 6, scope: !32)
-!35 = !DILocation(line: 7, scope: !4)
-!36 = !DILocation(line: 5, scope: !32, inlinedAt: !37)
-!37 = distinct !DILocation(line: 11, scope: !12)
-!38 = !DILocation(line: 10, scope: !12)
-!39 = !DILocation(line: 2, scope: !4, inlinedAt: !37)
-!40 = !DILocation(line: 3, scope: !24, inlinedAt: !37)
-!41 = !DILocation(line: 3, scope: !4, inlinedAt: !37)
-!42 = !DILocation(line: 4, scope: !24, inlinedAt: !37)
-!43 = !DILocation(line: 5, scope: !4, inlinedAt: !37)
-!44 = !DILocation(line: 6, scope: !32, inlinedAt: !37)
-!45 = !DILocation(line: 12, scope: !12)
+!15 = !DILocation(line: 5, scope: !16, inlinedAt: !23)
+!16 = distinct !DILexicalBlock(scope: !17, file: !3, line: 5)
+!17 = distinct !DISubprogram(name: "f1", scope: !3, file: !3, line: 2, type: !18, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !21)
+!18 = !DISubroutineType(types: !19)
+!19 = !{null, !20}
+!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
+!21 = !{!22}
+!22 = !DILocalVariable(name: "p1", arg: 1, scope: !17, file: !3, line: 2, type: !20)
+!23 = distinct !DILocation(line: 11, scope: !12)
+!24 = !{!25, !25, i64 0}
+!25 = !{!"int", !26, i64 0}
+!26 = !{!"omnipotent char", !27, i64 0}
+!27 = !{!"Simple C/C++ TBAA"}
+!28 = !DIExpression()
+!29 = !DILocation(line: 2, scope: !17, inlinedAt: !23)
+!30 = !DILocation(line: 3, scope: !31, inlinedAt: !23)
+!31 = distinct !DILexicalBlock(scope: !17, file: !3, line: 3)
+!32 = !DILocation(line: 3, scope: !17, inlinedAt: !23)
+!33 = !DILocation(line: 4, scope: !31, inlinedAt: !23)
+!34 = !DILocation(line: 5, scope: !17, inlinedAt: !23)
+!35 = !DILocation(line: 6, scope: !16, inlinedAt: !23)
+!36 = !DILocation(line: 12, scope: !12)
+

+ 23 - 19
test/DebugInfo/Generic/member-pointers.ll

@@ -17,24 +17,28 @@
 ; int S::*x = 0;
 ; void (S::*y)(int) = 0;
 
-@x = global i64 -1, align 8, !dbg !5
-@y = global { i64, i64 } zeroinitializer, align 8, !dbg !10
+source_filename = "test/DebugInfo/Generic/member-pointers.ll"
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!16}
+@x = global i64 -1, align 8, !dbg !0
+@y = global { i64, i64 } zeroinitializer, align 8, !dbg !7
+
+!llvm.dbg.cu = !{!13}
+!llvm.module.flags = !{!15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "simple.cpp", directory: "/home/blaikie/Development/scratch")
+!3 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !4, extraData: !5)
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !2, line: 1, size: 8, align: 8, elements: !6)
+!6 = !{}
+!7 = !DIGlobalVariableExpression(var: !8)
+!8 = !DIGlobalVariable(name: "y", scope: null, file: !2, line: 5, type: !9, isLocal: false, isDefinition: true)
+!9 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !10, extraData: !5)
+!10 = !DISubroutineType(types: !11)
+!11 = !{null, !12, !4}
+!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, retainedTypes: !6, globals: !14, imports: !6)
+!14 = !{!0, !7}
+!15 = !{i32 1, !"Debug Info Version", i32 3}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: FullDebug, file: !15, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
-!1 = !{}
-!3 = !{!5, !10}
-!5 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7))
-!6 = !DIFile(filename: "simple.cpp", directory: "/home/blaikie/Development/scratch")
-!7 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !8, extraData: !9)
-!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: "S", line: 1, size: 8, align: 8, file: !15, elements: !1)
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "y", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !11))
-!11 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !12, extraData: !9)
-!12 = !DISubroutineType(types: !13)
-!13 = !{null, !14, !8}
-!14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !9)
-!15 = !DIFile(filename: "simple.cpp", directory: "/home/blaikie/Development/scratch")
-!16 = !{i32 1, !"Debug Info Version", i32 3}

+ 138 - 138
test/DebugInfo/Generic/recursive_inlining.ll

@@ -84,105 +84,107 @@
 ; CHECK-NOT: DW_TAG
 ; CHECK:              DW_AT_abstract_origin {{.*}} {[[M_FN2_THIS_ABS_DEF]]}
 
-
+source_filename = "test/DebugInfo/Generic/recursive_inlining.ll"
 
 %struct.C = type { i32 }
 
-@x = global %struct.C* null, align 8, !dbg !27
+@x = global %struct.C* null, align 8, !dbg !0
 
 ; Function Attrs: nounwind
-define void @_Z3fn6v() #0 !dbg !14 {
+define void @_Z3fn6v() #0 !dbg !20 {
 entry:
-  tail call void @_Z3fn8v() #3, !dbg !31
-  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !32, !tbaa !33
-  tail call void @llvm.dbg.value(metadata %struct.C* %0, i64 0, metadata !37, metadata !DIExpression()) #3, !dbg !38
-  tail call void @_Z3fn8v() #3, !dbg !39
-  %b.i = getelementptr inbounds %struct.C, %struct.C* %0, i64 0, i32 0, !dbg !40
-  %1 = load i32, i32* %b.i, align 4, !dbg !40, !tbaa !42
-  %tobool.i = icmp eq i32 %1, 0, !dbg !40
-  br i1 %tobool.i, label %_ZN1C5m_fn2Ev.exit, label %if.then.i, !dbg !40
+  tail call void @_Z3fn8v() #3, !dbg !23
+  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !24, !tbaa !25
+  tail call void @llvm.dbg.value(metadata %struct.C* %0, i64 0, metadata !29, metadata !32) #3, !dbg !33
+  tail call void @_Z3fn8v() #3, !dbg !34
+  %b.i = getelementptr inbounds %struct.C, %struct.C* %0, i64 0, i32 0, !dbg !35
+  %1 = load i32, i32* %b.i, align 4, !dbg !35, !tbaa !37
+  %tobool.i = icmp eq i32 %1, 0, !dbg !35
+  br i1 %tobool.i, label %_ZN1C5m_fn2Ev.exit, label %if.then.i, !dbg !35
 
 if.then.i:                                        ; preds = %entry
-  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !45
-  br label %_ZN1C5m_fn2Ev.exit, !dbg !45
+  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !40
+  br label %_ZN1C5m_fn2Ev.exit, !dbg !40
 
-_ZN1C5m_fn2Ev.exit:                               ; preds = %entry, %if.then.i
-  tail call void @_Z3fn3v() #3, !dbg !47
-  ret void, !dbg !48
+_ZN1C5m_fn2Ev.exit:                               ; preds = %if.then.i, %entry
+  tail call void @_Z3fn3v() #3, !dbg !42
+  ret void, !dbg !43
 }
 
 declare void @_Z3fn8v() #1
 
 ; Function Attrs: nounwind
-define linkonce_odr void @_ZN1C5m_fn2Ev(%struct.C* nocapture readonly %this) #0 align 2 !dbg !22 {
+
+define linkonce_odr void @_ZN1C5m_fn2Ev(%struct.C* nocapture readonly %this) #0 align 2 !dbg !30 {
 entry:
-  tail call void @llvm.dbg.value(metadata %struct.C* %this, i64 0, metadata !24, metadata !DIExpression()), !dbg !49
-  tail call void @_Z3fn8v() #3, !dbg !50
-  %b = getelementptr inbounds %struct.C, %struct.C* %this, i64 0, i32 0, !dbg !51
-  %0 = load i32, i32* %b, align 4, !dbg !51, !tbaa !42
-  %tobool = icmp eq i32 %0, 0, !dbg !51
-  br i1 %tobool, label %if.end, label %if.then, !dbg !51
+  tail call void @llvm.dbg.value(metadata %struct.C* %this, i64 0, metadata !29, metadata !32), !dbg !44
+  tail call void @_Z3fn8v() #3, !dbg !45
+  %b = getelementptr inbounds %struct.C, %struct.C* %this, i64 0, i32 0, !dbg !46
+  %0 = load i32, i32* %b, align 4, !dbg !46, !tbaa !37
+  %tobool = icmp eq i32 %0, 0, !dbg !46
+  br i1 %tobool, label %if.end, label %if.then, !dbg !46
 
 if.then:                                          ; preds = %entry
-  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !52
-  br label %if.end, !dbg !52
-
-if.end:                                           ; preds = %entry, %if.then
-  tail call void @_Z3fn8v() #3, !dbg !53
-  %1 = load %struct.C*, %struct.C** @x, align 8, !dbg !56, !tbaa !33
-  tail call void @llvm.dbg.value(metadata %struct.C* %1, i64 0, metadata !57, metadata !DIExpression()) #3, !dbg !58
-  tail call void @_Z3fn8v() #3, !dbg !59
-  %b.i.i = getelementptr inbounds %struct.C, %struct.C* %1, i64 0, i32 0, !dbg !60
-  %2 = load i32, i32* %b.i.i, align 4, !dbg !60, !tbaa !42
-  %tobool.i.i = icmp eq i32 %2, 0, !dbg !60
-  br i1 %tobool.i.i, label %_Z3fn6v.exit, label %if.then.i.i, !dbg !60
+  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !47
+  br label %if.end, !dbg !47
+
+if.end:                                           ; preds = %if.then, %entry
+  tail call void @_Z3fn8v() #3, !dbg !48
+  %1 = load %struct.C*, %struct.C** @x, align 8, !dbg !52, !tbaa !25
+  tail call void @llvm.dbg.value(metadata %struct.C* %1, i64 0, metadata !29, metadata !32) #3, !dbg !53
+  tail call void @_Z3fn8v() #3, !dbg !54
+  %b.i.i = getelementptr inbounds %struct.C, %struct.C* %1, i64 0, i32 0, !dbg !55
+  %2 = load i32, i32* %b.i.i, align 4, !dbg !55, !tbaa !37
+  %tobool.i.i = icmp eq i32 %2, 0, !dbg !55
+  br i1 %tobool.i.i, label %_Z3fn6v.exit, label %if.then.i.i, !dbg !55
 
 if.then.i.i:                                      ; preds = %if.end
-  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !61
-  br label %_Z3fn6v.exit, !dbg !61
 
-_Z3fn6v.exit:                                     ; preds = %if.end, %if.then.i.i
-  tail call void @_Z3fn3v() #3, !dbg !62
-  ret void, !dbg !63
+  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !56
+  br label %_Z3fn6v.exit, !dbg !56
+
+_Z3fn6v.exit:                                     ; preds = %if.then.i.i, %if.end
+  tail call void @_Z3fn3v() #3, !dbg !57
+  ret void, !dbg !58
 }
 
 ; Function Attrs: nounwind
-define void @_Z3fn3v() #0 !dbg !18 {
+define void @_Z3fn3v() #0 !dbg !50 {
 entry:
   br label %tailrecurse
 
 tailrecurse:                                      ; preds = %tailrecurse.backedge, %entry
-  tail call void @_Z3fn8v() #3, !dbg !64
-  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !66, !tbaa !33
-  tail call void @llvm.dbg.value(metadata %struct.C* %0, i64 0, metadata !67, metadata !DIExpression()) #3, !dbg !68
-  tail call void @_Z3fn8v() #3, !dbg !69
-  %b.i.i = getelementptr inbounds %struct.C, %struct.C* %0, i64 0, i32 0, !dbg !70
-  %1 = load i32, i32* %b.i.i, align 4, !dbg !70, !tbaa !42
-  %tobool.i.i = icmp eq i32 %1, 0, !dbg !70
-  br i1 %tobool.i.i, label %tailrecurse.backedge, label %if.then.i.i, !dbg !70
-
-tailrecurse.backedge:                             ; preds = %tailrecurse, %if.then.i.i
+  tail call void @_Z3fn8v() #3, !dbg !59
+  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !61, !tbaa !25
+  tail call void @llvm.dbg.value(metadata %struct.C* %0, i64 0, metadata !29, metadata !32) #3, !dbg !62
+  tail call void @_Z3fn8v() #3, !dbg !63
+  %b.i.i = getelementptr inbounds %struct.C, %struct.C* %0, i64 0, i32 0, !dbg !64
+  %1 = load i32, i32* %b.i.i, align 4, !dbg !64, !tbaa !37
+  %tobool.i.i = icmp eq i32 %1, 0, !dbg !64
+  br i1 %tobool.i.i, label %tailrecurse.backedge, label %if.then.i.i, !dbg !64
+
+tailrecurse.backedge:                             ; preds = %if.then.i.i, %tailrecurse
   br label %tailrecurse
 
 if.then.i.i:                                      ; preds = %tailrecurse
-  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !71
-  br label %tailrecurse.backedge, !dbg !71
+  tail call void @_Z3fn2iiii(i32 0, i32 0, i32 0, i32 0) #3, !dbg !65
+  br label %tailrecurse.backedge, !dbg !65
 }
 
 ; Function Attrs: nounwind
-define void @_Z3fn4v() #0 !dbg !19 {
+define void @_Z3fn4v() #0 !dbg !66 {
 entry:
-  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !72, !tbaa !33
-  tail call void @_ZN1C5m_fn2Ev(%struct.C* %0), !dbg !72
-  ret void, !dbg !72
+  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !67, !tbaa !25
+  tail call void @_ZN1C5m_fn2Ev(%struct.C* %0), !dbg !67
+  ret void, !dbg !67
 }
 
 ; Function Attrs: nounwind
-define void @_Z3fn5v() #0 !dbg !20 {
+define void @_Z3fn5v() #0 !dbg !68 {
 entry:
-  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !73, !tbaa !33
-  tail call void @_ZN1C5m_fn2Ev(%struct.C* %0), !dbg !73
-  ret void, !dbg !73
+  %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !69, !tbaa !25
+  tail call void @_ZN1C5m_fn2Ev(%struct.C* %0), !dbg !69
+  ret void, !dbg !69
 }
 
 declare void @_Z3fn2iiii(i32, i32, i32, i32) #1
@@ -195,80 +197,78 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "
 attributes #2 = { nounwind readnone }
 attributes #3 = { nounwind }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!28, !29}
-!llvm.ident = !{!30}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !26, imports: !2)
-!1 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce")
-!2 = !{}
-!3 = !{!4}
-!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 5, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS1C")
-!5 = !DIFile(filename: "recursive_inlining.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce")
-!6 = !{!7, !9}
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 6, size: 32, align: 32, file: !5, scope: !4, baseType: !8)
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !DISubprogram(name: "m_fn2", linkageName: "_ZN1C5m_fn2Ev", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !5, scope: !4, type: !10)
-!10 = !DISubroutineType(types: !11)
-!11 = !{null, !12}
-!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
-!14 = distinct !DISubprogram(name: "fn6", linkageName: "_Z3fn6v", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 15, file: !5, scope: !15, type: !16, variables: !2)
-!15 = !DIFile(filename: "recursive_inlining.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce")
-!16 = !DISubroutineType(types: !17)
-!17 = !{null}
-!18 = distinct !DISubprogram(name: "fn3", linkageName: "_Z3fn3v", line: 20, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 20, file: !5, scope: !15, type: !16, variables: !2)
-!19 = distinct !DISubprogram(name: "fn4", linkageName: "_Z3fn4v", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 21, file: !5, scope: !15, type: !16, variables: !2)
-!20 = distinct !DISubprogram(name: "fn5", linkageName: "_Z3fn5v", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 22, file: !5, scope: !15, type: !16, variables: !2)
-!21 = distinct !DISubprogram(name: "fn7", linkageName: "_Z3fn7v", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 14, file: !5, scope: !15, type: !16, variables: !2)
-!22 = distinct !DISubprogram(name: "m_fn2", linkageName: "_ZN1C5m_fn2Ev", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 7, file: !5, scope: !4, type: !10, declaration: !9, variables: !23)
-!23 = !{!24}
-!24 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25)
-!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)
-!26 = !{!27}
-!27 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 13, isLocal: false, isDefinition: true, scope: null, file: !15, type: !25))
-!28 = !{i32 2, !"Dwarf Version", i32 4}
-!29 = !{i32 2, !"Debug Info Version", i32 3}
-!30 = !{!"clang version 3.6.0 "}
-!31 = !DILocation(line: 16, scope: !14)
-!32 = !DILocation(line: 17, scope: !14)
-!33 = !{!34, !34, i64 0}
-!34 = !{!"any pointer", !35, i64 0}
-!35 = !{!"omnipotent char", !36, i64 0}
-!36 = !{!"Simple C/C++ TBAA"}
-!37 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25)
-!38 = !DILocation(line: 0, scope: !22, inlinedAt: !32)
-!39 = !DILocation(line: 8, scope: !22, inlinedAt: !32)
-!40 = !DILocation(line: 9, scope: !41, inlinedAt: !32)
-!41 = distinct !DILexicalBlock(line: 9, column: 0, file: !5, scope: !22)
-!42 = !{!43, !44, i64 0}
-!43 = !{!4, !44, i64 0}
-!44 = !{!"int", !35, i64 0}
-!45 = !DILocation(line: 9, scope: !46, inlinedAt: !32)
-!46 = distinct !DILexicalBlock(line: 9, column: 0, file: !5, scope: !41)
-!47 = !DILocation(line: 10, scope: !22, inlinedAt: !32)
-!48 = !DILocation(line: 19, scope: !14)
-!49 = !DILocation(line: 0, scope: !22)
-!50 = !DILocation(line: 8, scope: !22)
-!51 = !DILocation(line: 9, scope: !41)
-!52 = !DILocation(line: 9, scope: !46)
-!53 = !DILocation(line: 16, scope: !14, inlinedAt: !54)
-!54 = !DILocation(line: 20, scope: !18, inlinedAt: !55)
-!55 = !DILocation(line: 10, scope: !22)
-!56 = !DILocation(line: 17, scope: !14, inlinedAt: !54)
-!57 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25)
-!58 = !DILocation(line: 0, scope: !22, inlinedAt: !56)
-!59 = !DILocation(line: 8, scope: !22, inlinedAt: !56)
-!60 = !DILocation(line: 9, scope: !41, inlinedAt: !56)
-!61 = !DILocation(line: 9, scope: !46, inlinedAt: !56)
-!62 = !DILocation(line: 10, scope: !22, inlinedAt: !56)
-!63 = !DILocation(line: 11, scope: !22)
-!64 = !DILocation(line: 16, scope: !14, inlinedAt: !65)
-!65 = !DILocation(line: 20, scope: !18)
-!66 = !DILocation(line: 17, scope: !14, inlinedAt: !65)
-!67 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25)
-!68 = !DILocation(line: 0, scope: !22, inlinedAt: !66)
-!69 = !DILocation(line: 8, scope: !22, inlinedAt: !66)
-!70 = !DILocation(line: 9, scope: !41, inlinedAt: !66)
-!71 = !DILocation(line: 9, scope: !46, inlinedAt: !66)
-!72 = !DILocation(line: 21, scope: !19)
-!73 = !DILocation(line: 22, scope: !20)
+!llvm.dbg.cu = !{!12}
+!llvm.module.flags = !{!17, !18}
+!llvm.ident = !{!19}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 13, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "recursive_inlining.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce")
+!3 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)
+!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !2, line: 5, size: 32, align: 32, elements: !5, identifier: "_ZTS1C")
+!5 = !{!6, !8}
+!6 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !4, file: !2, line: 6, baseType: !7, size: 32, align: 32)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !DISubprogram(name: "m_fn2", linkageName: "_ZN1C5m_fn2Ev", scope: !4, file: !2, line: 7, type: !9, isLocal: false, isDefinition: false, scopeLine: 7, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true)
+!9 = !DISubroutineType(types: !10)
+!10 = !{null, !11}
+!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !13, producer: "clang version 3.6.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !14, retainedTypes: !15, globals: !16, imports: !14)
+!13 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce")
+!14 = !{}
+!15 = !{!4}
+!16 = !{!0}
+!17 = !{i32 2, !"Dwarf Version", i32 4}
+!18 = !{i32 2, !"Debug Info Version", i32 3}
+!19 = !{!"clang version 3.6.0 "}
+!20 = distinct !DISubprogram(name: "fn6", linkageName: "_Z3fn6v", scope: !2, file: !2, line: 15, type: !21, isLocal: false, isDefinition: true, scopeLine: 15, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !14)
+!21 = !DISubroutineType(types: !22)
+!22 = !{null}
+!23 = !DILocation(line: 16, scope: !20)
+!24 = !DILocation(line: 17, scope: !20)
+!25 = !{!26, !26, i64 0}
+!26 = !{!"any pointer", !27, i64 0}
+!27 = !{!"omnipotent char", !28, i64 0}
+!28 = !{!"Simple C/C++ TBAA"}
+!29 = !DILocalVariable(name: "this", arg: 1, scope: !30, type: !3, flags: DIFlagArtificial | DIFlagObjectPointer)
+!30 = distinct !DISubprogram(name: "m_fn2", linkageName: "_ZN1C5m_fn2Ev", scope: !4, file: !2, line: 7, type: !9, isLocal: false, isDefinition: true, scopeLine: 7, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, declaration: !8, variables: !31)
+!31 = !{!29}
+!32 = !DIExpression()
+!33 = !DILocation(line: 0, scope: !30, inlinedAt: !24)
+!34 = !DILocation(line: 8, scope: !30, inlinedAt: !24)
+!35 = !DILocation(line: 9, scope: !36, inlinedAt: !24)
+!36 = distinct !DILexicalBlock(scope: !30, file: !2, line: 9)
+!37 = !{!38, !39, i64 0}
+!38 = !{!4, !39, i64 0}
+!39 = !{!"int", !27, i64 0}
+!40 = !DILocation(line: 9, scope: !41, inlinedAt: !24)
+!41 = distinct !DILexicalBlock(scope: !36, file: !2, line: 9)
+!42 = !DILocation(line: 10, scope: !30, inlinedAt: !24)
+!43 = !DILocation(line: 19, scope: !20)
+!44 = !DILocation(line: 0, scope: !30)
+!45 = !DILocation(line: 8, scope: !30)
+!46 = !DILocation(line: 9, scope: !36)
+!47 = !DILocation(line: 9, scope: !41)
+!48 = !DILocation(line: 16, scope: !20, inlinedAt: !49)
+!49 = !DILocation(line: 20, scope: !50, inlinedAt: !51)
+!50 = distinct !DISubprogram(name: "fn3", linkageName: "_Z3fn3v", scope: !2, file: !2, line: 20, type: !21, isLocal: false, isDefinition: true, scopeLine: 20, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !14)
+!51 = !DILocation(line: 10, scope: !30)
+!52 = !DILocation(line: 17, scope: !20, inlinedAt: !49)
+!53 = !DILocation(line: 0, scope: !30, inlinedAt: !52)
+!54 = !DILocation(line: 8, scope: !30, inlinedAt: !52)
+!55 = !DILocation(line: 9, scope: !36, inlinedAt: !52)
+!56 = !DILocation(line: 9, scope: !41, inlinedAt: !52)
+!57 = !DILocation(line: 10, scope: !30, inlinedAt: !52)
+!58 = !DILocation(line: 11, scope: !30)
+!59 = !DILocation(line: 16, scope: !20, inlinedAt: !60)
+!60 = !DILocation(line: 20, scope: !50)
+!61 = !DILocation(line: 17, scope: !20, inlinedAt: !60)
+!62 = !DILocation(line: 0, scope: !30, inlinedAt: !61)
+!63 = !DILocation(line: 8, scope: !30, inlinedAt: !61)
+!64 = !DILocation(line: 9, scope: !36, inlinedAt: !61)
+!65 = !DILocation(line: 9, scope: !41, inlinedAt: !61)
+!66 = distinct !DISubprogram(name: "fn4", linkageName: "_Z3fn4v", scope: !2, file: !2, line: 21, type: !21, isLocal: false, isDefinition: true, scopeLine: 21, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !14)
+!67 = !DILocation(line: 21, scope: !66)
+!68 = distinct !DISubprogram(name: "fn5", linkageName: "_Z3fn5v", scope: !2, file: !2, line: 22, type: !21, isLocal: false, isDefinition: true, scopeLine: 22, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, variables: !14)
+!69 = !DILocation(line: 22, scope: !68)
+

+ 38 - 35
test/DebugInfo/Generic/template-recursive-void.ll

@@ -18,44 +18,47 @@
 ; CHECK-NOT: DW_AT_type
 ; CHECK: NULL
 
+source_filename = "test/DebugInfo/Generic/template-recursive-void.ll"
+
 %class.bar = type { i8 }
 
-@filters = global %class.bar zeroinitializer, align 1, !dbg !4
+@filters = global %class.bar zeroinitializer, align 1, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!36, !37}
+!llvm.dbg.cu = !{!29}
+!llvm.module.flags = !{!32, !33}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "filters", line: 10, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6))
-!5 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
-!6 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", line: 9, size: 8, align: 8, file: !1, elements: !7)
-!7 = !{!8, !31}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "filters", scope: null, file: !2, line: 10, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp")
+!3 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", file: !2, line: 9, size: 8, align: 8, elements: !4)
+!4 = !{!5, !25}
+!5 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !3, baseType: !6)
+!6 = !DICompositeType(tag: DW_TAG_class_type, name: "foo<void>", file: !2, line: 5, size: 8, align: 8, elements: !7, templateParams: !23)
+!7 = !{!8, !15, !20}
 !8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9)
-!9 = !DICompositeType(tag: DW_TAG_class_type, name: "foo<void>", line: 5, size: 8, align: 8, file: !1, elements: !10, templateParams: !29)
-!10 = !{!11, !19, !25}
-!11 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !9, baseType: !12)
-!12 = !DICompositeType(tag: DW_TAG_class_type, name: "base", line: 3, size: 8, align: 8, file: !1, elements: !13)
-!13 = !{!14}
-!14 = !DISubprogram(name: "base", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !12, type: !15)
-!15 = !DISubroutineType(types: !16)
-!16 = !{null, !17}
-!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !12)
-!19 = !DISubprogram(name: "operator=", linkageName: "_ZN3fooIvEaSES0_", line: 6, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !9, type: !20)
-!20 = !DISubroutineType(types: !21)
-!21 = !{null, !22, !23}
-!22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !9)
-!23 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
-!25 = !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !9, type: !26)
+!9 = !DICompositeType(tag: DW_TAG_class_type, name: "base", file: !2, line: 3, size: 8, align: 8, elements: !10)
+!10 = !{!11}
+!11 = !DISubprogram(name: "base", scope: !9, file: !2, line: 3, type: !12, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!12 = !DISubroutineType(types: !13)
+!13 = !{null, !14}
+!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!15 = !DISubprogram(name: "operator=", linkageName: "_ZN3fooIvEaSES0_", scope: !6, file: !2, line: 6, type: !16, isLocal: false, isDefinition: false, scopeLine: 6, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false)
+!16 = !DISubroutineType(types: !17)
+!17 = !{null, !18, !19}
+!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6)
+!20 = !DISubprogram(name: "foo", scope: !6, file: !2, line: 5, type: !21, isLocal: false, isDefinition: false, scopeLine: 5, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!21 = !DISubroutineType(types: !22)
+!22 = !{null, !18}
+!23 = !{!24}
+!24 = !DITemplateTypeParameter(name: "T", type: null)
+!25 = !DISubprogram(name: "bar", scope: !3, file: !2, line: 9, type: !26, isLocal: false, isDefinition: false, scopeLine: 9, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
 !26 = !DISubroutineType(types: !27)
-!27 = !{null, !22}
-!29 = !{!30}
-!30 = !DITemplateTypeParameter(name: "T", type: null)
-!31 = !DISubprogram(name: "bar", line: 9, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !1, scope: !6, type: !32)
-!32 = !DISubroutineType(types: !33)
-!33 = !{null, !34}
-!34 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !6)
-!36 = !{i32 2, !"Dwarf Version", i32 3}
-!37 = !{i32 1, !"Debug Info Version", i32 3}
+!27 = !{null, !28}
+!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!29 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !30, retainedTypes: !30, globals: !31, imports: !30)
+!30 = !{}
+!31 = !{!0}
+!32 = !{i32 2, !"Dwarf Version", i32 3}
+!33 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 15 - 12
test/DebugInfo/Generic/tu-member-pointer.ll

@@ -11,20 +11,23 @@
 ; };
 ; int Foo:*x = 0;
 
-@x = global i64 -1, align 8, !dbg !6
+source_filename = "test/DebugInfo/Generic/tu-member-pointer.ll"
 
-!llvm.dbg.cu = !{!0}
+@x = global i64 -1, align 8, !dbg !0
+
+!llvm.dbg.cu = !{!6}
 !llvm.module.flags = !{!10, !11}
 
-!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: !5, imports: !2)
-!1 = !DIFile(filename: "foo.cpp", directory: ".")
-!2 = !{}
-!3 = !{!4}
-!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", line: 1, flags: DIFlagFwdDecl, file: !1, identifier: "_ZTS3Foo")
-!5 = !{!6}
-!6 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !7, type: !8))
-!7 = !DIFile(filename: "foo.cpp", directory: ".")
-!8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, extraData: !4)
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "foo.cpp", directory: ".")
+!3 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !4, extraData: !5)
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !2, line: 1, flags: DIFlagFwdDecl, identifier: "_ZTS3Foo")
+!6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !7, retainedTypes: !8, globals: !9, imports: !7)
+!7 = !{}
+!8 = !{!5}
+!9 = !{!0}
 !10 = !{i32 2, !"Dwarf Version", i32 2}
 !11 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 12 - 10
test/DebugInfo/Generic/typedef.ll

@@ -12,20 +12,22 @@
 ; CHECK-NOT: DW_AT_type
 ; CHECK: {{DW_TAG|NULL}}
 
-@y = global i8* null, align 8, !dbg !4
+source_filename = "test/DebugInfo/Generic/typedef.ll"
 
-!llvm.dbg.cu = !{!0}
+@y = global i8* null, align 8, !dbg !0
+
+!llvm.dbg.cu = !{!5}
 !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: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "typedef.cpp", directory: "/tmp/dbginfo")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "y", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6))
-!5 = !DIFile(filename: "typedef.cpp", directory: "/tmp/dbginfo")
-!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !7)
-!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "x", line: 1, file: !1, baseType: null)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "y", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "typedef.cpp", directory: "/tmp/dbginfo")
+!3 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, align: 64)
+!4 = !DIDerivedType(tag: DW_TAG_typedef, name: "x", file: !2, line: 1, baseType: null)
+!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, retainedTypes: !6, globals: !7, imports: !6)
+!6 = !{}
+!7 = !{!0}
 !8 = !{i32 2, !"Dwarf Version", i32 4}
 !9 = !{i32 1, !"Debug Info Version", i32 3}
 !10 = !{!"clang version 3.5.0 "}

+ 50 - 46
test/DebugInfo/Mips/InlinedFnLocalVar.ll

@@ -5,56 +5,60 @@
 ; CHECK:	DW_TAG_structure_type
 ; CHECK-NEXT:	info_string
 
+source_filename = "test/DebugInfo/Mips/InlinedFnLocalVar.ll"
 
-@i = common global i32 0, !dbg !16                          ; <i32*> [#uses=2]
+@i = common global i32 0, !dbg !0
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
 
-define i32 @bar() nounwind ssp !dbg !6 {
+; Function Attrs: nounwind ssp
+define i32 @bar() #1 !dbg !8 {
 entry:
-  %0 = load i32, i32* @i, align 4, !dbg !17            ; <i32> [#uses=2]
-  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19
-  tail call void @llvm.dbg.declare(metadata !29, metadata !60, metadata !DIExpression()), !dbg !21
-  %1 = mul nsw i32 %0, %0, !dbg !22               ; <i32> [#uses=2]
-  store i32 %1, i32* @i, align 4, !dbg !17
-  ret i32 %1, !dbg !23
+  %0 = load i32, i32* @i, align 4, !dbg !11
+  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !13, metadata !24), !dbg !25
+  tail call void @llvm.dbg.declare(metadata !5, metadata !18, metadata !24), !dbg !26
+  %1 = mul nsw i32 %0, %0, !dbg !27
+  store i32 %1, i32* @i, align 4, !dbg !11
+  ret i32 %1, !dbg !28
 }
 
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!28}
-
-!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: 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, 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)
-!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-
-!59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
-!60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-
-!11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
-!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
-!13 = !{!14, !15}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
-!15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5))
-!17 = !DILocation(line: 15, scope: !18)
-!18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
-!19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
-!20 = !{}
-!21 = !DILocation(line: 9, scope: !11, inlinedAt: !17)
-!22 = !DILocation(line: 11, scope: !11, inlinedAt: !17)
-!23 = !DILocation(line: 16, scope: !18)
-!24 = !{!9, !10}
-!26 = !{!16}
-!27 = !DIFile(filename: "bar.c", directory: "/tmp/")
-!28 = !{i32 1, !"Debug Info Version", i32 3}
-!29 = !{null}
+attributes #0 = { nounwind readnone }
+attributes #1 = { nounwind ssp }
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "i", scope: !2, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "bar.c", directory: "/tmp/")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+!8 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: !2, file: !2, line: 14, type: !9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !4)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!3}
+!11 = !DILocation(line: 15, scope: !12)
+!12 = distinct !DILexicalBlock(scope: !8, file: !2, line: 14)
+!13 = !DILocalVariable(name: "j", arg: 1, scope: !14, file: !2, line: 9, type: !3)
+!14 = distinct !DISubprogram(name: "foo", scope: !2, file: !2, line: 9, type: !15, isLocal: true, isDefinition: true, scopeLine: 9, virtualIndex: 6, isOptimized: true, unit: !4, variables: !17)
+!15 = !DISubroutineType(types: !16)
+!16 = !{!3, !3}
+!17 = !{!13, !18}
+!18 = !DILocalVariable(name: "xyz", scope: !19, file: !2, line: 10, type: !20)
+!19 = distinct !DILexicalBlock(scope: !14, file: !2, line: 9)
+!20 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !14, file: !2, line: 10, size: 64, align: 32, elements: !21)
+!21 = !{!22, !23}
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32)
+!23 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32, offset: 32)
+!24 = !DIExpression()
+!25 = !DILocation(line: 9, scope: !14, inlinedAt: !11)
+!26 = !DILocation(line: 9, scope: !19, inlinedAt: !11)
+!27 = !DILocation(line: 11, scope: !19, inlinedAt: !11)
+!28 = !DILocation(line: 16, scope: !12)
+

+ 12 - 9
test/DebugInfo/PowerPC/tls-fission.ll

@@ -17,17 +17,20 @@
 ; CHECK-NEXT: .Laddr_sec:
 ; CHECK-NEXT: .quad tls@DTPREL+32768
 
-@tls = thread_local global i32 0, align 4, !dbg !4
+source_filename = "test/DebugInfo/PowerPC/tls-fission.ll"
 
-!llvm.dbg.cu = !{!0}
+@tls = thread_local global i32 0, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!4}
 !llvm.module.flags = !{!7, !8}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, splitDebugFilename: "tls.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "tls.cpp", directory: "/tmp")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6))
-!5 = !DIFile(filename: "tls.cpp", directory: "/tmp")
-!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "tls", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "tls.cpp", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, splitDebugFilename: "tls.dwo", emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
 !7 = !{i32 2, !"Dwarf Version", i32 3}
 !8 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 12 - 10
test/DebugInfo/PowerPC/tls.ll

@@ -12,18 +12,20 @@
 ; DW_OP_GNU_push_tls_address
 ; CHECK: .byte  224
 
-@tls = thread_local global i32 7, align 4, !dbg !4
+source_filename = "test/DebugInfo/PowerPC/tls.ll"
 
-!llvm.dbg.cu = !{!0}
+@tls = thread_local global i32 7, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!4}
 !llvm.module.flags = !{!7, !8}
 
-!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: !3, imports: !2)
-!1 = !DIFile(filename: "tls.cpp", directory: "/tmp")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6))
-!5 = !DIFile(filename: "tls.cpp", directory: "/tmp")
-!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "tls", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "tls.cpp", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
 !7 = !{i32 2, !"Dwarf Version", i32 3}
-
 !8 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 50 - 47
test/DebugInfo/WebAssembly/dbg-declare.ll

@@ -7,69 +7,72 @@
 
 ; Test that llvm.dbg.declare() instrinsics do not crash the backend
 
+source_filename = "test/DebugInfo/WebAssembly/dbg-declare.ll"
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
 
-%0 = type opaque
-
 @key = external global [15 x i8], align 1
 
-; Function Attrs: nounwind
-define internal zeroext i8 @0(i32, i8 zeroext)  !dbg !14 !type !19 {
+define internal zeroext i8 @0(i32, i8 zeroext) !dbg !15 !type !20 {
   %3 = alloca i32, align 4
   %4 = alloca i8, align 1
   store i32 %0, i32* %3, align 4
-  call void @llvm.dbg.declare(metadata i32* %3, metadata !20, metadata !21), !dbg !22
+  call void @llvm.dbg.declare(metadata i32* %3, metadata !21, metadata !22), !dbg !23
   store i8 %1, i8* %4, align 1
-  call void @llvm.dbg.declare(metadata i8* %4, metadata !23, metadata !21), !dbg !24
-  %5 = load i8, i8* %4, align 1, !dbg !25
-  %6 = zext i8 %5 to i32, !dbg !25
-  %7 = load i32, i32* %3, align 4, !dbg !26
-  %8 = urem i32 %7, 15, !dbg !27
-  %9 = getelementptr inbounds [15 x i8], [15 x i8]* @key, i32 0, i32 %8, !dbg !28
-  %10 = load i8, i8* %9, align 1, !dbg !28
-  %11 = zext i8 %10 to i32, !dbg !28
-  %12 = xor i32 %6, %11, !dbg !29
-  %13 = trunc i32 %12 to i8, !dbg !30
-  ret i8 %13, !dbg !31
+  call void @llvm.dbg.declare(metadata i8* %4, metadata !24, metadata !22), !dbg !25
+  %5 = load i8, i8* %4, align 1, !dbg !26
+  %6 = zext i8 %5 to i32, !dbg !26
+  %7 = load i32, i32* %3, align 4, !dbg !27
+  %8 = urem i32 %7, 15, !dbg !28
+  %9 = getelementptr inbounds [15 x i8], [15 x i8]* @key, i32 0, i32 %8, !dbg !29
+  %10 = load i8, i8* %9, align 1, !dbg !29
+  %11 = zext i8 %10 to i32, !dbg !29
+  %12 = xor i32 %6, %11, !dbg !30
+  %13 = trunc i32 %12 to i8, !dbg !31
+  ret i8 %13, !dbg !32
 }
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.declare(metadata, metadata, metadata)
+
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
+
+attributes #0 = { nounwind readnone }
 
 !llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!11, !12}
-!llvm.ident = !{!13}
+!llvm.module.flags = !{!12, !13}
+!llvm.ident = !{!14}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 273884) (llvm/trunk 273897)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
 !1 = !DIFile(filename: "crash.c", directory: "wasm/tests")
 !2 = !{}
 !3 = !{!4}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "key", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true))
-!5 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 120, align: 8, elements: !9)
-!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !7, line: 185, baseType: !8)
-!7 = !DIFile(filename: "wasm/emscripten/system/include/libc/bits/alltypes.h", directory: "wasm/tests")
-!8 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
-!9 = !{!10}
-!10 = !DISubrange(count: 15)
-!11 = !{i32 2, !"Dwarf Version", i32 4}
-!12 = !{i32 2, !"Debug Info Version", i32 3}
-!13 = !{!"clang version 3.9.0 (trunk 273884) (llvm/trunk 273897)"}
-!14 = distinct !DISubprogram(name: "decode", scope: !1, file: !1, line: 11, type: !15, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!15 = !DISubroutineType(types: !16)
-!16 = !{!6, !17, !6}
-!17 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", file: !7, line: 124, baseType: !18)
-!18 = !DIBasicType(name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
-!19 = !{i64 0, !"_ZTSFhmhE"}
-!20 = !DILocalVariable(name: "i", arg: 1, scope: !14, file: !1, line: 11, type: !17)
-!21 = !DIExpression()
-!22 = !DILocation(line: 11, column: 23, scope: !14)
-!23 = !DILocalVariable(name: "v", arg: 2, scope: !14, file: !1, line: 11, type: !6)
-!24 = !DILocation(line: 11, column: 34, scope: !14)
-!25 = !DILocation(line: 12, column: 11, scope: !14)
-!26 = !DILocation(line: 12, column: 19, scope: !14)
-!27 = !DILocation(line: 12, column: 21, scope: !14)
-!28 = !DILocation(line: 12, column: 15, scope: !14)
-!29 = !DILocation(line: 12, column: 13, scope: !14)
-!30 = !DILocation(line: 12, column: 10, scope: !14)
-!31 = !DILocation(line: 12, column: 3, scope: !14)
+!4 = distinct !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "key", scope: !0, file: !1, line: 7, type: !6, isLocal: false, isDefinition: true)
+!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 120, align: 8, elements: !10)
+!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !8, line: 185, baseType: !9)
+!8 = !DIFile(filename: "wasm/emscripten/system/include/libc/bits/alltypes.h", directory: "wasm/tests")
+!9 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
+!10 = !{!11}
+!11 = !DISubrange(count: 15)
+!12 = !{i32 2, !"Dwarf Version", i32 4}
+!13 = !{i32 2, !"Debug Info Version", i32 3}
+!14 = !{!"clang version 3.9.0 (trunk 273884) (llvm/trunk 273897)"}
+!15 = distinct !DISubprogram(name: "decode", scope: !1, file: !1, line: 11, type: !16, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!7, !18, !7}
+!18 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", file: !8, line: 124, baseType: !19)
+!19 = !DIBasicType(name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
+!20 = !{i64 0, !"_ZTSFhmhE"}
+!21 = !DILocalVariable(name: "i", arg: 1, scope: !15, file: !1, line: 11, type: !18)
+!22 = !DIExpression()
+!23 = !DILocation(line: 11, column: 23, scope: !15)
+!24 = !DILocalVariable(name: "v", arg: 2, scope: !15, file: !1, line: 11, type: !7)
+!25 = !DILocation(line: 11, column: 34, scope: !15)
+!26 = !DILocation(line: 12, column: 11, scope: !15)
+!27 = !DILocation(line: 12, column: 19, scope: !15)
+!28 = !DILocation(line: 12, column: 21, scope: !15)
+!29 = !DILocation(line: 12, column: 15, scope: !15)
+!30 = !DILocation(line: 12, column: 13, scope: !15)
+!31 = !DILocation(line: 12, column: 10, scope: !15)
+!32 = !DILocation(line: 12, column: 3, scope: !15)
+

+ 36 - 28
test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll

@@ -3,37 +3,46 @@
 
 ; ModuleID = 'test.c'
 
-@GLB = common global i32 0, align 4, !dbg !14
+source_filename = "test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll"
 
-define i32 @f() nounwind !dbg !5 {
+@GLB = common global i32 0, align 4, !dbg !0
+
+; Function Attrs: nounwind
+define i32 @f() #0 !dbg !8 {
   %LOC = alloca i32, align 4
-  call void @llvm.dbg.declare(metadata i32* %LOC, metadata !15, metadata !DIExpression()), !dbg !17
-  %1 = load i32, i32* @GLB, align 4, !dbg !18
-  store i32 %1, i32* %LOC, align 4, !dbg !18
-  %2 = load i32, i32* @GLB, align 4, !dbg !19
-  ret i32 %2, !dbg !19
+  call void @llvm.dbg.declare(metadata i32* %LOC, metadata !11, metadata !13), !dbg !14
+  %1 = load i32, i32* @GLB, align 4, !dbg !15
+  store i32 %1, i32* %LOC, align 4, !dbg !15
+  %2 = load i32, i32* @GLB, align 4, !dbg !16
+  ret i32 %2, !dbg !16
 }
 
-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: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !12, imports:  !1)
-!1 = !{}
-!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}
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!12 = !{!14}
-!14 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "GLB", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9))
-!15 = !DILocalVariable(name: "LOC", line: 4, scope: !16, file: !6, type: !9)
-!16 = distinct !DILexicalBlock(line: 3, column: 9, file: !20, scope: !5)
-!17 = !DILocation(line: 4, column: 9, scope: !16)
-!18 = !DILocation(line: 4, column: 23, scope: !16)
-!19 = !DILocation(line: 5, column: 5, scope: !16)
-!20 = !DIFile(filename: "test.c", directory: "/work/llvm/vanilla/test/DebugInfo")
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "GLB", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "test.c", directory: "/work/llvm/vanilla/test/DebugInfo")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.0 (trunk)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+!8 = distinct !DISubprogram(name: "f", scope: !2, file: !2, line: 3, type: !9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!3}
+!11 = !DILocalVariable(name: "LOC", scope: !12, file: !2, line: 4, type: !3)
+!12 = distinct !DILexicalBlock(scope: !8, file: !2, line: 3, column: 9)
+!13 = !DIExpression()
+!14 = !DILocation(line: 4, column: 9, scope: !12)
+!15 = !DILocation(line: 4, column: 23, scope: !12)
+!16 = !DILocation(line: 5, column: 5, scope: !12)
 
 ; CHECK: DW_TAG_variable
 ; CHECK-NOT: DW_TAG
@@ -51,4 +60,3 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_decl_line [DW_FORM_data1]     (4)
 
-!21 = !{i32 1, !"Debug Info Version", i32 3}

+ 18 - 15
test/DebugInfo/X86/DIModuleContext.ll

@@ -1,3 +1,4 @@
+source_filename = "test/DebugInfo/X86/DIModuleContext.ll"
 target triple = "x86_64-apple-macosx"
 ; RUN: %llc_dwarf %s -o - -filetype=obj \
 ; RUN:   | llvm-dwarfdump -debug-dump=info - | FileCheck %s
@@ -11,20 +12,22 @@ target triple = "x86_64-apple-macosx"
 
 %struct.s = type opaque
 
-@i = common global %struct.s* null, align 8, !dbg !4
+@i = common global %struct.s* null, align 8, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!7, !8}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!11, !12}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, imports: !6)
+!3 = !DIFile(filename: "test.c", directory: "/")
+!4 = !{}
+!5 = !{!0}
+!6 = !{!7}
+!7 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !8, line: 11)
+!8 = !DIModule(scope: null, name: "Module", includePath: ".", isysroot: "/")
+!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
+!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", scope: !8, file: !3, line: 1, flags: DIFlagFwdDecl)
+!11 = !{i32 2, !"Dwarf Version", i32 2}
+!12 = !{i32 2, !"Debug Info Version", i32 3}
 
-!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}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", scope: !9, file: !1, line: 1, flags: DIFlagFwdDecl)
-!7 = !{i32 2, !"Dwarf Version", i32 2}
-!8 = !{i32 2, !"Debug Info Version", i32 3}
-!9 = !DIModule(scope: null, name: "Module", configMacros: "", includePath: ".", isysroot: "/")
-!10 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !9, line: 11)
-!11 = !{!10}

+ 32 - 30
test/DebugInfo/X86/DW_AT_calling-convention.ll

@@ -42,15 +42,15 @@ 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, !dbg !4
+@"\01?fptr@@3P6IHHH@ZA" = global i32 (i32, i32)* @"\01?f@@YIHHH@Z", align 4, !dbg !0
 
 ; Function Attrs: nounwind readnone
-define x86_fastcallcc i32 @"\01?f@@YIHHH@Z"(i32 inreg %a, i32 inreg %b) #0 !dbg !12 {
+define x86_fastcallcc i32 @"\01?f@@YIHHH@Z"(i32 inreg %a, i32 inreg %b) #0 !dbg !13 {
 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
+  tail call void @llvm.dbg.value(metadata i32 %b, i64 0, metadata !15, metadata !17), !dbg !18
+  tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !16, metadata !17), !dbg !19
+  %add = add nsw i32 %b, %a, !dbg !20
+  ret i32 %add, !dbg !21
 }
 
 ; Function Attrs: nounwind readnone
@@ -59,28 +59,30 @@ 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}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!10, !11}
+!llvm.ident = !{!12}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272067)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32)
+!7 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !8)
+!8 = !{!9, !9, !9}
+!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!10 = !{i32 2, !"Dwarf Version", i32 4}
+!11 = !{i32 2, !"Debug Info Version", i32 3}
+!12 = !{!"clang version 3.9.0 (trunk 272067)"}
+!13 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YIHHH@Z", scope: !3, file: !3, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !14)
+!14 = !{!15, !16}
+!15 = !DILocalVariable(name: "b", arg: 2, scope: !13, file: !3, line: 1, type: !9)
+!16 = !DILocalVariable(name: "a", arg: 1, scope: !13, file: !3, line: 1, type: !9)
+!17 = !DIExpression()
+!18 = !DILocation(line: 1, column: 29, scope: !13)
+!19 = !DILocation(line: 1, column: 22, scope: !13)
+!20 = !DILocation(line: 1, column: 43, scope: !13)
+!21 = !DILocation(line: 1, column: 34, scope: !13)
 
-!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 !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true))
-!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)

+ 26 - 24
test/DebugInfo/X86/DW_AT_specification.ll

@@ -9,33 +9,35 @@
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
 
+source_filename = "test/DebugInfo/X86/DW_AT_specification.ll"
 
-@_ZZN3foo3barEvE1x = constant i32 0, align 4, !dbg !20
+@_ZZN3foo3barEvE1x = constant i32 0, align 4, !dbg !0
 
-define void @_ZN3foo3barEv()  !dbg !5 {
+define void @_ZN3foo3barEv() !dbg !2 {
 entry:
-  ret void, !dbg !25
+  ret void, !dbg !17
 }
 
-!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: FullDebug, file: !27, enums: !1, retainedTypes: !1, globals: !18, imports:  !1)
-!1 = !{}
-!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}
-!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !10)
-!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, flags: DIFlagFwdDecl, file: !27)
-!11 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !6, scope: !12, type: !7)
-!12 = !DICompositeType(tag: DW_TAG_class_type, name: "foo", line: 1, size: 8, align: 8, file: !27, elements: !13)
+!llvm.dbg.cu = !{!8}
+!llvm.module.flags = !{!16}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 5, type: !14, isLocal: true, isDefinition: true)
+!2 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", scope: null, file: !3, line: 4, type: !4, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !8, declaration: !11)
+!3 = !DIFile(filename: "nsNativeAppSupportBase.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library")
+!4 = !DISubroutineType(types: !5)
+!5 = !{null, !6}
+!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial)
+!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !3, line: 1, flags: DIFlagFwdDecl)
+!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.0 ()", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !9, globals: !10, imports: !9)
+!9 = !{}
+!10 = !{!0}
+!11 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", scope: !12, file: !3, line: 2, type: !4, isLocal: false, isDefinition: false, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false)
+!12 = !DICompositeType(tag: DW_TAG_class_type, name: "foo", file: !3, line: 1, size: 8, align: 8, elements: !13)
 !13 = !{!11}
-!18 = !{!20}
-!20 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 5, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !21))
-!21 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !22)
-!22 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!25 = !DILocation(line: 6, column: 1, scope: !26)
-!26 = distinct !DILexicalBlock(line: 4, column: 17, file: !6, scope: !5)
-!27 = !DIFile(filename: "nsNativeAppSupportBase.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library")
-!28 = !{i32 1, !"Debug Info Version", i32 3}
+!14 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !15)
+!15 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!16 = !{i32 1, !"Debug Info Version", i32 3}
+!17 = !DILocation(line: 6, column: 1, scope: !18)
+!18 = distinct !DILexicalBlock(scope: !2, file: !3, line: 4, column: 17)
+

+ 33 - 30
test/DebugInfo/X86/DW_TAG_friend.ll

@@ -8,37 +8,40 @@
 ; CHECK: DW_TAG_friend
 ; CHECK-NEXT: DW_AT_friend [DW_FORM_ref4]   (cu + 0x{{[0-9a-f]*}} => {[[BACK]]})
 
+source_filename = "test/DebugInfo/X86/DW_TAG_friend.ll"
 
 %class.A = type { i32 }
 %class.B = type { i32 }
 
-@a = global %class.A zeroinitializer, align 4, !dbg !5
-@b = global %class.B zeroinitializer, align 4, !dbg !17
-
-!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: FullDebug, file: !28, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
-!1 = !{}
-!3 = !{!5, !17}
-!5 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 10, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7))
-!6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
-!7 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !28, elements: !8)
-!8 = !{!9, !11}
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, flags: DIFlagPrivate, file: !28, scope: !7, baseType: !10)
-!10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!11 = !DISubprogram(name: "A", line: 1, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !6, scope: !7, type: !12)
-!12 = !DISubroutineType(types: !13)
-!13 = !{null, !14}
-!14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !7)
-!17 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", line: 11, isLocal: false, isDefinition: true, scope: null, file: !6, type: !18))
-!18 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 5, size: 32, align: 32, file: !28, elements: !19)
-!19 = !{!20, !21, !27}
-!20 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 7, size: 32, align: 32, flags: DIFlagPrivate, file: !28, scope: !18, baseType: !10)
-!21 = !DISubprogram(name: "B", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !6, scope: !18, type: !22)
-!22 = !DISubroutineType(types: !23)
-!23 = !{null, !24}
-!24 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !18)
-!27 = !DIDerivedType(tag: DW_TAG_friend, file: !28, baseType: !7)
-!28 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
-!29 = !{i32 1, !"Debug Info Version", i32 3}
+@a = global %class.A zeroinitializer, align 4, !dbg !0
+@b = global %class.B zeroinitializer, align 4, !dbg !11
+
+!llvm.dbg.cu = !{!21}
+!llvm.module.flags = !{!24}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 10, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
+!3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, size: 32, align: 32, elements: !4)
+!4 = !{!5, !7}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !3, file: !2, line: 2, baseType: !6, size: 32, align: 32, flags: DIFlagPrivate)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DISubprogram(name: "A", scope: !3, file: !2, line: 1, type: !8, isLocal: false, isDefinition: false, scopeLine: 1, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10}
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
+!11 = !DIGlobalVariableExpression(var: !12)
+!12 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 11, type: !13, isLocal: false, isDefinition: true)
+!13 = !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !2, line: 5, size: 32, align: 32, elements: !14)
+!14 = !{!15, !16, !20}
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !13, file: !2, line: 7, baseType: !6, size: 32, align: 32, flags: DIFlagPrivate)
+!16 = !DISubprogram(name: "B", scope: !13, file: !2, line: 5, type: !17, isLocal: false, isDefinition: false, scopeLine: 5, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!17 = !DISubroutineType(types: !18)
+!18 = !{null, !19}
+!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64, flags: DIFlagArtificial)
+!20 = !DIDerivedType(tag: DW_TAG_friend, file: !2, baseType: !3)
+!21 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !22, retainedTypes: !22, globals: !23, imports: !22)
+!22 = !{}
+!23 = !{!0, !11}
+!24 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 51 - 47
test/DebugInfo/X86/InlinedFnLocalVar.ll

@@ -4,57 +4,61 @@
 ; CHECK: Lsection_info
 ; CHECK:	DW_TAG_structure_type
 ; CHECK-NEXT:	info_string
- 
 
-@i = common global i32 0, !dbg !16                          ; <i32*> [#uses=2]
+source_filename = "test/DebugInfo/X86/InlinedFnLocalVar.ll"
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+@i = common global i32 0, !dbg !0
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
 
-define i32 @bar() nounwind ssp !dbg !6 {
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
+
+; Function Attrs: nounwind ssp
+define i32 @bar() #1 !dbg !8 {
 entry:
-  %0 = load i32, i32* @i, align 4, !dbg !17            ; <i32> [#uses=2]
-  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !109, metadata !DIExpression()), !dbg !19
-  tail call void @llvm.dbg.declare(metadata !29, metadata !110, metadata !DIExpression()), !dbg !21
-  %1 = mul nsw i32 %0, %0, !dbg !22               ; <i32> [#uses=2]
-  store i32 %1, i32* @i, align 4, !dbg !17
-  ret i32 %1, !dbg !23
+  %0 = load i32, i32* @i, align 4, !dbg !11
+  tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !13, metadata !24), !dbg !25
+  tail call void @llvm.dbg.declare(metadata !5, metadata !18, metadata !24), !dbg !26
+  %1 = mul nsw i32 %0, %0, !dbg !27
+  store i32 %1, i32* @i, align 4, !dbg !11
+  ret i32 %1, !dbg !28
 }
 
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!28}
-
-!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: 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, 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)
-!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-
-!109 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
-!110 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-
-!11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
-!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
-!13 = !{!14, !15}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
-!15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5))
-!17 = !DILocation(line: 15, scope: !18)
-!18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
-!19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
-!20 = !{}
-!21 = !DILocation(line: 9, scope: !11, inlinedAt: !17)
-!22 = !DILocation(line: 11, scope: !11, inlinedAt: !17)
-!23 = !DILocation(line: 16, scope: !18)
-!24 = !{!9, !10}
-!26 = !{!16}
-!27 = !DIFile(filename: "bar.c", directory: "/tmp/")
-!28 = !{i32 1, !"Debug Info Version", i32 3}
-!29 = !{null}
+attributes #0 = { nounwind readnone }
+attributes #1 = { nounwind ssp }
+
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "i", scope: !2, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "bar.c", directory: "/tmp/")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}
+!8 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: !2, file: !2, line: 14, type: !9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !4)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!3}
+!11 = !DILocation(line: 15, scope: !12)
+!12 = distinct !DILexicalBlock(scope: !8, file: !2, line: 14)
+!13 = !DILocalVariable(name: "j", arg: 1, scope: !14, file: !2, line: 9, type: !3)
+!14 = distinct !DISubprogram(name: "foo", scope: !2, file: !2, line: 9, type: !15, isLocal: true, isDefinition: true, scopeLine: 9, virtualIndex: 6, isOptimized: true, unit: !4, variables: !17)
+!15 = !DISubroutineType(types: !16)
+!16 = !{!3, !3}
+!17 = !{!13, !18}
+!18 = !DILocalVariable(name: "xyz", scope: !19, file: !2, line: 10, type: !20)
+!19 = distinct !DILexicalBlock(scope: !14, file: !2, line: 9)
+!20 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !14, file: !2, line: 10, size: 64, align: 32, elements: !21)
+!21 = !{!22, !23}
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32)
+!23 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32, offset: 32)
+!24 = !DIExpression()
+!25 = !DILocation(line: 9, scope: !14, inlinedAt: !11)
+!26 = !DILocation(line: 9, scope: !19, inlinedAt: !11)
+!27 = !DILocation(line: 11, scope: !19, inlinedAt: !11)
+!28 = !DILocation(line: 16, scope: !12)
+

+ 63 - 55
test/DebugInfo/X86/PR26148.ll

@@ -28,76 +28,84 @@
 ; CHECK:                 Location description: 10 03 93 04 10 00
 ; constu 0x00000003, piece 0x00000004, constu 0x00000000, piece 0x00000004
 
+source_filename = "test/DebugInfo/X86/PR26148.ll"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
 
 %struct.S0 = type { i16, i32 }
 
-@a = common global %struct.S0 zeroinitializer, align 4, !dbg !21
+@a = common global %struct.S0 zeroinitializer, align 4, !dbg !0
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata)
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
 
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
 ; The attributes are here to force the zero-sized range not to be at the start of
 ; the function, which has special interpretation in DWARF. The fact that this happens
 ; at all is probably an LLVM bug.
-attributes #0 = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" }
-define void @fn1(i16 signext %p1) #0 !dbg !4 {
+
+define void @fn1(i16 signext %p1) #1 !dbg !16 {
 entry:
-  tail call void @llvm.dbg.value(metadata i16 %p1, i64 0, metadata !9, metadata !26), !dbg !27
-  tail call void @llvm.dbg.declare(metadata %struct.S0* undef, metadata !10, metadata !26), !dbg !28
-  tail call void @llvm.dbg.declare(metadata %struct.S0* undef, metadata !16, metadata !26), !dbg !29
-  tail call void @llvm.dbg.value(metadata i32 3, i64 0, metadata !16, metadata !30), !dbg !29
-  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !31), !dbg !29
-  tail call void @llvm.dbg.value(metadata i16 %p1, i64 0, metadata !10, metadata !32), !dbg !28
-  tail call void @llvm.dbg.value(metadata i32 3, i64 0, metadata !10, metadata !30), !dbg !28
-  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !31), !dbg !28
-  store i32 3, i32* bitcast (%struct.S0* @a to i32*), align 4, !dbg !33
-  store i32 0, i32* getelementptr inbounds (%struct.S0, %struct.S0* @a, i64 0, i32 1), align 4, !dbg !33
-  ret void, !dbg !34
+  tail call void @llvm.dbg.value(metadata i16 %p1, i64 0, metadata !20, metadata !23), !dbg !24
+  tail call void @llvm.dbg.declare(metadata %struct.S0* undef, metadata !21, metadata !23), !dbg !25
+  tail call void @llvm.dbg.declare(metadata %struct.S0* undef, metadata !22, metadata !23), !dbg !26
+  tail call void @llvm.dbg.value(metadata i32 3, i64 0, metadata !22, metadata !27), !dbg !26
+  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !22, metadata !28), !dbg !26
+  tail call void @llvm.dbg.value(metadata i16 %p1, i64 0, metadata !21, metadata !29), !dbg !25
+  tail call void @llvm.dbg.value(metadata i32 3, i64 0, metadata !21, metadata !27), !dbg !25
+  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !21, metadata !28), !dbg !25
+  store i32 3, i32* bitcast (%struct.S0* @a to i32*), align 4, !dbg !30
+  store i32 0, i32* getelementptr inbounds (%struct.S0, %struct.S0* @a, i64 0, i32 1), align 4, !dbg !30
+  ret void, !dbg !31
 }
 
-define i32 @main() !dbg !17 {
+define i32 @main() !dbg !32 {
 entry:
   ret i32 0, !dbg !35
 }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!22, !23, !24}
-!llvm.ident = !{!25}
+attributes #0 = { nounwind readnone }
+attributes #1 = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" }
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!12, !13, !14}
+!llvm.ident = !{!15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 4, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, 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: !4, globals: !5)
+!3 = !DIFile(filename: "small.c", directory: "/Users/kfischer/Projects/clangbug")
+!4 = !{}
+!5 = !{!0}
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !3, line: 1, size: 64, align: 32, elements: !7)
+!7 = !{!8, !10}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "f0", scope: !6, file: !3, line: 2, baseType: !9, size: 16, align: 16)
+!9 = !DIBasicType(name: "short", size: 16, align: 16, encoding: DW_ATE_signed)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "f3", scope: !6, file: !3, line: 3, baseType: !11, size: 32, align: 32, offset: 32)
+!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!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 (https://github.com/llvm-mirror/clang 8f258397c5afd7a708bd95770c718e81d08fb11a) (https://github.com/llvm-mirror/llvm 18481855bdfa1b4a424f81be8525db002671348d)"}
+!16 = distinct !DISubprogram(name: "fn1", scope: !3, file: !3, line: 5, type: !17, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !19)
+!17 = !DISubroutineType(types: !18)
+!18 = !{null, !9}
+!19 = !{!20, !21, !22}
+!20 = !DILocalVariable(name: "p1", arg: 1, scope: !16, file: !3, line: 5, type: !9)
+!21 = !DILocalVariable(name: "b", scope: !16, file: !3, line: 6, type: !6)
+!22 = !DILocalVariable(name: "c", scope: !16, file: !3, line: 6, type: !6)
+!23 = !DIExpression()
+!24 = !DILocation(line: 5, column: 16, scope: !16)
+!25 = !DILocation(line: 6, column: 13, scope: !16)
+!26 = !DILocation(line: 6, column: 16, scope: !16)
+!27 = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
+!28 = !DIExpression(DW_OP_LLVM_fragment, 32, 32)
+!29 = !DIExpression(DW_OP_LLVM_fragment, 32, 16)
+!30 = !DILocation(line: 8, column: 9, scope: !16)
+!31 = !DILocation(line: 9, column: 1, scope: !16)
+!32 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 11, type: !33, isLocal: false, isDefinition: true, scopeLine: 11, isOptimized: true, unit: !2, variables: !4)
+!33 = !DISubroutineType(types: !34)
+!34 = !{!11}
+!35 = !DILocation(line: 11, column: 14, scope: !32)
 
-!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 = !{}
-!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)
-!8 = !{!9, !10, !16}
-!9 = !DILocalVariable(name: "p1", arg: 1, scope: !4, file: !1, line: 5, type: !7)
-!10 = !DILocalVariable(name: "b", scope: !4, file: !1, line: 6, type: !11)
-!11 = !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !1, line: 1, size: 64, align: 32, elements: !12)
-!12 = !{!13, !14}
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "f0", scope: !11, file: !1, line: 2, baseType: !7, size: 16, align: 16)
-!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, unit: !0, variables: !2)
-!18 = !DISubroutineType(types: !19)
-!19 = !{!15}
-!20 = !{!21}
-!21 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true))
-!22 = !{i32 2, !"Dwarf Version", i32 2}
-!23 = !{i32 2, !"Debug Info Version", i32 3}
-!24 = !{i32 1, !"PIC Level", i32 2}
-!25 = !{!"clang version 3.9.0 (https://github.com/llvm-mirror/clang 8f258397c5afd7a708bd95770c718e81d08fb11a) (https://github.com/llvm-mirror/llvm 18481855bdfa1b4a424f81be8525db002671348d)"}
-!26 = !DIExpression()
-!27 = !DILocation(line: 5, column: 16, scope: !4)
-!28 = !DILocation(line: 6, column: 13, scope: !4)
-!29 = !DILocation(line: 6, column: 16, scope: !4)
-!30 = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
-!31 = !DIExpression(DW_OP_LLVM_fragment, 32, 32)
-!32 = !DIExpression(DW_OP_LLVM_fragment, 32, 16)
-!33 = !DILocation(line: 8, column: 9, scope: !4)
-!34 = !DILocation(line: 9, column: 1, scope: !4)
-!35 = !DILocation(line: 11, column: 14, scope: !17)

+ 13 - 12
test/DebugInfo/X86/align_c11.ll

@@ -52,32 +52,33 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 attributes #0 = { nounwind uwtable }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!1}
+!llvm.dbg.cu = !{!2}
 !llvm.module.flags = !{!14, !15}
 !llvm.ident = !{!16}
 
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "d", scope: !1, file: !5, line: 7, type: !6, isLocal: false, isDefinition: true, align: 16384))
-!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "test.c", directory: "/tmp")
-!3 = !{}
-!4 = !{!0}
-!5 = !DIFile(filename: "test.c", directory: "/tmp")
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "data", file: !5, line: 2, size: 2048, elements: !7)
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "d", scope: !2, file: !3, line: 7, type: !6, isLocal: false, isDefinition: true, align: 16384)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "test.c", directory: "/tmp")
+!4 = !{}
+!5 = !{!0}
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "data", file: !3, line: 2, size: 2048, elements: !7)
 !7 = !{!8, !10}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !5, line: 3, baseType: !9, size: 8)
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !3, line: 3, baseType: !9, size: 8)
 !9 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "arr", scope: !6, file: !5, line: 4, baseType: !11, size: 16, align: 1024, offset: 1024)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "arr", scope: !6, file: !3, line: 4, baseType: !11, size: 16, align: 1024, offset: 1024)
 !11 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 16, elements: !12)
 !12 = !{!13}
 !13 = !DISubrange(count: 2)
 !14 = !{i32 2, !"Dwarf Version", i32 4}
 !15 = !{i32 2, !"Debug Info Version", i32 3}
 !16 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)"}
-!17 = distinct !DISubprogram(name: "foo", scope: !5, file: !5, line: 8, type: !18, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !1, variables: !3)
+!17 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 8, type: !18, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
 !18 = !DISubroutineType(types: !19)
 !19 = !{!20}
 !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!21 = !DILocalVariable(name: "local_data", scope: !17, file: !5, line: 10, type: !6)
+!21 = !DILocalVariable(name: "local_data", scope: !17, file: !3, line: 10, type: !6)
 !22 = !DIExpression()
 !23 = !DILocation(line: 10, column: 17, scope: !17)
 !24 = !DILocation(line: 11, column: 5, scope: !17)
+

+ 71 - 68
test/DebugInfo/X86/align_cpp11.ll

@@ -86,26 +86,26 @@ target triple = "x86_64-unknown-linux-gnu"
 %class.anon = type { i32 }
 
 @c0 = global %class.C0 zeroinitializer, align 64, !dbg !0
-@s = global %struct.S zeroinitializer, align 2048, !dbg !11
+@s = global %struct.S zeroinitializer, align 2048, !dbg !12
 
 ; Function Attrs: nounwind uwtable
-define void @_Z3foov() #0 !dbg !22 {
+define void @_Z3foov() #0 !dbg !24 {
 entry:
   %ss = alloca %struct.S, align 128
   %e = alloca i32, align 16
   %c1 = alloca %class.C1, align 1
   %i = alloca i32, align 32
   %Lambda = alloca %class.anon, align 4
-  call void @llvm.dbg.declare(metadata %struct.S* %ss, metadata !25, metadata !26), !dbg !27
-  call void @llvm.dbg.declare(metadata i32* %e, metadata !28, metadata !26), !dbg !29
-  call void @llvm.dbg.declare(metadata %class.C1* %c1, metadata !30, metadata !26), !dbg !35
-  call void @llvm.dbg.declare(metadata i32* %i, metadata !36, metadata !26), !dbg !38
-  store i32 42, i32* %i, align 32, !dbg !38
-  call void @llvm.dbg.declare(metadata %class.anon* %Lambda, metadata !39, metadata !26), !dbg !48
-  %0 = getelementptr inbounds %class.anon, %class.anon* %Lambda, i32 0, i32 0, !dbg !49
-  %1 = load i32, i32* %i, align 32, !dbg !50
-  store i32 %1, i32* %0, align 4, !dbg !49
-  ret void, !dbg !51
+  call void @llvm.dbg.declare(metadata %struct.S* %ss, metadata !27, metadata !28), !dbg !29
+  call void @llvm.dbg.declare(metadata i32* %e, metadata !30, metadata !28), !dbg !31
+  call void @llvm.dbg.declare(metadata %class.C1* %c1, metadata !32, metadata !28), !dbg !37
+  call void @llvm.dbg.declare(metadata i32* %i, metadata !38, metadata !28), !dbg !40
+  store i32 42, i32* %i, align 32, !dbg !40
+  call void @llvm.dbg.declare(metadata %class.anon* %Lambda, metadata !41, metadata !28), !dbg !50
+  %0 = getelementptr inbounds %class.anon, %class.anon* %Lambda, i32 0, i32 0, !dbg !51
+  %1 = load i32, i32* %i, align 32, !dbg !52
+  store i32 %1, i32* %0, align 4, !dbg !51
+  ret void, !dbg !53
 }
 
 ; Function Attrs: nounwind readnone
@@ -114,59 +114,62 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 attributes #0 = { nounwind uwtable }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!1}
-!llvm.module.flags = !{!19, !20}
-!llvm.ident = !{!21}
-
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c0", scope: !1, file: !5, line: 19, type: !17, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !10)
-!2 = !DIFile(filename: "test.cpp", directory: "/tmp")
-!3 = !{!4}
-!4 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !5, line: 13, size: 32, align: 128, elements: !6, identifier: "_ZTS1E")
-!5 = !DIFile(filename: "./test.cpp", directory: "/tmp")
-!6 = !{!7, !8, !9}
-!7 = !DIEnumerator(name: "A", value: 0)
-!8 = !DIEnumerator(name: "B", value: 1)
-!9 = !DIEnumerator(name: "C", value: 2)
-!10 = !{!0, !11}
-!11 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s", scope: !1, file: !5, line: 21, type: !12, isLocal: false, isDefinition: true, align: 16384))
-!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !5, line: 1, size: 2048, elements: !13, identifier: "_ZTS1S")
-!13 = !{!14, !16}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !12, file: !5, line: 2, baseType: !15, size: 8)
-!15 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
-!16 = !DIDerivedType(tag: DW_TAG_member, name: "xx", scope: !12, file: !5, line: 3, baseType: !15, size: 8, align: 1024, offset: 1024)
-!17 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C0", file: !5, line: 6, size: 512, align: 512, elements: !18, identifier: "_ZTS2C0")
-!18 = !{}
-!19 = !{i32 2, !"Dwarf Version", i32 4}
-!20 = !{i32 2, !"Debug Info Version", i32 3}
-!21 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)"}
-!22 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !5, file: !5, line: 23, type: !23, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !1, variables: !18)
-!23 = !DISubroutineType(types: !24)
-!24 = !{null}
-!25 = !DILocalVariable(name: "ss", scope: !22, file: !5, line: 25, type: !12)
-!26 = !DIExpression()
-!27 = !DILocation(line: 25, column: 7, scope: !22)
-!28 = !DILocalVariable(name: "e", scope: !22, file: !5, line: 26, type: !4)
-!29 = !DILocation(line: 26, column: 7, scope: !22)
-!30 = !DILocalVariable(name: "c1", scope: !22, file: !5, line: 27, type: !31)
-!31 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C1", file: !5, line: 9, size: 8, elements: !32, identifier: "_ZTS2C1")
-!32 = !{!33}
-!33 = !DIDerivedType(tag: DW_TAG_member, name: "p", scope: !31, file: !5, line: 10, baseType: !34, align: 512, flags: DIFlagStaticMember)
-!34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
-!35 = !DILocation(line: 27, column: 8, scope: !22)
-!36 = !DILocalVariable(name: "i", scope: !22, file: !5, line: 28, type: !37, align: 256)
-!37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!38 = !DILocation(line: 28, column: 21, scope: !22)
-!39 = !DILocalVariable(name: "Lambda", scope: !22, file: !5, line: 29, type: !40)
-!40 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !22, file: !5, line: 29, size: 32, elements: !41)
-!41 = !{!42, !43}
-!42 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !40, file: !5, line: 29, baseType: !37, size: 32, align: 256)
-!43 = !DISubprogram(name: "operator()", scope: !40, file: !5, line: 29, type: !44, isLocal: false, isDefinition: false, scopeLine: 29, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
-!44 = !DISubroutineType(types: !45)
-!45 = !{null, !46}
-!46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !47, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!47 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !40)
-!48 = !DILocation(line: 29, column: 10, scope: !22)
-!49 = !DILocation(line: 29, column: 19, scope: !22)
-!50 = !DILocation(line: 29, column: 20, scope: !22)
-!51 = !DILocation(line: 30, column: 1, scope: !22)
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!21, !22}
+!llvm.ident = !{!23}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "c0", scope: !2, file: !6, line: 19, type: !19, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !11)
+!3 = !DIFile(filename: "test.cpp", directory: "/tmp")
+!4 = !{!5}
+!5 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !6, line: 13, size: 32, align: 128, elements: !7, identifier: "_ZTS1E")
+!6 = !DIFile(filename: "./test.cpp", directory: "/tmp")
+!7 = !{!8, !9, !10}
+!8 = !DIEnumerator(name: "A", value: 0)
+!9 = !DIEnumerator(name: "B", value: 1)
+!10 = !DIEnumerator(name: "C", value: 2)
+!11 = !{!0, !12}
+!12 = distinct !DIGlobalVariableExpression(var: !13)
+!13 = !DIGlobalVariable(name: "s", scope: !2, file: !6, line: 21, type: !14, isLocal: false, isDefinition: true, align: 16384)
+!14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !6, line: 1, size: 2048, elements: !15, identifier: "_ZTS1S")
+!15 = !{!16, !18}
+!16 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !14, file: !6, line: 2, baseType: !17, size: 8)
+!17 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+!18 = !DIDerivedType(tag: DW_TAG_member, name: "xx", scope: !14, file: !6, line: 3, baseType: !17, size: 8, align: 1024, offset: 1024)
+!19 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C0", file: !6, line: 6, size: 512, align: 512, elements: !20, identifier: "_ZTS2C0")
+!20 = !{}
+!21 = !{i32 2, !"Dwarf Version", i32 4}
+!22 = !{i32 2, !"Debug Info Version", i32 3}
+!23 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)"}
+!24 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !6, file: !6, line: 23, type: !25, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !20)
+!25 = !DISubroutineType(types: !26)
+!26 = !{null}
+!27 = !DILocalVariable(name: "ss", scope: !24, file: !6, line: 25, type: !14)
+!28 = !DIExpression()
+!29 = !DILocation(line: 25, column: 7, scope: !24)
+!30 = !DILocalVariable(name: "e", scope: !24, file: !6, line: 26, type: !5)
+!31 = !DILocation(line: 26, column: 7, scope: !24)
+!32 = !DILocalVariable(name: "c1", scope: !24, file: !6, line: 27, type: !33)
+!33 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C1", file: !6, line: 9, size: 8, elements: !34, identifier: "_ZTS2C1")
+!34 = !{!35}
+!35 = !DIDerivedType(tag: DW_TAG_member, name: "p", scope: !33, file: !6, line: 10, baseType: !36, align: 512, flags: DIFlagStaticMember)
+!36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
+!37 = !DILocation(line: 27, column: 8, scope: !24)
+!38 = !DILocalVariable(name: "i", scope: !24, file: !6, line: 28, type: !39, align: 256)
+!39 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!40 = !DILocation(line: 28, column: 21, scope: !24)
+!41 = !DILocalVariable(name: "Lambda", scope: !24, file: !6, line: 29, type: !42)
+!42 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !24, file: !6, line: 29, size: 32, elements: !43)
+!43 = !{!44, !45}
+!44 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !42, file: !6, line: 29, baseType: !39, size: 32, align: 256)
+!45 = !DISubprogram(name: "operator()", scope: !42, file: !6, line: 29, type: !46, isLocal: false, isDefinition: false, scopeLine: 29, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
+!46 = !DISubroutineType(types: !47)
+!47 = !{null, !48}
+!48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !49, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!49 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !42)
+!50 = !DILocation(line: 29, column: 10, scope: !24)
+!51 = !DILocation(line: 29, column: 19, scope: !24)
+!52 = !DILocation(line: 29, column: 20, scope: !24)
+!53 = !DILocation(line: 30, column: 1, scope: !24)
+

+ 17 - 16
test/DebugInfo/X86/align_objc.ll

@@ -64,35 +64,36 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 attributes #0 = { nounwind uwtable }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!1}
+!llvm.dbg.cu = !{!2}
 !llvm.module.flags = !{!11, !12}
 !llvm.ident = !{!13}
 
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s0", scope: !1, file: !5, line: 10, type: !6, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 1, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "test.m", directory: "/tmp")
-!3 = !{}
-!4 = !{!0}
-!5 = !DIFile(filename: "test.m", directory: "/tmp")
-!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S0", file: !5, line: 3, baseType: !7)
-!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !5, line: 1, size: 1024, align: 1024, elements: !8)
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s0", scope: !2, file: !3, line: 10, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 1, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "test.m", directory: "/tmp")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S0", file: !3, line: 3, baseType: !7)
+!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 1024, align: 1024, elements: !8)
 !8 = !{!9}
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !7, file: !5, line: 2, baseType: !10, size: 8)
+!9 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !7, file: !3, line: 2, baseType: !10, size: 8)
 !10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
 !11 = !{i32 2, !"Dwarf Version", i32 4}
 !12 = !{i32 2, !"Debug Info Version", i32 3}
 !13 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)"}
-!14 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 12, type: !15, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: false, unit: !1, variables: !3)
+!14 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 12, type: !15, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: false, unit: !2, variables: !4)
 !15 = !DISubroutineType(types: !16)
 !16 = !{null}
-!17 = !DILocalVariable(name: "s1", scope: !14, file: !5, line: 13, type: !18)
-!18 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", file: !5, line: 8, baseType: !19)
-!19 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !5, line: 6, size: 512, elements: !20)
+!17 = !DILocalVariable(name: "s1", scope: !14, file: !3, line: 13, type: !18)
+!18 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", file: !3, line: 8, baseType: !19)
+!19 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 6, size: 512, elements: !20)
 !20 = !{!21}
-!21 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !5, line: 7, baseType: !10, size: 8, align: 512)
+!21 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !3, line: 7, baseType: !10, size: 8, align: 512)
 !22 = !DIExpression()
 !23 = !DILocation(line: 13, column: 6, scope: !14)
-!24 = !DILocalVariable(name: "i", scope: !14, file: !5, line: 14, type: !25, align: 256)
+!24 = !DILocalVariable(name: "i", scope: !14, file: !3, line: 14, type: !25, align: 256)
 !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
 !26 = !DILocation(line: 14, column: 37, scope: !14)
 !27 = !DILocation(line: 15, column: 1, scope: !14)
+

+ 28 - 25
test/DebugInfo/X86/arange-and-stub.ll

@@ -7,16 +7,17 @@
 ; CHECK:  .data
 ; CHECK-NEXT: .Lsec_end0:
 
+source_filename = "test/DebugInfo/X86/arange-and-stub.ll"
 target triple = "x86_64-linux-gnu"
 
 @_ZTId = external constant i8*
-@zed = global [1 x void ()*] [void ()* @bar], !dbg !11
+@zed = global [1 x void ()*] [void ()* @bar], !dbg !0
 
-define void @foo() !dbg !4 {
+define void @foo() !dbg !17 {
   ret void
 }
 
-define void @bar() personality i8* bitcast (void ()* @foo to i8*) !dbg !9 {
+define void @bar() personality i8* bitcast (void ()* @foo to i8*) !dbg !18 {
   invoke void @foo()
           to label %invoke.cont unwind label %lpad, !dbg !19
 
@@ -29,25 +30,27 @@ lpad:                                             ; preds = %0
   ret void
 }
 
-!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: FullDebug, enums: !2, retainedTypes: !2, globals: !10, imports: !2)
-!1 = !DIFile(filename: "/Users/espindola/llvm/<stdin>", directory: "/Users/espindola/llvm/build")
-!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, unit: !0, variables: !2)
-!10 = !{!11}
-!11 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zed", scope: !0, file: !5, line: 6, type: !12, isLocal: false, isDefinition: true))
-!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 64, align: 64, elements: !15)
-!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "vifunc", file: !5, line: 5, baseType: !14)
-!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
-!15 = !{!16}
-!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)
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!15, !16}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "zed", scope: !2, file: !6, line: 6, type: !7, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.7.0 (trunk 234308) (llvm/trunk 234310)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "/Users/espindola/llvm/<stdin>", directory: "/Users/espindola/llvm/build")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIFile(filename: "/Users/espindola/llvm/test.cpp", directory: "/Users/espindola/llvm/build")
+!7 = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 64, align: 64, elements: !13)
+!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "vifunc", file: !6, line: 5, baseType: !9)
+!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
+!10 = !DISubroutineType(types: !11)
+!11 = !{null, !12}
+!12 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!13 = !{!14}
+!14 = !DISubrange(count: 1)
+!15 = !{i32 2, !"Dwarf Version", i32 4}
+!16 = !{i32 2, !"Debug Info Version", i32 3}
+!17 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !6, file: !6, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!18 = distinct !DISubprogram(name: "bar_d", linkageName: "bar", scope: !6, file: !6, line: 3, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!19 = !DILocation(line: 0, scope: !18)
+

+ 16 - 13
test/DebugInfo/X86/arange.ll

@@ -20,27 +20,30 @@
 ; OBJ: debug_aranges
 ; OBJ-NEXT: R_X86_64_32 .debug_info 0x0
 
+source_filename = "test/DebugInfo/X86/arange.ll"
+
 %struct.foo = type { i8 }
 
-@f = global %struct.foo zeroinitializer, align 1, !dbg !10
+@f = global %struct.foo zeroinitializer, align 1, !dbg !0
 @i = external global i32
 
-!llvm.dbg.cu = !{!0}
+!llvm.dbg.cu = !{!9}
 !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: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !9, imports: !2)
-!1 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")
-!2 = !{}
-!3 = !{!4}
-!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo<&i>", line: 3, size: 8, align: 8, file: !1, elements: !2, templateParams: !5, identifier: "_ZTS3fooIXadL_Z1iEEE")
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 6, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")
+!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo<&i>", file: !2, line: 3, size: 8, align: 8, elements: !4, templateParams: !5, identifier: "_ZTS3fooIXadL_Z1iEEE")
+!4 = !{}
 !5 = !{!6}
-!6 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "x", type: !7, value: i32* @i)
-!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 = !{!10}
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4))
-!11 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")
+!6 = !DITemplateValueParameter(name: "x", type: !7, value: i32* @i)
+!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.5 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !10, globals: !11, imports: !4)
+!10 = !{!3}
+!11 = !{!0}
 !12 = !{i32 2, !"Dwarf Version", i32 4}
 !13 = !{i32 1, !"Debug Info Version", i32 3}
 !14 = !{!"clang version 3.5 "}
+

+ 8 - 7
test/DebugInfo/X86/atomic-c11-dwarf-4.ll

@@ -18,19 +18,20 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @i = common global i32 0, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!1}
+!llvm.dbg.cu = !{!2}
 !llvm.module.flags = !{!9, !10}
 !llvm.ident = !{!11}
 
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", scope: !1, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git cd238117e3a8a57271a82d0bb03d6df6ad8f073e) (http://llvm.org/git/llvm.git 9fd063832c1541aad3907cd60ac344d36997905f)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "atomic.c", directory: "/tmp")
-!3 = !{}
-!4 = !{!0}
-!5 = !DIFile(filename: "atomic.c", directory: "/tmp")
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "i", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git cd238117e3a8a57271a82d0bb03d6df6ad8f073e) (http://llvm.org/git/llvm.git 9fd063832c1541aad3907cd60ac344d36997905f)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "atomic.c", directory: "/tmp")
+!4 = !{}
+!5 = !{!0}
 !6 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !7)
 !7 = !DIDerivedType(tag: DW_TAG_atomic_type, baseType: !8)
 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
 !9 = !{i32 2, !"Dwarf Version", i32 4}
 !10 = !{i32 2, !"Debug Info Version", i32 3}
 !11 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git cd238117e3a8a57271a82d0bb03d6df6ad8f073e) (http://llvm.org/git/llvm.git 9fd063832c1541aad3907cd60ac344d36997905f)"}
+

+ 8 - 7
test/DebugInfo/X86/atomic-c11-dwarf-5.ll

@@ -19,19 +19,20 @@ target triple = "x86_64-unknown-linux-gnu"
 
 @i = common global i32 0, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!1}
+!llvm.dbg.cu = !{!2}
 !llvm.module.flags = !{!9, !10}
 !llvm.ident = !{!11}
 
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", scope: !1, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git cd238117e3a8a57271a82d0bb03d6df6ad8f073e) (http://llvm.org/git/llvm.git 9fd063832c1541aad3907cd60ac344d36997905f)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "atomic.c", directory: "/tmp")
-!3 = !{}
-!4 = !{!0}
-!5 = !DIFile(filename: "atomic.c", directory: "/tmp")
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "i", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git cd238117e3a8a57271a82d0bb03d6df6ad8f073e) (http://llvm.org/git/llvm.git 9fd063832c1541aad3907cd60ac344d36997905f)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "atomic.c", directory: "/tmp")
+!4 = !{}
+!5 = !{!0}
 !6 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !7)
 !7 = !DIDerivedType(tag: DW_TAG_atomic_type, baseType: !8)
 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
 !9 = !{i32 2, !"Dwarf Version", i32 5}
 !10 = !{i32 2, !"Debug Info Version", i32 3}
 !11 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git cd238117e3a8a57271a82d0bb03d6df6ad8f073e) (http://llvm.org/git/llvm.git 9fd063832c1541aad3907cd60ac344d36997905f)"}
+

+ 23 - 27
test/DebugInfo/X86/bitfields-dwarf4.ll

@@ -21,30 +21,32 @@ target triple = "x86_64-apple-macosx"
 
 %struct.PackedBits = type <{ i8, i32 }>
 
-@s = common global %struct.PackedBits zeroinitializer, align 1, !dbg !4
+@s = common global %struct.PackedBits zeroinitializer, align 1, !dbg !0
 
-!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 !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true))
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !1, line: 3, size: 40, elements: !6)
-!6 = !{!7, !9, !13}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!15, !16, !17}
+!llvm.ident = !{!18}
 
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 267633)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm")
+!4 = !{}
+!5 = !{!0}
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !3, line: 3, size: 40, elements: !7)
+!7 = !{!8, !10, !14}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !3, line: 5, baseType: !9, size: 8)
 ; 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)
-
-!8 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
-
+!9 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !3, line: 6, baseType: !11, size: 5, offset: 8)
+!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !12, line: 183, baseType: !13)
+!12 = !DIFile(filename: "/Volumes/Data/llvm/_build.ninja.release/bin/../lib/clang/3.9.0/include/stdint.h", directory: "/Volumes/Data/llvm")
+!13 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
 ; CHECK: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name{{.*}}"b"
 ; CHECK-NOT:  DW_TAG
@@ -54,12 +56,10 @@ target triple = "x86_64-apple-macosx"
 ; 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, 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, encoding: DW_ATE_unsigned)
-
+!14 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !3, line: 7, baseType: !11, size: 27, offset: 13)
+!15 = !{i32 2, !"Dwarf Version", i32 4}
+!16 = !{i32 2, !"Debug Info Version", i32 3}
+!17 = !{i32 1, !"PIC Level", i32 2}
 ; CHECK: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name{{.*}}"c"
 ; CHECK-NOT:  DW_TAG
@@ -69,9 +69,5 @@ target triple = "x86_64-apple-macosx"
 ; 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, offset: 13)
+!18 = !{!"clang version 3.9.0 (trunk 267633)"}
 
-!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)"}

+ 15 - 13
test/DebugInfo/X86/bitfields.ll

@@ -43,31 +43,33 @@
 ; CHECK-NEXT: DW_AT_data_member_location {{.*}} 08
 
 ; ModuleID = 'bitfields.c'
+source_filename = "test/DebugInfo/X86/bitfields.ll"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx"
 
 %struct.bitfield = type <{ i8, [3 x i8], i64 }>
 
-@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !4
+@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
+!llvm.dbg.cu = !{!2}
 !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: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
-!1 = !DIFile(filename: "bitfields.c", directory: "/")
-!2 = !{}
-!3 = !{!4}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true))
-!5 = !DIFile(filename: "bitfields.c", directory: "/")
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, elements: !7)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "bitfields.c", directory: "/")
+!4 = !{}
+!5 = !{!0}
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !3, line: 1, size: 96, elements: !7)
 !7 = !{!8, !10, !11, !12}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2)
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !3, line: 2, baseType: !9, size: 2)
 !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, offset: 32)
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, offset: 64)
-!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, offset: 65)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !3, line: 3, baseType: !9, size: 32, offset: 32)
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !3, line: 4, baseType: !9, size: 1, offset: 64)
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !3, line: 5, baseType: !9, size: 28, offset: 65)
 !13 = !{i32 2, !"Dwarf Version", i32 2}
 !14 = !{i32 2, !"Debug Info Version", i32 3}
 !15 = !{i32 1, !"PIC Level", i32 2}
 !16 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}
+

+ 12 - 9
test/DebugInfo/X86/c-type-units.ll

@@ -9,21 +9,24 @@
 ; so we don't produce type units for them
 ; CHECK-NOT: DW_TAG_type_unit
 
+source_filename = "test/DebugInfo/X86/c-type-units.ll"
+
 %struct.foo = type {}
 
-@f = common global %struct.foo zeroinitializer, align 1, !dbg !4
+@f = common global %struct.foo zeroinitializer, align 1, !dbg !0
 
-!llvm.dbg.cu = !{!0}
+!llvm.dbg.cu = !{!5}
 !llvm.module.flags = !{!7, !8}
 !llvm.ident = !{!9}
 
-!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}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6))
-!5 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo")
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, align: 8, file: !1, elements: !2)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo")
+!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !2, line: 1, align: 8, elements: !4)
+!4 = !{}
+!5 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.5 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !6, imports: !4)
+!6 = !{!0}
 !7 = !{i32 2, !"Dwarf Version", i32 4}
 !8 = !{i32 1, !"Debug Info Version", i32 3}
 !9 = !{!"clang version 3.5 "}
+

+ 61 - 58
test/DebugInfo/X86/concrete_out_of_line.ll

@@ -59,74 +59,77 @@
 ; CHECK: DW_TAG_inlined_subroutine
 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
 
+source_filename = "test/DebugInfo/X86/concrete_out_of_line.ll"
 
-define i32 @_ZN17nsAutoRefCnt7ReleaseEv() !dbg !5 {
+define i32 @_ZN17nsAutoRefCnt7ReleaseEv() !dbg !19 {
 entry:
-  store i32 1, i32* null, align 4, !dbg !50
-  tail call void @_Z8moz_freePv(i8* null) nounwind, !dbg !54
+  store i32 1, i32* null, align 4, !dbg !32
+  tail call void @_Z8moz_freePv(i8* null) #0, !dbg !40
   ret i32 0
 }
 
-define void @_ZN17nsAutoRefCntD1Ev() !dbg !23 {
+define void @_ZN17nsAutoRefCntD1Ev() !dbg !46 {
 entry:
-  tail call void @_Z8moz_freePv(i8* null) nounwind, !dbg !57
+  tail call void @_Z8moz_freePv(i8* null) #0, !dbg !49
   ret void
 }
 
 declare void @_Z8moz_freePv(i8*)
 
+attributes #0 = { nounwind }
+
 !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: FullDebug, file: !59, enums: !1, retainedTypes: !1, globals: !47, imports:  !1)
-!1 = !{}
-!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}
-!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, baseType: !11)
-!11 = !DICompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", line: 10, flags: DIFlagFwdDecl, file: !59)
-!12 = !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 11, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !6, scope: !13, type: !7, variables: !18)
-!13 = !DICompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", line: 10, size: 8, align: 8, file: !59, elements: !14)
-!14 = !{!12, !15}
-!15 = !DISubprogram(name: "~nsAutoRefCnt", line: 12, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !6, scope: !13, type: !16, variables: !18)
+!llvm.module.flags = !{!18}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.1 ()", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
+!1 = !DIFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src")
+!2 = !{}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "mRefCnt", scope: null, file: !1, line: 9, type: !6, isLocal: false, isDefinition: true)
+!6 = !DICompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", file: !1, line: 2, size: 32, align: 32, elements: !7)
+!7 = !{!8, !10, !15}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "mValue", scope: !6, file: !1, line: 7, baseType: !9, size: 32, align: 32)
+!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!10 = !DISubprogram(name: "nsAutoRefCnt", scope: !6, file: !1, line: 3, type: !11, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
+!11 = !DISubroutineType(types: !12)
+!12 = !{null, !13}
+!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64, align: 64, flags: DIFlagArtificial)
+!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", file: !1, line: 2, flags: DIFlagFwdDecl)
+!15 = !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", scope: !6, file: !1, line: 4, type: !16, isLocal: false, isDefinition: false, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
 !16 = !DISubroutineType(types: !17)
-!17 = !{null, !10}
-!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, 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, 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, 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)
-!35 = !DICompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", line: 2, flags: DIFlagFwdDecl, file: !59)
-!36 = !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: !37, type: !32, variables: !18)
-!37 = !DICompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", line: 2, size: 32, align: 32, file: !59, elements: !38)
-!38 = !{!39, !40, !36}
-!39 = !DIDerivedType(tag: DW_TAG_member, name: "mValue", line: 7, size: 32, align: 32, file: !59, scope: !37, baseType: !9)
-!40 = !DISubprogram(name: "nsAutoRefCnt", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !6, scope: !37, type: !41, variables: !18)
-!41 = !DISubroutineType(types: !42)
-!42 = !{null, !34}
-!43 = !{!45, !46}
-!45 = !DILocalVariable(name: "this", line: 4, arg: 1, flags: DIFlagArtificial, scope: !31, file: !6, type: !34)
-!46 = !DILocalVariable(name: "aValue", line: 4, arg: 2, scope: !31, file: !6, type: !9)
-!47 = !{!49}
-!49 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "mRefCnt", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !37))
-!50 = !DILocation(line: 5, column: 5, scope: !51, inlinedAt: !52)
-!51 = distinct !DILexicalBlock(line: 4, column: 29, file: !6, scope: !31)
-!52 = !DILocation(line: 15, scope: !53)
-!53 = distinct !DILexicalBlock(line: 14, column: 34, file: !6, scope: !5)
-!54 = !DILocation(line: 19, column: 3, scope: !55, inlinedAt: !56)
-!55 = distinct !DILexicalBlock(line: 18, column: 41, file: !6, scope: !27)
-!56 = !DILocation(line: 18, column: 41, scope: !23, inlinedAt: !52)
-!57 = !DILocation(line: 19, column: 3, scope: !55, inlinedAt: !58)
-!58 = !DILocation(line: 18, column: 41, scope: !23)
-!59 = !DIFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src")
-!60 = !{i32 1, !"Debug Info Version", i32 3}
+!17 = !{!9, !13, !9}
+!18 = !{i32 1, !"Debug Info Version", i32 3}
+!19 = distinct !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", scope: null, file: !1, line: 14, type: !20, isLocal: false, isDefinition: true, scopeLine: 14, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !24, variables: !30)
+!20 = !DISubroutineType(types: !21)
+!21 = !{!9, !22}
+!22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !23, size: 64, align: 64, flags: DIFlagArtificial)
+!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "nsAutoRefCnt", file: !1, line: 10, flags: DIFlagFwdDecl)
+!24 = !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", scope: !25, file: !1, line: 11, type: !20, isLocal: false, isDefinition: false, scopeLine: 11, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
+!25 = !DICompositeType(tag: DW_TAG_class_type, name: "nsAutoRefCnt", file: !1, line: 10, size: 8, align: 8, elements: !26)
+!26 = !{!24, !27}
+!27 = !DISubprogram(name: "~nsAutoRefCnt", scope: !25, file: !1, line: 12, type: !28, isLocal: false, isDefinition: false, scopeLine: 12, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
+!28 = !DISubroutineType(types: !29)
+!29 = !{null, !22}
+!30 = !{!31}
+!31 = !DILocalVariable(name: "this", arg: 1, scope: !19, file: !1, line: 14, type: !22, flags: DIFlagArtificial)
+!32 = !DILocation(line: 5, column: 5, scope: !33, inlinedAt: !38)
+!33 = distinct !DILexicalBlock(scope: !34, file: !1, line: 4, column: 29)
+!34 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", scope: null, file: !1, line: 4, type: !16, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !15, variables: !35)
+!35 = !{!36, !37}
+!36 = !DILocalVariable(name: "this", arg: 1, scope: !34, file: !1, line: 4, type: !13, flags: DIFlagArtificial)
+!37 = !DILocalVariable(name: "aValue", arg: 2, scope: !34, file: !1, line: 4, type: !9)
+!38 = !DILocation(line: 15, scope: !39)
+!39 = distinct !DILexicalBlock(scope: !19, file: !1, line: 14, column: 34)
+!40 = !DILocation(line: 19, column: 3, scope: !41, inlinedAt: !45)
+!41 = distinct !DILexicalBlock(scope: !42, file: !1, line: 18, column: 41)
+!42 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", scope: null, file: !1, line: 18, type: !28, isLocal: false, isDefinition: true, scopeLine: 18, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !27, variables: !43)
+!43 = !{!44}
+!44 = !DILocalVariable(name: "this", arg: 1, scope: !42, file: !1, line: 18, type: !22, flags: DIFlagArtificial)
+!45 = !DILocation(line: 18, column: 41, scope: !46, inlinedAt: !38)
+!46 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", scope: null, file: !1, line: 18, type: !28, isLocal: false, isDefinition: true, scopeLine: 18, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !27, variables: !47)
+!47 = !{!48}
+!48 = !DILocalVariable(name: "this", arg: 1, scope: !46, file: !1, line: 18, type: !22, flags: DIFlagArtificial)
+!49 = !DILocation(line: 19, column: 3, scope: !41, inlinedAt: !50)
+!50 = !DILocation(line: 18, column: 41, scope: !46)
+

+ 52 - 48
test/DebugInfo/X86/cu-ranges-odr.ll

@@ -18,77 +18,81 @@
 ; Check that we have a relocation against the .debug_ranges section.
 ; CHECK-RELOCS: R_X86_64_32 .debug_ranges 0x0
 
+source_filename = "test/DebugInfo/X86/cu-ranges-odr.ll"
+
 %class.A = type { i32 }
 
-@a = global %class.A zeroinitializer, align 4, !dbg !22
+@a = global %class.A zeroinitializer, align 4, !dbg !0
 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
 
-define internal void @__cxx_global_var_init() section ".text.startup" !dbg !14 {
+define internal void @__cxx_global_var_init() section ".text.startup" !dbg !18 {
 entry:
-  call void @_ZN1AC2Ei(%class.A* @a, i32 0), !dbg !26
-  ret void, !dbg !26
+  call void @_ZN1AC2Ei(%class.A* @a, i32 0), !dbg !21
+  ret void, !dbg !21
 }
 
 ; Function Attrs: nounwind uwtable
-define linkonce_odr void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 !dbg !18 {
+define linkonce_odr void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 !dbg !22 {
 entry:
   %this.addr = alloca %class.A*, align 8
   %i.addr = alloca i32, align 4
   store %class.A* %this, %class.A** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !27, metadata !DIExpression()), !dbg !29
+  call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !23, metadata !25), !dbg !26
   store i32 %i, i32* %i.addr, align 4
-  call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !30, metadata !DIExpression()), !dbg !31
+  call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !27, metadata !25), !dbg !28
   %this1 = load %class.A*, %class.A** %this.addr
-  %a = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 0, !dbg !31
-  %0 = load i32, i32* %i.addr, align 4, !dbg !31
-  store i32 %0, i32* %a, align 4, !dbg !31
-  ret void, !dbg !31
+  %a = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 0, !dbg !28
+  %0 = load i32, i32* %i.addr, align 4, !dbg !28
+  store i32 %0, i32* %a, align 4, !dbg !28
+  ret void, !dbg !28
 }
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
-define internal void @_GLOBAL__I_a() section ".text.startup" !dbg !19 {
+define internal void @_GLOBAL__I_a() section ".text.startup" !dbg !29 {
 entry:
-  call void @__cxx_global_var_init(), !dbg !32
-  ret void, !dbg !32
+  call void @__cxx_global_var_init(), !dbg !31
+  ret void, !dbg !31
 }
 
 attributes #0 = { nounwind uwtable "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!23, !24}
-!llvm.ident = !{!25}
+!llvm.dbg.cu = !{!11}
+!llvm.module.flags = !{!15, !16}
+!llvm.ident = !{!17}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 8, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "baz.cpp", directory: "/usr/local/google/home/echristo/tmp")
+!3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, size: 32, align: 32, elements: !4, identifier: "_ZTS1A")
+!4 = !{!5, !7}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !3, file: !2, line: 5, baseType: !6, size: 32, align: 32, flags: DIFlagPrivate)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DISubprogram(name: "A", scope: !3, file: !2, line: 3, type: !8, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10, !6}
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!11 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.5 (trunk 199923) (llvm/trunk 199940)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !12, retainedTypes: !13, globals: !14, imports: !12)
+!12 = !{}
+!13 = !{!3}
+!14 = !{!0}
+!15 = !{i32 2, !"Dwarf Version", i32 4}
+!16 = !{i32 1, !"Debug Info Version", i32 3}
+!17 = !{!"clang version 3.5 (trunk 199923) (llvm/trunk 199940)"}
+!18 = distinct !DISubprogram(name: "__cxx_global_var_init", scope: !2, file: !2, line: 8, type: !19, isLocal: true, isDefinition: true, scopeLine: 8, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !11, variables: !12)
+!19 = !DISubroutineType(types: !20)
+!20 = !{null}
+!21 = !DILocation(line: 8, scope: !18)
+!22 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", scope: !3, file: !2, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !11, declaration: !7, variables: !12)
+!23 = !DILocalVariable(name: "this", arg: 1, scope: !22, type: !24, flags: DIFlagArtificial | DIFlagObjectPointer)
+!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64)
+!25 = !DIExpression()
+!26 = !DILocation(line: 0, scope: !22)
+!27 = !DILocalVariable(name: "i", arg: 2, scope: !22, file: !2, line: 3, type: !6)
+!28 = !DILocation(line: 3, scope: !22)
+!29 = distinct !DISubprogram(linkageName: "_GLOBAL__I_a", scope: !2, file: !2, line: 3, type: !30, isLocal: true, isDefinition: true, scopeLine: 3, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, unit: !11, variables: !12)
+!30 = !DISubroutineType(types: !12)
+!31 = !DILocation(line: 3, scope: !29)
 
-!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: !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: !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: !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, 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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 8, isLocal: false, isDefinition: true, scope: null, file: !15, type: !4))
-!23 = !{i32 2, !"Dwarf Version", i32 4}
-!24 = !{i32 1, !"Debug Info Version", i32 3}
-!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: !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)
-!32 = !DILocation(line: 3, scope: !19)

+ 23 - 21
test/DebugInfo/X86/data_member_location.ll

@@ -26,28 +26,30 @@
 ; DWARF2-NOT: DW_TAG
 ; DWARF2: DW_AT_data_member_location {{.*}} (<0x02> 23 04 )
 
+source_filename = "test/DebugInfo/X86/data_member_location.ll"
+
 %struct.foo = type { i8, i32 }
 
-@f = global %struct.foo zeroinitializer, align 4, !dbg !11
-
-!llvm.dbg.cu = !{!0}
-!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: 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: !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: !4, baseType: !9)
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = !{!11}
-!11 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !12, type: !4))
-!12 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")
+@f = global %struct.foo zeroinitializer, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!9}
+!llvm.module.flags = !{!13, !14}
+!llvm.ident = !{!15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 6, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")
+!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !2, line: 1, size: 64, align: 32, elements: !4, identifier: "_ZTS3foo")
+!4 = !{!5, !7}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !3, file: !2, line: 2, baseType: !6, size: 8, align: 8)
+!6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!7 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !3, file: !2, line: 3, baseType: !8, size: 32, align: 32, offset: 32)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, retainedTypes: !11, globals: !12, imports: !10)
+!10 = !{}
+!11 = !{!3}
+!12 = !{!0}
 !13 = !{i32 2, !"Dwarf Version", i32 4}
-!14 = !{!"clang version 3.4 "}
+!14 = !{i32 1, !"Debug Info Version", i32 3}
+!15 = !{!"clang version 3.4 "}
 
-!15 = !{i32 1, !"Debug Info Version", i32 3}

+ 28 - 23
test/DebugInfo/X86/dbg-subrange.ll

@@ -1,34 +1,39 @@
 ; RUN: llc -O0 < %s | FileCheck %s
 ; Radar 10464995
+source_filename = "test/DebugInfo/X86/dbg-subrange.ll"
 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.7.2"
 
-@s = common global [4294967296 x i8] zeroinitializer, align 16, !dbg !13
+@s = common global [4294967296 x i8] zeroinitializer, align 16, !dbg !0
 ; CHECK: .quad 4294967296 ## DW_AT_count
 
-define void @bar() nounwind uwtable ssp !dbg !5 {
+; Function Attrs: nounwind ssp uwtable
+define void @bar() #0 !dbg !11 {
 entry:
-  store i8 97, i8* getelementptr inbounds ([4294967296 x i8], [4294967296 x i8]* @s, i32 0, i64 0), align 1, !dbg !18
-  ret void, !dbg !20
+  store i8 97, i8* getelementptr inbounds ([4294967296 x i8], [4294967296 x i8]* @s, i32 0, i64 0), align 1, !dbg !14
+  ret void, !dbg !16
 }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!22}
+attributes #0 = { nounwind ssp uwtable }
+
+!llvm.dbg.cu = !{!7}
+!llvm.module.flags = !{!10}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "s", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "small.c", directory: "/private/tmp")
+!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 34359738368, align: 8, elements: !5)
+!4 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!5 = !{!6}
+!6 = !DISubrange(count: 4294967296)
+!7 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.1 (trunk 144833)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !8, retainedTypes: !8, globals: !9, imports: !8)
+!8 = !{}
+!9 = !{!0}
+!10 = !{i32 1, !"Debug Info Version", i32 3}
+!11 = distinct !DISubprogram(name: "bar", scope: !2, file: !2, line: 4, type: !12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !7)
+!12 = !DISubroutineType(types: !13)
+!13 = !{null}
+!14 = !DILocation(line: 5, column: 3, scope: !15)
+!15 = distinct !DILexicalBlock(scope: !11, file: !2, line: 4, column: 1)
+!16 = !DILocation(line: 6, column: 1, scope: !15)
 
-!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 = !{}
-!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}
-!11 = !{!13}
-!13 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "s", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14))
-!14 = !DICompositeType(tag: DW_TAG_array_type, size: 34359738368, align: 8, baseType: !15, elements: !16)
-!15 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!16 = !{!17}
-!17 = !DISubrange(count: 4294967296)
-!18 = !DILocation(line: 5, column: 3, scope: !19)
-!19 = distinct !DILexicalBlock(line: 4, column: 1, file: !21, scope: !5)
-!20 = !DILocation(line: 6, column: 1, scope: !19)
-!21 = !DIFile(filename: "small.c", directory: "/private/tmp")
-!22 = !{i32 1, !"Debug Info Version", i32 3}

+ 71 - 58
test/DebugInfo/X86/dbg-value-inlined-parameter.ll

@@ -39,78 +39,91 @@
 ;CHECK: DW_AT_abstract_origin {{.*}} "nums"
 ;CHECK-NOT: DW_TAG_formal_parameter
 
+source_filename = "test/DebugInfo/X86/dbg-value-inlined-parameter.ll"
+
 %struct.S1 = type { float*, i32 }
 
-@p = common global %struct.S1 zeroinitializer, align 8, !dbg !19
+@p = common global %struct.S1 zeroinitializer, align 8, !dbg !0
 
-define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) nounwind optsize ssp !dbg !0 {
+; Function Attrs: nounwind optsize ssp
+define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) #0 !dbg !15 {
 entry:
-  tail call void @llvm.dbg.value(metadata %struct.S1* %sp, i64 0, metadata !9, metadata !DIExpression()), !dbg !20
-  tail call void @llvm.dbg.value(metadata i32 %nums, i64 0, metadata !18, metadata !DIExpression()), !dbg !21
-  %tmp2 = getelementptr inbounds %struct.S1, %struct.S1* %sp, i64 0, i32 1, !dbg !22
-  store i32 %nums, i32* %tmp2, align 4, !dbg !22
-  %call = tail call float* @bar(i32 %nums) nounwind optsize, !dbg !27
+  tail call void @llvm.dbg.value(metadata %struct.S1* %sp, i64 0, metadata !19, metadata !22), !dbg !23
+  tail call void @llvm.dbg.value(metadata i32 %nums, i64 0, metadata !21, metadata !22), !dbg !24
+  %tmp2 = getelementptr inbounds %struct.S1, %struct.S1* %sp, i64 0, i32 1, !dbg !25
+  store i32 %nums, i32* %tmp2, align 4, !dbg !25
+  %call = tail call float* @bar(i32 %nums) #3, !dbg !27
   %tmp5 = getelementptr inbounds %struct.S1, %struct.S1* %sp, i64 0, i32 0, !dbg !27
   store float* %call, float** %tmp5, align 8, !dbg !27
-  %cmp = icmp ne float* %call, null, !dbg !29
-  %cond = zext i1 %cmp to i32, !dbg !29
-  ret i32 %cond, !dbg !29
+  %cmp = icmp ne float* %call, null, !dbg !28
+  %cond = zext i1 %cmp to i32, !dbg !28
+  ret i32 %cond, !dbg !28
 }
 
-declare float* @bar(i32) optsize
+; Function Attrs: optsize
+declare float* @bar(i32) #1
 
-define void @foobar() nounwind optsize ssp !dbg !6 {
+; Function Attrs: nounwind optsize ssp
+define void @foobar() #0 !dbg !29 {
 entry:
-  tail call void @llvm.dbg.value(metadata %struct.S1* @p, i64 0, metadata !9, metadata !DIExpression()) nounwind, !dbg !31
-  tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !18, metadata !DIExpression()) nounwind, !dbg !35
+  tail call void @llvm.dbg.value(metadata %struct.S1* @p, i64 0, metadata !19, metadata !22) #4, !dbg !32
+  tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !21, metadata !22) #4, !dbg !35
   store i32 1, i32* getelementptr inbounds (%struct.S1, %struct.S1* @p, i64 0, i32 1), align 8, !dbg !36
-  %call.i = tail call float* @bar(i32 1) nounwind optsize, !dbg !37
+  %call.i = tail call float* @bar(i32 1) #3, !dbg !37
   store float* %call.i, float** getelementptr inbounds (%struct.S1, %struct.S1* @p, i64 0, i32 0), align 8, !dbg !37
   ret void, !dbg !38
 }
 
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
+
+attributes #0 = { nounwind optsize ssp }
+attributes #1 = { optsize }
+attributes #2 = { nounwind readnone }
+attributes #3 = { nounwind optsize }
+attributes #4 = { nounwind }
 
 !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, 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: 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, 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)
-!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !11)
-!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", line: 4, file: !42, scope: !2, baseType: !12)
-!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "S1", line: 1, size: 128, align: 64, file: !42, scope: !2, elements: !13)
-!13 = !{!14, !17}
-!14 = !DIDerivedType(tag: DW_TAG_member, name: "m", line: 2, size: 64, align: 64, file: !42, scope: !1, baseType: !15)
-!15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !16)
-!16 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
-!17 = !DIDerivedType(tag: DW_TAG_member, name: "nums", line: 3, size: 32, align: 32, offset: 64, file: !42, scope: !1, baseType: !5)
-!18 = !DILocalVariable(name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5)
-!19 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "p", line: 14, isLocal: false, isDefinition: true, scope: !2, file: !1, type: !11))
-!20 = !DILocation(line: 7, column: 13, scope: !0)
-!21 = !DILocation(line: 7, column: 21, scope: !0)
-!22 = !DILocation(line: 9, column: 3, scope: !23)
-!23 = distinct !DILexicalBlock(line: 8, column: 1, file: !1, scope: !0)
-!27 = !DILocation(line: 10, column: 3, scope: !23)
-!29 = !DILocation(line: 11, column: 3, scope: !23)
-!30 = !{%struct.S1* @p}
-!31 = !DILocation(line: 7, column: 13, scope: !0, inlinedAt: !32)
-!32 = !DILocation(line: 16, column: 3, scope: !33)
-!33 = distinct !DILexicalBlock(line: 15, column: 15, file: !1, scope: !6)
-!34 = !{i32 1}
-!35 = !DILocation(line: 7, column: 21, scope: !0, inlinedAt: !32)
-!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)
-!40 = !{!19}
-!41 = !{!9, !18}
-!42 = !DIFile(filename: "nm2.c", directory: "/private/tmp")
-!43 = !{i32 1, !"Debug Info Version", i32 3}
-!44 = !{}
+!llvm.module.flags = !{!14}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "p", scope: !2, file: !3, line: 14, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 2.9 (trunk 125693)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "nm2.c", directory: "/private/tmp")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", scope: !2, file: !3, line: 4, baseType: !7)
+!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "S1", scope: !2, file: !3, line: 1, size: 128, align: 64, elements: !8)
+!8 = !{!9, !12}
+!9 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !3, file: !3, line: 2, baseType: !10, size: 64, align: 64)
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !2, baseType: !11, size: 64, align: 64)
+!11 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "nums", scope: !3, file: !3, line: 3, baseType: !13, size: 32, align: 32, offset: 64)
+!13 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!14 = !{i32 1, !"Debug Info Version", i32 3}
+!15 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 8, type: !16, isLocal: false, isDefinition: true, scopeLine: 8, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !18)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!13}
+!18 = !{!19, !21}
+!19 = !DILocalVariable(name: "sp", arg: 1, scope: !15, file: !3, line: 7, type: !20)
+!20 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !2, baseType: !6, size: 64, align: 64)
+!21 = !DILocalVariable(name: "nums", arg: 2, scope: !15, file: !3, line: 7, type: !13)
+!22 = !DIExpression()
+!23 = !DILocation(line: 7, column: 13, scope: !15)
+!24 = !DILocation(line: 7, column: 21, scope: !15)
+!25 = !DILocation(line: 9, column: 3, scope: !26)
+!26 = distinct !DILexicalBlock(scope: !15, file: !3, line: 8, column: 1)
+!27 = !DILocation(line: 10, column: 3, scope: !26)
+!28 = !DILocation(line: 11, column: 3, scope: !26)
+!29 = distinct !DISubprogram(name: "foobar", scope: !3, file: !3, line: 15, type: !30, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2)
+!30 = !DISubroutineType(types: !31)
+!31 = !{null}
+!32 = !DILocation(line: 7, column: 13, scope: !15, inlinedAt: !33)
+!33 = !DILocation(line: 16, column: 3, scope: !34)
+!34 = distinct !DILexicalBlock(scope: !29, file: !3, line: 15, column: 15)
+!35 = !DILocation(line: 7, column: 21, scope: !15, inlinedAt: !33)
+!36 = !DILocation(line: 9, column: 3, scope: !26, inlinedAt: !33)
+!37 = !DILocation(line: 10, column: 3, scope: !26, inlinedAt: !33)
+!38 = !DILocation(line: 17, column: 1, scope: !34)
+

+ 46 - 42
test/DebugInfo/X86/dbg-value-regmask-clobber.ll

@@ -33,18 +33,19 @@
 ; DWARF-NEXT:                     Location description: 52 93 04
 
 ; ModuleID = 't.cpp'
+source_filename = "test/DebugInfo/X86/dbg-value-regmask-clobber.ll"
 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, !dbg !15
+@x = common global i32 0, align 4, !dbg !0
 
 ; Function Attrs: nounwind uwtable
-define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 !dbg !4 {
+define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 !dbg !12 {
 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
+  tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !19, metadata !21), !dbg !22
+  tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !20, metadata !21), !dbg !23
   store volatile i32 1, i32* @x, align 4, !dbg !24, !tbaa !25
-  tail call void @clobber() #3, !dbg !29
+  tail call void @clobber() #2, !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
@@ -55,6 +56,7 @@ if.then:                                          ; preds = %entry
   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
 
@@ -65,52 +67,54 @@ if.end:                                           ; preds = %if.else, %if.then
 declare void @clobber()
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 
 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}
+attributes #1 = { nounwind readnone }
+attributes #2 = { nounwind }
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9, !10}
+!llvm.ident = !{!11}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
 !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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !16, isLocal: false, isDefinition: true))
-!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)"}
+!8 = !{i32 2, !"Dwarf Version", i32 4}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{i32 1, !"PIC Level", i32 2}
+!11 = !{!"clang version 3.9.0 (trunk 260617) (llvm/trunk 260619)"}
+!12 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 4, type: !13, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !18)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!7, !7, !15}
+!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, align: 64)
+!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 64, align: 64)
+!17 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!18 = !{!19, !20}
+!19 = !DILocalVariable(name: "argv", arg: 2, scope: !12, file: !3, line: 4, type: !15)
+!20 = !DILocalVariable(name: "argc", arg: 1, scope: !12, file: !3, line: 4, type: !7)
 !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)
+!22 = !DILocation(line: 4, column: 27, scope: !12)
+!23 = !DILocation(line: 4, column: 14, scope: !12)
+!24 = !DILocation(line: 5, column: 5, scope: !12)
 !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)
+!29 = !DILocation(line: 6, column: 3, scope: !12)
+!30 = !DILocation(line: 7, column: 5, scope: !12)
 !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)
+!32 = distinct !DILexicalBlock(scope: !12, file: !3, line: 8, column: 7)
+!33 = !DILocation(line: 8, column: 7, scope: !12)
 !34 = !DILocation(line: 9, column: 7, scope: !35)
-!35 = distinct !DILexicalBlock(scope: !32, file: !1, line: 8, column: 10)
+!35 = distinct !DILexicalBlock(scope: !32, file: !3, 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)
+!38 = distinct !DILexicalBlock(scope: !32, file: !3, line: 10, column: 10)
+!39 = !DILocation(line: 13, column: 1, scope: !12)
+

+ 53 - 49
test/DebugInfo/X86/debug-info-access.ll

@@ -84,6 +84,7 @@
 ; CHECK-NOT: DW_TAG
 ;
 ; ModuleID = '/llvm/tools/clang/test/CodeGenCXX/debug-info-access.cpp'
+source_filename = "test/DebugInfo/X86/debug-info-access.ll"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.10.0"
 
@@ -91,59 +92,62 @@ target triple = "x86_64-apple-macosx10.10.0"
 %class.B = type { i8 }
 %union.U = type { i32 }
 
-@a = global %struct.A zeroinitializer, align 1, !dbg !35
-@b = global %class.B zeroinitializer, align 1, !dbg !36
-@u = global %union.U zeroinitializer, align 4, !dbg !37
+@a = global %struct.A zeroinitializer, align 1, !dbg !0
+@b = global %class.B zeroinitializer, align 1, !dbg !11
+@u = global %union.U zeroinitializer, align 4, !dbg !23
 
 ; Function Attrs: nounwind ssp uwtable
-define void @_Z4freev() #0 !dbg !30 {
-  ret void, !dbg !41
+define void @_Z4freev() #0 !dbg !39 {
+  ret void, !dbg !42
 }
 
 attributes #0 = { nounwind ssp uwtable }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!38, !39}
-!llvm.ident = !{!40}
+!llvm.dbg.cu = !{!32}
+!llvm.module.flags = !{!36, !37}
+!llvm.ident = !{!38}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 37, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "/llvm/tools/clang/test/CodeGenCXX/debug-info-access.cpp", directory: "")
+!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !2, line: 3, size: 8, align: 8, elements: !4, identifier: "_ZTS1A")
+!4 = !{!5, !7}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "pub_default_static", scope: !3, file: !2, line: 7, baseType: !6, flags: DIFlagStaticMember)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DISubprogram(name: "pub_default", linkageName: "_ZN1A11pub_defaultEv", scope: !3, file: !2, line: 5, type: !8, isLocal: false, isDefinition: false, scopeLine: 5, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10}
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!11 = !DIGlobalVariableExpression(var: !12)
+!12 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 38, type: !13, isLocal: false, isDefinition: true)
+!13 = !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !2, line: 11, size: 8, align: 8, elements: !14, identifier: "_ZTS1B")
+!14 = !{!15, !16, !17, !21, !22}
+!15 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !13, baseType: !3, flags: DIFlagPublic)
+!16 = !DIDerivedType(tag: DW_TAG_member, name: "public_static", scope: !13, file: !2, line: 16, baseType: !6, flags: DIFlagPublic | DIFlagStaticMember)
+!17 = !DISubprogram(name: "pub", linkageName: "_ZN1B3pubEv", scope: !13, file: !2, line: 14, type: !18, isLocal: false, isDefinition: false, scopeLine: 14, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
+!18 = !DISubroutineType(types: !19)
+!19 = !{null, !20}
+!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!21 = !DISubprogram(name: "prot", linkageName: "_ZN1B4protEv", scope: !13, file: !2, line: 19, type: !18, isLocal: false, isDefinition: false, scopeLine: 19, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false)
+!22 = !DISubprogram(name: "priv_default", linkageName: "_ZN1B12priv_defaultEv", scope: !13, file: !2, line: 22, type: !18, isLocal: false, isDefinition: false, scopeLine: 22, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false)
+!23 = !DIGlobalVariableExpression(var: !24)
+!24 = !DIGlobalVariable(name: "u", scope: null, file: !2, line: 39, type: !25, isLocal: false, isDefinition: true)
+!25 = !DICompositeType(tag: DW_TAG_union_type, name: "U", file: !2, line: 25, size: 32, align: 32, elements: !26, identifier: "_ZTS1U")
+!26 = !{!27, !28}
+!27 = !DIDerivedType(tag: DW_TAG_member, name: "union_priv", scope: !25, file: !2, line: 30, baseType: !6, size: 32, align: 32, flags: DIFlagPrivate)
+!28 = !DISubprogram(name: "union_pub_default", linkageName: "_ZN1U17union_pub_defaultEv", scope: !25, file: !2, line: 27, type: !29, isLocal: false, isDefinition: false, scopeLine: 27, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false)
+!29 = !DISubroutineType(types: !30)
+!30 = !{null, !31}
+!31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !25, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!32 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.6.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !33, retainedTypes: !34, globals: !35, imports: !33)
+!33 = !{}
+!34 = !{!3, !13, !25}
+!35 = !{!0, !11, !23}
+!36 = !{i32 2, !"Dwarf Version", i32 2}
+!37 = !{i32 2, !"Debug Info Version", i32 3}
+!38 = !{!"clang version 3.6.0 "}
+!39 = distinct !DISubprogram(name: "free", linkageName: "_Z4freev", scope: !2, file: !2, line: 35, type: !40, isLocal: false, isDefinition: true, scopeLine: 35, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !32, variables: !33)
+!40 = !DISubroutineType(types: !41)
+!41 = !{null}
+!42 = !DILocation(line: 35, column: 14, scope: !39)
 
-!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: !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: !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: !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: !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: !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: !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: !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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !4))
-!36 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !12))
-!37 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "u", line: 39, isLocal: false, isDefinition: true, scope: null, file: !31, type: !22))
-!38 = !{i32 2, !"Dwarf Version", i32 2}
-!39 = !{i32 2, !"Debug Info Version", i32 3}
-!40 = !{!"clang version 3.6.0 "}
-!41 = !DILocation(line: 35, column: 14, scope: !30)

+ 67 - 67
test/DebugInfo/X86/debug-info-packed-struct.ll

@@ -1,8 +1,8 @@
 ; Generated from tools/clang/test/CodeGen/debug-info-packed-struct.c
 ; ModuleID = 'llvm/tools/clang/test/CodeGen/debug-info-packed-struct.c'
+source_filename = "test/DebugInfo/X86/debug-info-packed-struct.ll"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-darwin"
-
 ; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s
 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
 ; REQUIRES: object-emission
@@ -22,6 +22,8 @@ target triple = "x86_64-apple-darwin"
 
 %struct.layout0 = type { i8, %struct.size8, i8 }
 %struct.size8 = type { i64 }
+%struct.layout1 = type <{ i8, %struct.size8_anon, i8, [2 x i8] }>
+%struct.size8_anon = type { i64 }
 ; CHECK:  DW_TAG_structure_type
 ; CHECK:      DW_AT_name {{.*}} "layout0"
 ; CHECK:      DW_AT_byte_size {{.*}} (0x18)
@@ -37,7 +39,6 @@ target triple = "x86_64-apple-darwin"
 ; CHECK:          DW_AT_bit_offset {{.*}} (0x1f)
 ; CHECK:          DW_AT_data_member_location {{.*}}10
 
-
 ; // ---------------------------------------------------------------------
 ; // Implicitly packed.
 ; // ---------------------------------------------------------------------
@@ -51,8 +52,10 @@ target triple = "x86_64-apple-darwin"
 ;   int l1_ofs9 : 1;
 ; } l1;
 
-%struct.layout1 = type <{ i8, %struct.size8_anon, i8, [2 x i8] }>
-%struct.size8_anon = type { i64 }
+%struct.layout2 = type <{ i8, %struct.size8_pack1, i8 }>
+%struct.size8_pack1 = type { i64 }
+%struct.layout3 = type <{ i8, [3 x i8], %struct.size8_pack4, i8, [3 x i8] }>
+%struct.size8_pack4 = type { i64 }
 
 ; CHECK:  DW_TAG_structure_type
 ; CHECK:      DW_AT_name {{.*}} "layout1"
@@ -85,9 +88,8 @@ target triple = "x86_64-apple-darwin"
 ; } l2;
 ; #pragma pack()
 
-%struct.layout2 = type <{ i8, %struct.size8_pack1, i8 }>
-%struct.size8_pack1 = type { i64 }
-
+@l0 = common global %struct.layout0 zeroinitializer, align 8, !dbg !0
+@l1 = common global %struct.layout1 zeroinitializer, align 4, !dbg !6
 ; CHECK:  DW_TAG_structure_type
 ; CHECK:      DW_AT_name {{.*}} "layout2"
 ; CHECK:      DW_AT_byte_size {{.*}} (0x0a)
@@ -119,10 +121,8 @@ target triple = "x86_64-apple-darwin"
 ; } l 3;
 ; #pragma pack()
 
-
-%struct.layout3 = type <{ i8, [3 x i8], %struct.size8_pack4, i8, [3 x i8] }>
-%struct.size8_pack4 = type { i64 }
-
+@l2 = common global %struct.layout2 zeroinitializer, align 1, !dbg !17
+@l3 = common global %struct.layout3 zeroinitializer, align 4, !dbg !29
 ; CHECK:  DW_TAG_structure_type
 ; CHECK:      DW_AT_name {{.*}} "layout3"
 ; CHECK:      DW_AT_byte_size {{.*}} (0x10)
@@ -139,60 +139,60 @@ target triple = "x86_64-apple-darwin"
 ; CHECK:          DW_AT_bit_offset {{.*}} (0x1f)
 ; CHECK:          DW_AT_data_member_location {{.*}}0c
 
-@l0 = common global %struct.layout0 zeroinitializer, align 8, !dbg !4
-@l1 = common global %struct.layout1 zeroinitializer, align 4, !dbg !18
-@l2 = common global %struct.layout2 zeroinitializer, align 1, !dbg !25
-@l3 = common global %struct.layout3 zeroinitializer, align 4, !dbg !35
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!45, !46}
-!llvm.ident = !{!47}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!49, !50}
+!llvm.ident = !{!51}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "l0", scope: !2, file: !8, line: 88, type: !40, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/<stdin>", directory: "/llvm/_build.ninja.release")
+!4 = !{}
+!5 = !{!0, !6, !17, !29}
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "l1", scope: !2, file: !8, line: 89, type: !9, isLocal: false, isDefinition: true)
+!8 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/debug-info-packed-struct.c", directory: "/llvm/_build.ninja.release")
+!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout1", file: !8, line: 34, size: 96, elements: !10)
+!10 = !{!11, !13, !15}
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs0", scope: !9, file: !8, line: 35, baseType: !12, size: 8)
+!12 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+!13 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs1", scope: !9, file: !8, line: 36, baseType: !14, size: 64, offset: 8)
+!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_anon", file: !8, line: 30, size: 64, elements: !4)
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs9", scope: !9, file: !8, line: 37, baseType: !16, size: 1, offset: 72)
+!16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!17 = !DIGlobalVariableExpression(var: !18)
+!18 = !DIGlobalVariable(name: "l2", scope: !2, file: !8, line: 90, type: !19, isLocal: false, isDefinition: true)
+!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout2", file: !8, line: 54, size: 80, elements: !20)
+!20 = !{!21, !22, !28}
+!21 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs0", scope: !19, file: !8, line: 55, baseType: !12, size: 8)
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs1", scope: !19, file: !8, line: 56, baseType: !23, size: 64, offset: 8)
+!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack1", file: !8, line: 50, size: 64, elements: !24)
+!24 = !{!25, !26}
+!25 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !23, file: !8, line: 51, baseType: !16, size: 4)
+!26 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !23, file: !8, line: 52, baseType: !27, size: 60, offset: 4)
+!27 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed)
+!28 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs9", scope: !19, file: !8, line: 57, baseType: !16, size: 1, offset: 72)
+!29 = !DIGlobalVariableExpression(var: !30)
+!30 = !DIGlobalVariable(name: "l3", scope: !2, file: !8, line: 91, type: !31, isLocal: false, isDefinition: true)
+!31 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout3", file: !8, line: 76, size: 128, elements: !32)
+!32 = !{!33, !34, !39}
+!33 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs0", scope: !31, file: !8, line: 77, baseType: !12, size: 8)
+!34 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs4", scope: !31, file: !8, line: 78, baseType: !35, size: 64, offset: 32)
+!35 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack4", file: !8, line: 72, size: 64, elements: !36)
+!36 = !{!37, !38}
+!37 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !35, file: !8, line: 73, baseType: !16, size: 4)
+!38 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !35, file: !8, line: 74, baseType: !27, size: 60, offset: 4)
+!39 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs12", scope: !31, file: !8, line: 79, baseType: !16, size: 1, offset: 96)
+!40 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout0", file: !8, line: 15, size: 192, elements: !41)
+!41 = !{!42, !43, !48}
+!42 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs0", scope: !40, file: !8, line: 16, baseType: !12, size: 8)
+!43 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs8", scope: !40, file: !8, line: 17, baseType: !44, size: 64, offset: 64)
+!44 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8", file: !8, line: 11, size: 64, elements: !45)
+!45 = !{!46, !47}
+!46 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !44, file: !8, line: 12, baseType: !16, size: 4)
+!47 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !44, file: !8, line: 13, baseType: !27, size: 60, offset: 4)
+!48 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs16", scope: !40, file: !8, line: 18, baseType: !16, size: 1, offset: 128)
+!49 = !{i32 2, !"Dwarf Version", i32 2}
+!50 = !{i32 2, !"Debug Info Version", i32 3}
+!51 = !{!"clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)"}
 
-!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}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "l0", scope: !0, file: !5, line: 88, type: !6, isLocal: false, isDefinition: true))
-!5 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/debug-info-packed-struct.c", directory: "/llvm/_build.ninja.release")
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout0", file: !5, line: 15, size: 192, elements: !7)
-!7 = !{!8, !10, !17}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs0", scope: !6, file: !5, line: 16, baseType: !9, size: 8)
-!9 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs8", scope: !6, file: !5, line: 17, baseType: !11, size: 64, offset: 64)
-!11 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8", file: !5, line: 11, size: 64, elements: !12)
-!12 = !{!13, !15}
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !11, file: !5, line: 12, baseType: !14, size: 4)
-!14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!15 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !11, file: !5, line: 13, baseType: !16, size: 60, offset: 4)
-!16 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed)
-!17 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs16", scope: !6, file: !5, line: 18, baseType: !14, size: 1, offset: 128)
-!18 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "l1", scope: !0, file: !5, line: 89, type: !19, isLocal: false, isDefinition: true))
-!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout1", file: !5, line: 34, size: 96, elements: !20)
-!20 = !{!21, !22, !24}
-!21 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs0", scope: !19, file: !5, line: 35, baseType: !9, size: 8)
-!22 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs1", scope: !19, file: !5, line: 36, baseType: !23, size: 64, offset: 8)
-!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_anon", file: !5, line: 30, size: 64, elements: !2)
-!24 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs9", scope: !19, file: !5, line: 37, baseType: !14, size: 1, offset: 72)
-!25 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "l2", scope: !0, file: !5, line: 90, type: !26, isLocal: false, isDefinition: true))
-!26 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout2", file: !5, line: 54, size: 80, elements: !27)
-!27 = !{!28, !29, !34}
-!28 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs0", scope: !26, file: !5, line: 55, baseType: !9, size: 8)
-!29 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs1", scope: !26, file: !5, line: 56, baseType: !30, size: 64, offset: 8)
-!30 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack1", file: !5, line: 50, size: 64, elements: !31)
-!31 = !{!32, !33}
-!32 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !30, file: !5, line: 51, baseType: !14, size: 4)
-!33 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !30, file: !5, line: 52, baseType: !16, size: 60, offset: 4)
-!34 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs9", scope: !26, file: !5, line: 57, baseType: !14, size: 1, offset: 72)
-!35 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "l3", scope: !0, file: !5, line: 91, type: !36, isLocal: false, isDefinition: true))
-!36 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout3", file: !5, line: 76, size: 128, elements: !37)
-!37 = !{!38, !39, !44}
-!38 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs0", scope: !36, file: !5, line: 77, baseType: !9, size: 8)
-!39 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs4", scope: !36, file: !5, line: 78, baseType: !40, size: 64, offset: 32)
-!40 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack4", file: !5, line: 72, size: 64, elements: !41)
-!41 = !{!42, !43}
-!42 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !40, file: !5, line: 73, baseType: !14, size: 4)
-!43 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !40, file: !5, line: 74, baseType: !16, size: 60, offset: 4)
-!44 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs12", scope: !36, file: !5, line: 79, baseType: !14, size: 1, offset: 96)
-!45 = !{i32 2, !"Dwarf Version", i32 2}
-!46 = !{i32 2, !"Debug Info Version", i32 3}
-!47 = !{!"clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)"}

+ 54 - 43
test/DebugInfo/X86/debug-info-static-member.ll

@@ -36,59 +36,71 @@
 ;         return C::c;
 ; }
 
+source_filename = "test/DebugInfo/X86/debug-info-static-member.ll"
+
 %class.C = type { i32 }
 
-@_ZN1C1aE = global i32 4, align 4, !dbg !12
-@_ZN1C1bE = global i32 2, align 4, !dbg !27
-@_ZN1C1cE = global i32 1, align 4, !dbg !28
+@_ZN1C1aE = global i32 4, align 4, !dbg !0
+@_ZN1C1bE = global i32 2, align 4, !dbg !18
+@_ZN1C1cE = global i32 1, align 4, !dbg !20
 
-define i32 @main() nounwind uwtable !dbg !5 {
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 !dbg !26 {
 entry:
   %retval = alloca i32, align 4
   %instance_C = alloca %class.C, align 4
   store i32 0, i32* %retval
-  call void @llvm.dbg.declare(metadata %class.C* %instance_C, metadata !29, metadata !DIExpression()), !dbg !30
-  %d = getelementptr inbounds %class.C, %class.C* %instance_C, i32 0, i32 0, !dbg !31
-  store i32 8, i32* %d, align 4, !dbg !31
-  %0 = load i32, i32* @_ZN1C1cE, align 4, !dbg !32
-  ret i32 %0, !dbg !32
+  call void @llvm.dbg.declare(metadata %class.C* %instance_C, metadata !29, metadata !30), !dbg !31
+  %d = getelementptr inbounds %class.C, %class.C* %instance_C, i32 0, i32 0, !dbg !32
+  store i32 8, i32* %d, align 4, !dbg !32
+  %0 = load i32, i32* @_ZN1C1cE, align 4, !dbg !33
+  ret i32 %0, !dbg !33
 }
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { nounwind uwtable }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!22}
+!llvm.module.flags = !{!25}
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!34}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", linkageName: "_ZN1C1aE", scope: null, file: !2, line: 14, type: !3, isLocal: false, isDefinition: true, declaration: !4)
+!2 = !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")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !5, file: !2, line: 3, baseType: !3, flags: DIFlagPrivate | DIFlagStaticMember)
+!5 = !DICompositeType(tag: DW_TAG_class_type, name: "C", file: !2, line: 1, size: 32, align: 32, elements: !6)
+!6 = !{!4, !7, !10, !11, !14, !15, !17}
+!7 = !DIDerivedType(tag: DW_TAG_member, name: "const_a", scope: !5, file: !2, line: 4, baseType: !8, flags: DIFlagPrivate | DIFlagStaticMember, extraData: i1 true)
+!8 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
+!9 = !DIBasicType(name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !5, file: !2, line: 6, baseType: !3, flags: DIFlagProtected | DIFlagStaticMember)
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "const_b", scope: !5, file: !2, line: 7, baseType: !12, flags: DIFlagProtected | DIFlagStaticMember, extraData: float 0x40091EB860000000)
+!12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13)
+!13 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
+!14 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !2, line: 9, baseType: !3, flags: DIFlagPublic | DIFlagStaticMember)
+!15 = !DIDerivedType(tag: DW_TAG_member, name: "const_c", scope: !5, file: !2, line: 10, baseType: !16, flags: DIFlagPublic | DIFlagStaticMember, extraData: i32 18)
+!16 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !3)
+!17 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !5, file: !2, line: 11, baseType: !3, size: 32, align: 32, flags: DIFlagPublic)
+!18 = !DIGlobalVariableExpression(var: !19)
+!19 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", scope: null, file: !2, line: 15, type: !3, isLocal: false, isDefinition: true, declaration: !10)
+!20 = !DIGlobalVariableExpression(var: !21)
+!21 = !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", scope: null, file: !2, line: 16, type: !3, isLocal: false, isDefinition: true, declaration: !14)
+!22 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !23, retainedTypes: !23, globals: !24, imports: !23)
+!23 = !{}
+!24 = !{!0, !18, !20}
+!25 = !{i32 1, !"Debug Info Version", i32 3}
+!26 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 18, type: !27, isLocal: false, isDefinition: true, scopeLine: 23, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !22, variables: !23)
+!27 = !DISubroutineType(types: !28)
+!28 = !{!3}
+!29 = !DILocalVariable(name: "instance_C", scope: !26, file: !2, line: 20, type: !5)
+!30 = !DIExpression()
+!31 = !DILocation(line: 20, scope: !26)
+!32 = !DILocation(line: 21, scope: !26)
+!33 = !DILocation(line: 22, scope: !26)
 
-!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 = !{}
-!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}
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = !{!12, !27, !28}
-!12 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", linkageName: "_ZN1C1aE", line: 14, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !15))
-!13 = !DICompositeType(tag: DW_TAG_class_type, name: "C", line: 1, size: 32, align: 32, file: !33, elements: !14)
-!14 = !{!15, !16, !19, !20, !23, !24, !26}
-!15 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 3, flags: DIFlagPrivate | DIFlagStaticMember, file: !33, scope: !13, baseType: !9)
-!16 = !DIDerivedType(tag: DW_TAG_member, name: "const_a", line: 4, flags: DIFlagPrivate | DIFlagStaticMember, file: !33, scope: !13, baseType: !17, extraData: i1 true)
-!17 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !18)
-!18 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
-!19 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 6, flags: DIFlagProtected | DIFlagStaticMember, file: !33, scope: !13, baseType: !9)
-!20 = !DIDerivedType(tag: DW_TAG_member, name: "const_b", line: 7, flags: DIFlagProtected | DIFlagStaticMember, file: !33, scope: !13, baseType: !21, extraData: float 0x40091EB860000000)
-!21 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !22)
-!22 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
-!23 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 9, flags: DIFlagPublic | DIFlagStaticMember, file: !33, scope: !13, baseType: !9)
-!24 = !DIDerivedType(tag: DW_TAG_member, name: "const_c", line: 10, flags: DIFlagPublic | DIFlagStaticMember, file: !33, scope: !13, baseType: !25, extraData: i32 18)
-!25 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
-!26 = !DIDerivedType(tag: DW_TAG_member, name: "d", line: 11, size: 32, align: 32, flags: DIFlagPublic, file: !33, scope: !13, baseType: !9)
-!27 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !19))
-!28 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", line: 16, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !23))
-!29 = !DILocalVariable(name: "instance_C", line: 20, scope: !5, file: !6, type: !13)
-!30 = !DILocation(line: 20, scope: !5)
-!31 = !DILocation(line: 21, scope: !5)
-!32 = !DILocation(line: 22, scope: !5)
-!33 = !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")
 ; PRESENT verifies that static member declarations have these attributes:
 ; external, declaration, accessibility, and either DW_AT_linkage_name
 ; (for variables) or DW_AT_const_value (for constants).
@@ -252,4 +264,3 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
 ; DARWINA-NOT:  DW_AT_const_value
 ; DARWINA-NOT:  DW_AT_location
 ; DARWINA:      NULL
-!34 = !{i32 1, !"Debug Info Version", i32 3}

+ 62 - 55
test/DebugInfo/X86/debug-loc-frame.ll

@@ -42,73 +42,80 @@
 ; ModuleID = 'frame.c'
 source_filename = "frame.c"
 
-@data = global i32 17, align 4, !dbg !4
+@data = global i32 17, align 4, !dbg !0
 @sum = local_unnamed_addr global i32 0, align 4, !dbg !6
-@zero = local_unnamed_addr global i32 0, align 4, !dbg !7
-@ptr = common local_unnamed_addr global i32* null, align 8, !dbg !8
+@zero = local_unnamed_addr global i32 0, align 4, !dbg !9
+@ptr = common local_unnamed_addr global i32* null, align 8, !dbg !11
 
-; Function Attrs: nounwind uwtable
-define i32 @main() local_unnamed_addr !dbg !13 {
+define i32 @main() local_unnamed_addr !dbg !17 {
 entry:
   %val = alloca i32, align 4
-  %0 = bitcast i32* %val to i8*, !dbg !18
-  call void @llvm.lifetime.start(i64 4, i8* %0), !dbg !18
-  %1 = load i32, i32* @data, align 4, !dbg !19, !tbaa !20
-  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !17, metadata !24), !dbg !25
-  store i32 %1, i32* %val, align 4, !dbg !26, !tbaa !20
-  tail call void @llvm.dbg.value(metadata i32* %val, i64 0, metadata !17, metadata !27), !dbg !25
-  call void @foo(i32 1, i32* nonnull %val), !dbg !28
-  call void @foo(i32 2, i32* nonnull @data), !dbg !29
-  %2 = load i32, i32* @zero, align 4, !dbg !30, !tbaa !20
-  call void @llvm.lifetime.end(i64 4, i8* %0), !dbg !31
-  ret i32 %2, !dbg !32
+  %0 = bitcast i32* %val to i8*, !dbg !22
+  call void @llvm.lifetime.start(i64 4, i8* %0), !dbg !22
+  %1 = load i32, i32* @data, align 4, !dbg !23, !tbaa !24
+  tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !21, metadata !28), !dbg !29
+  store i32 %1, i32* %val, align 4, !dbg !30, !tbaa !24
+  tail call void @llvm.dbg.value(metadata i32* %val, i64 0, metadata !21, metadata !31), !dbg !29
+  call void @foo(i32 1, i32* nonnull %val), !dbg !32
+  call void @foo(i32 2, i32* nonnull @data), !dbg !33
+  %2 = load i32, i32* @zero, align 4, !dbg !34, !tbaa !24
+  call void @llvm.lifetime.end(i64 4, i8* %0), !dbg !35
+  ret i32 %2, !dbg !36
 }
 
 ; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start(i64, i8* nocapture)
+declare void @llvm.lifetime.start(i64, i8* nocapture) #0
 
 declare void @foo(i32, i32*) local_unnamed_addr
 
 ; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end(i64, i8* nocapture)
+declare void @llvm.lifetime.end(i64, i8* nocapture) #0
 
 ; Function Attrs: nounwind readnone
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!10, !11}
-!llvm.ident = !{!12}
+attributes #0 = { argmemonly nounwind }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!14, !15}
+!llvm.ident = !{!16}
+
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "data", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 273961)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "frame.c", directory: "/home/user/test")
+!4 = !{}
+!5 = !{!0, !6, !9, !11}
+!6 = distinct !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "sum", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!9 = distinct !DIGlobalVariableExpression(var: !10)
+!10 = !DIGlobalVariable(name: "zero", scope: !2, file: !3, line: 3, type: !8, isLocal: false, isDefinition: true)
+!11 = distinct !DIGlobalVariableExpression(var: !12)
+!12 = !DIGlobalVariable(name: "ptr", scope: !2, file: !3, line: 4, type: !13, isLocal: false, isDefinition: true)
+!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
+!14 = !{i32 2, !"Dwarf Version", i32 4}
+!15 = !{i32 2, !"Debug Info Version", i32 3}
+!16 = !{!"clang version 3.9.0 (trunk 273961)"}
+!17 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 8, type: !18, isLocal: false, isDefinition: true, scopeLine: 9, isOptimized: true, unit: !2, variables: !20)
+!18 = !DISubroutineType(types: !19)
+!19 = !{!8}
+!20 = !{!21}
+!21 = !DILocalVariable(name: "val", scope: !17, file: !3, line: 10, type: !8)
+!22 = !DILocation(line: 10, column: 3, scope: !17)
+!23 = !DILocation(line: 11, column: 9, scope: !17)
+!24 = !{!25, !25, i64 0}
+!25 = !{!"int", !26, i64 0}
+!26 = !{!"omnipotent char", !27, i64 0}
+!27 = !{!"Simple C/C++ TBAA"}
+!28 = !DIExpression()
+!29 = !DILocation(line: 10, column: 7, scope: !17)
+!30 = !DILocation(line: 11, column: 7, scope: !17)
+!31 = !DIExpression(DW_OP_deref)
+!32 = !DILocation(line: 12, column: 3, scope: !17)
+!33 = !DILocation(line: 13, column: 3, scope: !17)
+!34 = !DILocation(line: 14, column: 10, scope: !17)
+!35 = !DILocation(line: 15, column: 1, scope: !17)
+!36 = !DILocation(line: 14, column: 3, scope: !17)
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 273961)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3)
-!1 = !DIFile(filename: "frame.c", directory: "/home/user/test")
-!2 = !{}
-!3 = !{!4, !6, !7, !8}
-!4 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "data", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "sum", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true))
-!7 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "zero", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true))
-!8 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "ptr", scope: !0, file: !1, line: 4, type: !9, isLocal: false, isDefinition: true))
-!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
-!10 = !{i32 2, !"Dwarf Version", i32 4}
-!11 = !{i32 2, !"Debug Info Version", i32 3}
-!12 = !{!"clang version 3.9.0 (trunk 273961)"}
-!13 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 8, type: !14, isLocal: false, isDefinition: true, scopeLine: 9, isOptimized: true, unit: !0, variables: !16)
-!14 = !DISubroutineType(types: !15)
-!15 = !{!5}
-!16 = !{!17}
-!17 = !DILocalVariable(name: "val", scope: !13, file: !1, line: 10, type: !5)
-!18 = !DILocation(line: 10, column: 3, scope: !13)
-!19 = !DILocation(line: 11, column: 9, scope: !13)
-!20 = !{!21, !21, i64 0}
-!21 = !{!"int", !22, i64 0}
-!22 = !{!"omnipotent char", !23, i64 0}
-!23 = !{!"Simple C/C++ TBAA"}
-!24 = !DIExpression()
-!25 = !DILocation(line: 10, column: 7, scope: !13)
-!26 = !DILocation(line: 11, column: 7, scope: !13)
-!27 = !DIExpression(DW_OP_deref)
-!28 = !DILocation(line: 12, column: 3, scope: !13)
-!29 = !DILocation(line: 13, column: 3, scope: !13)
-!30 = !DILocation(line: 14, column: 10, scope: !13)
-!31 = !DILocation(line: 15, column: 1, scope: !13)
-!32 = !DILocation(line: 14, column: 3, scope: !13)

+ 16 - 14
test/DebugInfo/X86/debugger-tune.ll

@@ -14,7 +14,6 @@
 ; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s | llvm-readobj -sections - | FileCheck --check-prefix=LLDB %s
 ; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=sce < %s | llvm-readobj -sections - | FileCheck --check-prefix=SCE %s
 
-
 ; GDB-NOT: apple_names
 ; GDB: debug_pubnames
 ; GDB-NOT: apple_names
@@ -26,19 +25,22 @@
 ; SCE-NOT: debug_pubnames
 ; SCE-NOT: apple_names
 
+source_filename = "test/DebugInfo/X86/debugger-tune.ll"
+
+@globalvar = global i32 0, align 4, !dbg !0
 
-@globalvar = global i32 0, align 4, !dbg !4
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!7, !8}
+!llvm.ident = !{!9}
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!6, !7}
-!llvm.ident = !{!8}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "globalvar", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.7.0 (trunk 238808)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
+!3 = !DIFile(filename: "debugger-tune.cpp", directory: "/home/probinson/projects/scratch")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 2, !"Debug Info Version", i32 3}
+!9 = !{!"clang version 3.7.0 (trunk 238808)"}
 
-!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}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "globalvar", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !{i32 2, !"Dwarf Version", i32 4}
-!7 = !{i32 2, !"Debug Info Version", i32 3}
-!8 = !{!"clang version 3.7.0 (trunk 238808)"}

+ 74 - 71
test/DebugInfo/X86/decl-derived-member.ll

@@ -19,6 +19,8 @@
 ; CHECK: DW_AT_name{{.*}}"b"
 ; CHECK-NOT: DW_AT_bit_offset
 
+source_filename = "test/DebugInfo/X86/decl-derived-member.ll"
+
 %struct.foo = type { %struct.base }
 %struct.base = type { i32 (...)** }
 
@@ -28,40 +30,40 @@ $_ZN3fooD2Ev = comdat any
 
 $_ZN4baseC2Ev = comdat any
 
-@f = global %struct.foo zeroinitializer, align 8, !dbg !29
+@f = global %struct.foo zeroinitializer, align 8, !dbg !0
 @__dso_handle = external global i8
 @_ZTV4base = external unnamed_addr constant [4 x i8*]
 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_decl_derived_member.cpp, i8* null }]
 
-define internal void @__cxx_global_var_init() section ".text.startup" !dbg !10 {
+define internal void @__cxx_global_var_init() section ".text.startup" !dbg !15 {
 entry:
-  call void @_ZN3fooC2Ev(%struct.foo* @f) #2, !dbg !33
-  %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.foo*)* @_ZN3fooD2Ev to void (i8*)*), i8* bitcast (%struct.foo* @f to i8*), i8* @__dso_handle) #2, !dbg !33
-  ret void, !dbg !33
+  call void @_ZN3fooC2Ev(%struct.foo* @f) #2, !dbg !18
+  %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.foo*)* @_ZN3fooD2Ev to void (i8*)*), i8* bitcast (%struct.foo* @f to i8*), i8* @__dso_handle) #2, !dbg !18
+  ret void, !dbg !18
 }
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr void @_ZN3fooC2Ev(%struct.foo* %this) unnamed_addr #0 comdat align 2 !dbg !14 {
+define linkonce_odr void @_ZN3fooC2Ev(%struct.foo* %this) unnamed_addr #0 comdat align 2 !dbg !19 {
 entry:
   %this.addr = alloca %struct.foo*, align 8
   store %struct.foo* %this, %struct.foo** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !34, metadata !36), !dbg !37
+  call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !24, metadata !26), !dbg !27
   %this1 = load %struct.foo*, %struct.foo** %this.addr
-  %b = getelementptr inbounds %struct.foo, %struct.foo* %this1, i32 0, i32 0, !dbg !38
-  call void @_ZN4baseC2Ev(%struct.base* %b) #2, !dbg !38
-  ret void, !dbg !38
+  %b = getelementptr inbounds %struct.foo, %struct.foo* %this1, i32 0, i32 0, !dbg !28
+  call void @_ZN4baseC2Ev(%struct.base* %b) #2, !dbg !28
+  ret void, !dbg !28
 }
 
 ; Function Attrs: inlinehint uwtable
-define linkonce_odr void @_ZN3fooD2Ev(%struct.foo* %this) unnamed_addr #1 comdat align 2 !dbg !24 {
+define linkonce_odr void @_ZN3fooD2Ev(%struct.foo* %this) unnamed_addr #1 comdat align 2 !dbg !29 {
 entry:
   %this.addr = alloca %struct.foo*, align 8
   store %struct.foo* %this, %struct.foo** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !39, metadata !36), !dbg !40
+  call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !31, metadata !26), !dbg !32
   %this1 = load %struct.foo*, %struct.foo** %this.addr
-  %b = getelementptr inbounds %struct.foo, %struct.foo* %this1, i32 0, i32 0, !dbg !41
-  call void @_ZN4baseD1Ev(%struct.base* %b), !dbg !41
-  ret void, !dbg !43
+  %b = getelementptr inbounds %struct.foo, %struct.foo* %this1, i32 0, i32 0, !dbg !33
+  call void @_ZN4baseD1Ev(%struct.base* %b), !dbg !33
+  ret void, !dbg !35
 }
 
 ; Function Attrs: nounwind
@@ -71,22 +73,22 @@ declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) #2
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #3
 
 ; Function Attrs: inlinehint nounwind uwtable
-define linkonce_odr void @_ZN4baseC2Ev(%struct.base* %this) unnamed_addr #0 comdat align 2 !dbg !19 {
+define linkonce_odr void @_ZN4baseC2Ev(%struct.base* %this) unnamed_addr #0 comdat align 2 !dbg !36 {
 entry:
   %this.addr = alloca %struct.base*, align 8
   store %struct.base* %this, %struct.base** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.base** %this.addr, metadata !44, metadata !36), !dbg !46
+  call void @llvm.dbg.declare(metadata %struct.base** %this.addr, metadata !41, metadata !26), !dbg !43
   %this1 = load %struct.base*, %struct.base** %this.addr
-  %0 = bitcast %struct.base* %this1 to i32 (...)***, !dbg !47
-  store i32 (...)** bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV4base, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, !dbg !47
-  ret void, !dbg !47
+  %0 = bitcast %struct.base* %this1 to i32 (...)***, !dbg !44
+  store i32 (...)** bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV4base, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, !dbg !44
+  ret void, !dbg !44
 }
 
 declare void @_ZN4baseD1Ev(%struct.base*) #4
 
 define internal void @_GLOBAL__sub_I_decl_derived_member.cpp() section ".text.startup" {
 entry:
-  call void @__cxx_global_var_init(), !dbg !48
+  call void @__cxx_global_var_init(), !dbg !45
   ret void
 }
 
@@ -96,55 +98,56 @@ attributes #2 = { nounwind }
 attributes #3 = { nounwind readnone }
 attributes #4 = { "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
 
-!llvm.dbg.cu = !{!0}
-!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: 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: !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")
-!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, 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: !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)
+!llvm.dbg.cu = !{!8}
+!llvm.module.flags = !{!12, !13}
+!llvm.ident = !{!14}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 8, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "decl-derived-member.cpp", directory: "/tmp/dbginfo")
+!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !2, line: 5, size: 64, align: 64, elements: !4, identifier: "_ZTS3foo")
+!4 = !{!5}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !3, file: !2, line: 6, baseType: !6, size: 64, align: 64)
+!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "base_type", file: !2, line: 4, baseType: !7)
+!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "base", file: !2, line: 1, flags: DIFlagFwdDecl, identifier: "_ZTS4base")
+!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !10, globals: !11, imports: !9)
+!9 = !{}
+!10 = !{!3, !7}
+!11 = !{!0}
+!12 = !{i32 2, !"Dwarf Version", i32 4}
+!13 = !{i32 2, !"Debug Info Version", i32 3}
+!14 = !{!"clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)"}
+!15 = distinct !DISubprogram(name: "__cxx_global_var_init", scope: !2, file: !2, line: 8, type: !16, isLocal: true, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !8, variables: !9)
+!16 = !DISubroutineType(types: !17)
+!17 = !{null}
+!18 = !DILocation(line: 8, column: 5, scope: !15)
+!19 = distinct !DISubprogram(name: "foo", linkageName: "_ZN3fooC2Ev", scope: !3, file: !2, line: 5, type: !20, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !8, declaration: !23, variables: !9)
 !20 = !DISubroutineType(types: !21)
 !21 = !{null, !22}
-!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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4))
-!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: !4)
-!36 = !DIExpression()
-!37 = !DILocation(line: 0, scope: !14)
-!38 = !DILocation(line: 5, column: 8, scope: !14)
-!39 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !24, type: !35)
-!40 = !DILocation(line: 0, scope: !24)
-!41 = !DILocation(line: 5, column: 8, scope: !42)
-!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: !8)
-!46 = !DILocation(line: 0, scope: !19)
-!47 = !DILocation(line: 1, column: 8, scope: !19)
-!48 = !DILocation(line: 0, scope: !26)
+!22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!23 = !DISubprogram(name: "foo", scope: !3, type: !20, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!24 = !DILocalVariable(name: "this", arg: 1, scope: !19, type: !25, flags: DIFlagArtificial | DIFlagObjectPointer)
+!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64)
+!26 = !DIExpression()
+!27 = !DILocation(line: 0, scope: !19)
+!28 = !DILocation(line: 5, column: 8, scope: !19)
+!29 = distinct !DISubprogram(name: "~foo", linkageName: "_ZN3fooD2Ev", scope: !3, file: !2, line: 5, type: !20, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !8, declaration: !30, variables: !9)
+!30 = !DISubprogram(name: "~foo", scope: !3, type: !20, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!31 = !DILocalVariable(name: "this", arg: 1, scope: !29, type: !25, flags: DIFlagArtificial | DIFlagObjectPointer)
+!32 = !DILocation(line: 0, scope: !29)
+!33 = !DILocation(line: 5, column: 8, scope: !34)
+!34 = distinct !DILexicalBlock(scope: !29, file: !2, line: 5, column: 8)
+!35 = !DILocation(line: 5, column: 8, scope: !29)
+!36 = distinct !DISubprogram(name: "base", linkageName: "_ZN4baseC2Ev", scope: !7, file: !2, line: 1, type: !37, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !8, declaration: !40, variables: !9)
+!37 = !DISubroutineType(types: !38)
+!38 = !{null, !39}
+!39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!40 = !DISubprogram(name: "base", scope: !7, type: !37, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!41 = !DILocalVariable(name: "this", arg: 1, scope: !36, type: !42, flags: DIFlagArtificial | DIFlagObjectPointer)
+!42 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
+!43 = !DILocation(line: 0, scope: !36)
+!44 = !DILocation(line: 1, column: 8, scope: !36)
+!45 = !DILocation(line: 0, scope: !46)
+!46 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", scope: !2, file: !2, type: !47, isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !8, variables: !9)
+!47 = !DISubroutineType(types: !9)
+

+ 21 - 18
test/DebugInfo/X86/dllimport.ll

@@ -2,26 +2,29 @@
 
 ; CHECK-NOT: DW_AT_location
 
+source_filename = "test/DebugInfo/X86/dllimport.ll"
 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, !dbg !4
+@"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!13, !14}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!14, !15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !2, file: !6, line: 4, type: !7, isLocal: false, isDefinition: true, declaration: !8)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/t.ii", directory: "/usr/local/google/home/majnemer/llvm/src")
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "id", scope: !9, file: !6, line: 2, baseType: !7, flags: DIFlagStaticMember)
+!9 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "numpunct<char>", file: !6, line: 2, size: 8, align: 8, elements: !10, templateParams: !11)
+!10 = !{!8}
+!11 = !{!12}
+!12 = !DITemplateTypeParameter(type: !13)
+!13 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
+!14 = !{i32 2, !"Dwarf Version", i32 3}
+!15 = !{i32 2, !"Debug Info Version", i32 3}
 
-!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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, 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}

+ 44 - 41
test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll

@@ -18,36 +18,36 @@
 ;   return foo(2) + foo2(1) + global;
 ; }
 
-
 ; ModuleID = 'tmp/debug_ranges/a.cc'
+source_filename = "test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll"
 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-unknown-linux-gnu"
 
-@global = global i32 2, align 4, !dbg !18
+@global = global i32 2, align 4, !dbg !0
 
 ; Function Attrs: nounwind readnone uwtable
-define i32 @_Z3fooi(i32 %bar) #0 !dbg !4 {
+define i32 @_Z3fooi(i32 %bar) #0 !dbg !9 {
 entry:
-  tail call void @llvm.dbg.value(metadata i32 %bar, i64 0, metadata !10, metadata !DIExpression()), !dbg !20
-  ret i32 %bar, !dbg !20
+  tail call void @llvm.dbg.value(metadata i32 %bar, i64 0, metadata !13, metadata !14), !dbg !15
+  ret i32 %bar, !dbg !15
 }
 
 ; Function Attrs: nounwind readnone uwtable
-define i32 @_Z4foo2i(i32 %bar2) #0 !dbg !11 {
+define i32 @_Z4foo2i(i32 %bar2) #0 !dbg !16 {
 entry:
-  tail call void @llvm.dbg.value(metadata i32 %bar2, i64 0, metadata !13, metadata !DIExpression()), !dbg !21
-  ret i32 %bar2, !dbg !21
+  tail call void @llvm.dbg.value(metadata i32 %bar2, i64 0, metadata !18, metadata !14), !dbg !19
+  ret i32 %bar2, !dbg !19
 }
 
 ; Function Attrs: nounwind readonly uwtable
-define i32 @main() #1 !dbg !14 {
+define i32 @main() #1 !dbg !20 {
 entry:
-  %call = tail call i32 @_Z3fooi(i32 2), !dbg !22
-  %call1 = tail call i32 @_Z4foo2i(i32 1), !dbg !22
-  %add = add nsw i32 %call1, %call, !dbg !22
-  %0 = load i32, i32* @global, align 4, !dbg !22, !tbaa !23
-  %add2 = add nsw i32 %add, %0, !dbg !22
-  ret i32 %add2, !dbg !22
+  %call = tail call i32 @_Z3fooi(i32 2), !dbg !23
+  %call1 = tail call i32 @_Z4foo2i(i32 1), !dbg !23
+  %add = add nsw i32 %call1, %call, !dbg !23
+  %0 = load i32, i32* @global, align 4, !dbg !23, !tbaa !24
+  %add2 = add nsw i32 %add, %0, !dbg !23
+  ret i32 %add2, !dbg !23
 }
 
 ; Function Attrs: nounwind readnone
@@ -57,32 +57,35 @@ attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-fra
 attributes #1 = { nounwind readonly uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
 attributes #2 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!19, !26}
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7, !8}
 
-!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 = !{}
-!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, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !12)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "global", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "tmp/debug_ranges/a.cc", directory: "/")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 (191881)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
+!6 = !{!0}
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 1, !"Debug Info Version", i32 3}
+!9 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !2, file: !2, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !4, variables: !12)
+!10 = !DISubroutineType(types: !11)
+!11 = !{!3, !3}
 !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, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !15, variables: !2)
-!15 = !DISubroutineType(types: !16)
-!16 = !{!8}
+!13 = !DILocalVariable(name: "bar", arg: 1, scope: !9, file: !2, line: 2, type: !3)
+!14 = !DIExpression()
+!15 = !DILocation(line: 2, scope: !9)
+!16 = distinct !DISubprogram(name: "foo2", linkageName: "_Z4foo2i", scope: !2, file: !2, line: 3, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !4, variables: !17)
 !17 = !{!18}
-!18 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "global", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8))
-!19 = !{i32 2, !"Dwarf Version", i32 4}
-!20 = !DILocation(line: 2, scope: !4)
-!21 = !DILocation(line: 3, scope: !11)
-!22 = !DILocation(line: 6, scope: !14)
-!23 = !{!"int", !24}
-!24 = !{!"omnipotent char", !25}
-!25 = !{!"Simple C/C++ TBAA"}
-!26 = !{i32 1, !"Debug Info Version", i32 3}
+!18 = !DILocalVariable(name: "bar2", arg: 1, scope: !16, file: !2, line: 3, type: !3)
+!19 = !DILocation(line: 3, scope: !16)
+!20 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 5, type: !21, isLocal: false, isDefinition: true, scopeLine: 5, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !4, variables: !5)
+!21 = !DISubroutineType(types: !22)
+!22 = !{!3}
+!23 = !DILocation(line: 6, scope: !20)
+!24 = !{!25, !25, i64 0}
+!25 = !{!"int", !26}
+!26 = !{!"omnipotent char", !27}
+!27 = !{!"Simple C/C++ TBAA"}
+

+ 33 - 32
test/DebugInfo/X86/dwarf-aranges.ll

@@ -1,6 +1,5 @@
 ; RUN: llc -generate-arange-section < %s | FileCheck %s
 
-
 ; -- header --
 ; CHECK: .short 2 # DWARF Arange version number
 ; CHECK-NEXT: .long .Lcu_begin0
@@ -28,8 +27,6 @@
 ; -- finish --
 ; CHECK-NEXT: # ARange terminator
 
-
-
 ; -- source code --
 ; Generated from: "clang -c -g -emit-llvm"
 ;
@@ -42,39 +39,43 @@
 ;    some_bss += some_data + some_other;
 ; }
 
+source_filename = "test/DebugInfo/X86/dwarf-aranges.ll"
 target triple = "x86_64-unknown-linux-gnu"
 
-@some_data = global i32 4, align 4, !dbg !9
-@some_other = global i32 5, section "strange+section", align 4, !dbg !11
-@some_bss = common global i32 0, align 4, !dbg !12
+@some_data = global i32 4, align 4, !dbg !0
+@some_other = global i32 5, section "strange+section", align 4, !dbg !4
+@some_bss = common global i32 0, align 4, !dbg !6
 
-define void @some_code() !dbg !4 {
+define void @some_code() !dbg !13 {
 entry:
-  %0 = load i32, i32* @some_data, align 4, !dbg !14
-  %1 = load i32, i32* @some_other, align 4, !dbg !14
-  %add = add nsw i32 %0, %1, !dbg !14
-  %2 = load i32, i32* @some_bss, align 4, !dbg !14
-  %add1 = add nsw i32 %2, %add, !dbg !14
-  store i32 %add1, i32* @some_bss, align 4, !dbg !14
-  ret void, !dbg !15
+  %0 = load i32, i32* @some_data, align 4, !dbg !16
+  %1 = load i32, i32* @some_other, align 4, !dbg !16
+  %add = add nsw i32 %0, %1, !dbg !16
+  %2 = load i32, i32* @some_bss, align 4, !dbg !16
+  %add1 = add nsw i32 %2, %add, !dbg !16
+  store i32 %add1, i32* @some_bss, align 4, !dbg !16
+  ret void, !dbg !17
 }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!13, !16}
+!llvm.dbg.cu = !{!8}
+!llvm.module.flags = !{!11, !12}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "some_data", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "test.c", directory: "/home/kayamon")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "some_other", scope: null, file: !2, line: 3, type: !3, isLocal: false, isDefinition: true)
+!6 = !DIGlobalVariableExpression(var: !7)
+!7 = !DIGlobalVariable(name: "some_bss", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!8 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !9, globals: !10, imports: !9)
+!9 = !{}
+!10 = !{!0, !4, !6}
+!11 = !{i32 2, !"Dwarf Version", i32 4}
+!12 = !{i32 1, !"Debug Info Version", i32 3}
+!13 = distinct !DISubprogram(name: "some_code", scope: !2, file: !2, line: 5, type: !14, isLocal: false, isDefinition: true, scopeLine: 6, virtualIndex: 6, isOptimized: false, unit: !8, variables: !9)
+!14 = !DISubroutineType(types: !15)
+!15 = !{null}
+!16 = !DILocation(line: 7, scope: !13)
+!17 = !DILocation(line: 8, scope: !13)
 
-!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 = !{}
-!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}
-!8 = !{!9, !11, !12}
-!9 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "some_data", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10))
-!10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!11 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "some_other", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10))
-!12 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "some_bss", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10))
-!13 = !{i32 2, !"Dwarf Version", i32 4}
-!14 = !DILocation(line: 7, scope: !4)
-!15 = !DILocation(line: 8, scope: !4)
-!16 = !{i32 1, !"Debug Info Version", i32 3}

+ 24 - 20
test/DebugInfo/X86/dwarf-linkage-names.ll

@@ -38,10 +38,12 @@
 ; NOLINKAGE-NOT: .asciz   "_ZN4test10global_varE"
 ; NOLINKAGE-NOT: .asciz   "_ZN4test3barEv"
 
-@_ZN4test10global_varE = global i32 0, align 4, !dbg !10
+source_filename = "test/DebugInfo/X86/dwarf-linkage-names.ll"
+
+@_ZN4test10global_varE = global i32 0, align 4, !dbg !0
 
 ; Function Attrs: nounwind uwtable
-define i32 @_ZN4test3barEv() #0 !dbg !4 {
+define i32 @_ZN4test3barEv() #0 !dbg !11 {
 entry:
   %0 = load i32, i32* @_ZN4test10global_varE, align 4, !dbg !14
   ret i32 %0, !dbg !15
@@ -49,22 +51,24 @@ entry:
 
 attributes #0 = { nounwind 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-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!11, !12}
-!llvm.ident = !{!13}
+!llvm.dbg.cu = !{!5}
+!llvm.module.flags = !{!8, !9}
+!llvm.ident = !{!10}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "global_var", linkageName: "_ZN4test10global_varE", scope: !2, file: !3, line: 2, type: !4, isLocal: false, isDefinition: true)
+!2 = !DINamespace(name: "test", scope: null, file: !3, line: 1)
+!3 = !DIFile(filename: "dwarf-linkage-names.cpp", directory: "/home/probinson/projects/scratch")
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.8.0 (trunk 244662)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, globals: !7)
+!6 = !{}
+!7 = !{!0}
+!8 = !{i32 2, !"Dwarf Version", i32 4}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{!"clang version 3.8.0 (trunk 244662)"}
+!11 = distinct !DISubprogram(name: "bar", linkageName: "_ZN4test3barEv", scope: !2, file: !3, line: 3, type: !12, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !5, variables: !6)
+!12 = !DISubroutineType(types: !13)
+!13 = !{!4}
+!14 = !DILocation(line: 3, column: 21, scope: !11)
+!15 = !DILocation(line: 3, column: 14, scope: !11)
 
-!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 = !{}
-!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}
-!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !{!10}
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "global_var", linkageName: "_ZN4test10global_varE", scope: !5, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true))
-!11 = !{i32 2, !"Dwarf Version", i32 4}
-!12 = !{i32 2, !"Debug Info Version", i32 3}
-!13 = !{!"clang version 3.8.0 (trunk 244662)"}
-!14 = !DILocation(line: 3, column: 21, scope: !4)
-!15 = !DILocation(line: 3, column: 14, scope: !4)

+ 65 - 56
test/DebugInfo/X86/dwarf-public-names.ll

@@ -55,82 +55,91 @@
 ; LINUX-DAG: "C::static_member_variable"
 ; LINUX-DAG: "C::member_function"
 
+source_filename = "test/DebugInfo/X86/dwarf-public-names.ll"
+
 %struct.C = type { i8 }
 
-@_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !25
-@global_variable = global %struct.C zeroinitializer, align 1, !dbg !26
-@_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !27
+@_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !0
+@global_variable = global %struct.C zeroinitializer, align 1, !dbg !15
+@_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !17
 
-define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 !dbg !3 {
+; Function Attrs: nounwind uwtable
+define void @_ZN1C15member_functionEv(%struct.C* %this) #0 align 2 !dbg !23 {
 entry:
   %this.addr = alloca %struct.C*, align 8
   store %struct.C* %this, %struct.C** %this.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !28, metadata !DIExpression()), !dbg !30
+  call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !24, metadata !26), !dbg !27
   %this1 = load %struct.C*, %struct.C** %this.addr
-  store i32 0, i32* @_ZN1C22static_member_variableE, align 4, !dbg !31
-  ret void, !dbg !32
+  store i32 0, i32* @_ZN1C22static_member_variableE, align 4, !dbg !28
+  ret void, !dbg !29
 }
 
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
-define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 !dbg !18 {
+; Function Attrs: nounwind uwtable
+define i32 @_ZN1C22static_member_functionEv() #0 align 2 !dbg !30 {
 entry:
-  %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !33
-  ret i32 %0, !dbg !33
+  %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !31
+  ret i32 %0, !dbg !31
 }
 
-define i32 @_Z15global_functionv() nounwind uwtable !dbg !19 {
+; Function Attrs: nounwind uwtable
+define i32 @_Z15global_functionv() #0 !dbg !32 {
 entry:
-  ret i32 -1, !dbg !34
+  ret i32 -1, !dbg !33
 }
 
-define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable !dbg !20 {
+; Function Attrs: nounwind uwtable
+define void @_ZN2ns25global_namespace_functionEv() #0 !dbg !34 {
 entry:
-  call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !35
-  ret void, !dbg !36
+  call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !37
+  ret void, !dbg !38
 }
 
 attributes #0 = { nounwind uwtable }
 attributes #1 = { nounwind readnone }
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!38}
+!llvm.dbg.cu = !{!20}
+!llvm.module.flags = !{!22}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !2, file: !3, line: 7, type: !6, isLocal: false, isDefinition: true, declaration: !5)
+!2 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !3, line: 1, size: 8, elements: !4)
+!3 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")
+!4 = !{!5, !7, !12}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", scope: !2, file: !3, line: 4, baseType: !6, flags: DIFlagStaticMember)
+!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!7 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: false, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, variables: !11)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null, !10}
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !2, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!11 = !{}
+!12 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !2, file: !3, line: 3, type: !13, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, variables: !11)
+!13 = !DISubroutineType(types: !14)
+!14 = !{!6}
+!15 = !DIGlobalVariableExpression(var: !16)
+!16 = !DIGlobalVariable(name: "global_variable", scope: null, file: !3, line: 17, type: !2, isLocal: false, isDefinition: true) ; previously: invalid DW_TAG_base_type
+!17 = !DIGlobalVariableExpression(var: !18)
+!18 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !19, file: !3, line: 27, type: !6, isLocal: false, isDefinition: true)
+!19 = !DINamespace(name: "ns", scope: null, file: !3, line: 23)
+!20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !21, imports: !11) ; previously: invalid DW_TAG_base_type
+!21 = !{!0, !15, !17}
+!22 = !{i32 1, !"Debug Info Version", i32 3}
+!23 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: null, file: !3, line: 9, type: !8, isLocal: false, isDefinition: true, scopeLine: 9, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, declaration: !7, variables: !11)
+!24 = !DILocalVariable(name: "this", arg: 1, scope: !23, file: !3, line: 9, type: !25, flags: DIFlagArtificial | DIFlagObjectPointer)
+!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !2, size: 64)
+!26 = !DIExpression()
+!27 = !DILocation(line: 9, scope: !23)
+!28 = !DILocation(line: 10, scope: !23)
+!29 = !DILocation(line: 11, scope: !23)
+!30 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: null, file: !3, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, declaration: !12, variables: !11)
+!31 = !DILocation(line: 14, scope: !30)
+!32 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !3, file: !3, line: 19, type: !13, isLocal: false, isDefinition: true, scopeLine: 19, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, variables: !11)
+!33 = !DILocation(line: 20, scope: !32)
+!34 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !19, file: !3, line: 24, type: !35, isLocal: false, isDefinition: true, scopeLine: 24, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !20, variables: !11)
+!35 = !DISubroutineType(types: !36)
+!36 = !{null}
+!37 = !DILocation(line: 25, scope: !34)
+!38 = !DILocation(line: 26, scope: !34)
 
-!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 = !{}
-!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}
-!7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8)
-!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, size: 8, file: !37, elements: !9)
-!9 = !{!10, !12, !14}
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", line: 4, flags: DIFlagStaticMember, file: !37, scope: !8, baseType: !11)
-!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, encoding: DW_ATE_signed)
-!12 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !4, scope: !8, type: !5, variables: !13)
-!13 = !{} ; previously: invalid DW_TAG_base_type
-!14 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !4, scope: !8, type: !15, variables: !17)
-!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, 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}
-!24 = !{!25, !26, !27}
-!25 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, declaration: !10))
-!26 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8))
-!27 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11))
-!28 = !DILocalVariable(name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29)
-!29 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !8)
-!30 = !DILocation(line: 9, scope: !3)
-!31 = !DILocation(line: 10, scope: !3)
-!32 = !DILocation(line: 11, scope: !3)
-!33 = !DILocation(line: 14, scope: !18)
-!34 = !DILocation(line: 20, scope: !19)
-!35 = !DILocation(line: 25, scope: !20)
-!36 = !DILocation(line: 26, scope: !20)
-!37 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")
-!38 = !{i32 1, !"Debug Info Version", i32 3}

+ 25 - 23
test/DebugInfo/X86/empty-array.ll

@@ -2,10 +2,11 @@
 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
 ; <rdar://problem/12566646>
 
-%class.A = type { [0 x i32] }
+source_filename = "test/DebugInfo/X86/empty-array.ll"
 
-@a = global %class.A zeroinitializer, align 4, !dbg !5
+%class.A = type { [0 x i32] }
 
+@a = global %class.A zeroinitializer, align 4, !dbg !0
 ; CHECK: DW_TAG_class_type
 ; CHECK:      DW_TAG_member
 ; CHECK-NEXT: DW_AT_name [DW_FORM_strp]  ( .debug_str[0x{{[0-9a-f]*}}] = "x")
@@ -24,24 +25,25 @@
 ; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1]  (0x08)
 ; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1]   (DW_ATE_unsigned)
 
-!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: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
-!1 = !{}
-!3 = !{!5}
-!5 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7))
-!6 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm")
-!7 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, align: 32, file: !20, elements: !8)
-!8 = !{!9, !14}
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 1, flags: DIFlagPrivate, file: !20, scope: !7, baseType: !10)
-!10 = !DICompositeType(tag: DW_TAG_array_type, align: 32, baseType: !11, elements: !12)
-!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!12 = !{!13}
-!13 = !DISubrange(count: -1)
-!14 = !DISubprogram(name: "A", line: 1, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !6, scope: !7, type: !15)
-!15 = !DISubroutineType(types: !16)
-!16 = !{null, !17}
-!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !7)
-!20 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm")
-!21 = !{i32 1, !"Debug Info Version", i32 3}
+!llvm.dbg.cu = !{!14}
+!llvm.module.flags = !{!17}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm")
+!3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, align: 32, elements: !4)
+!4 = !{!5, !10}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !3, file: !2, line: 1, baseType: !6, flags: DIFlagPrivate)
+!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, align: 32, elements: !8)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !{!9}
+!9 = !DISubrange(count: -1)
+!10 = !DISubprogram(name: "A", scope: !3, file: !2, line: 1, type: !11, isLocal: false, isDefinition: false, scopeLine: 1, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!11 = !DISubroutineType(types: !12)
+!12 = !{null, !13}
+!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !15, retainedTypes: !15, globals: !16, imports: !15)
+!15 = !{}
+!16 = !{!0}
+!17 = !{i32 1, !"Debug Info Version", i32 3}
+

+ 30 - 26
test/DebugInfo/X86/enum-class.ll

@@ -1,33 +1,38 @@
 ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
 
-@a = global i32 0, align 4, !dbg !19
-@b = global i64 0, align 8, !dbg !20
-@c = global i32 0, align 4, !dbg !21
+source_filename = "test/DebugInfo/X86/enum-class.ll"
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!23}
+@a = global i32 0, align 4, !dbg !0
+@b = global i64 0, align 8, !dbg !7
+@c = global i32 0, align 4, !dbg !13
 
-!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")
-!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !{!7}
-!7 = !DIEnumerator(name: "A1", value: 1) ; [ DW_TAG_enumerator ]
-!8 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "B", line: 2, size: 64, align: 64, file: !4, baseType: !9, elements: !10)
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
-!10 = !{!11}
-!11 = !DIEnumerator(name: "B1", value: 1) ; [ DW_TAG_enumerator ]
-!12 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "C", line: 3, size: 32, align: 32, file: !4, elements: !13)
-!13 = !{!14}
-!14 = !DIEnumerator(name: "C1", value: 1) ; [ DW_TAG_enumerator ]
-!15 = !{}
-!17 = !{!19, !20, !21}
-!19 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !4, type: !3))
-!20 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", line: 5, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8))
-!21 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c", line: 6, isLocal: false, isDefinition: true, scope: null, file: !4, type: !12))
-!22 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
+!llvm.dbg.cu = !{!18}
+!llvm.module.flags = !{!22}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
+!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "A", file: !2, line: 1, baseType: !4, size: 32, align: 32, elements: !5)
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = !{!6}
+!6 = !DIEnumerator(name: "A1", value: 1)
+!7 = !DIGlobalVariableExpression(var: !8) ; [ DW_TAG_enumerator ]
+!8 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 5, type: !9, isLocal: false, isDefinition: true)
+!9 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "B", file: !2, line: 2, baseType: !10, size: 64, align: 64, elements: !11)
+!10 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
+!11 = !{!12}
+!12 = !DIEnumerator(name: "B1", value: 1) ; [ DW_TAG_enumerator ]
+!13 = !DIGlobalVariableExpression(var: !14)
+!14 = !DIGlobalVariable(name: "c", scope: null, file: !2, line: 6, type: !15, isLocal: false, isDefinition: true)
+!15 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "C", file: !2, line: 3, size: 32, align: 32, elements: !16)
+!16 = !{!17}
+!17 = !DIEnumerator(name: "C1", value: 1) ; [ DW_TAG_enumerator ]
+!18 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.2 (trunk 157269) (llvm/trunk 157264)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !19, retainedTypes: !20, globals: !21, imports: !20)
+!19 = !{!3, !9, !15}
+!20 = !{}
+!21 = !{!0, !7, !13}
+!22 = !{i32 1, !"Debug Info Version", i32 3}
 
 ; CHECK: DW_TAG_enumeration_type [{{.*}}]
 ; CHECK: DW_AT_type [DW_FORM_ref4]
@@ -42,4 +47,3 @@
 ; CHECK: DW_TAG_enumeration_type [6]
 ; CHECK-NOT: DW_AT_enum_class
 ; CHECK: DW_AT_name [DW_FORM_strp]      ( .debug_str[{{.*}}] = "C")
-!23 = !{i32 1, !"Debug Info Version", i32 3}

+ 12 - 11
test/DebugInfo/X86/enum-fwd-decl.ll

@@ -1,21 +1,22 @@
 ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
 
-@e = global i16 0, align 2, !dbg !5
+source_filename = "test/DebugInfo/X86/enum-fwd-decl.ll"
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!9}
+@e = global i16 0, align 2, !dbg !0
 
-!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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "e", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7))
-!6 = !DIFile(filename: "foo.cpp", directory: "/tmp")
-!7 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", line: 1, size: 16, align: 16, flags: DIFlagFwdDecl, file: !8)
-!8 = !DIFile(filename: "foo.cpp", directory: "/tmp")
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!7}
 
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "e", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "foo.cpp", directory: "/tmp")
+!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !2, line: 1, size: 16, align: 16, flags: DIFlagFwdDecl)
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.2 (trunk 165274) (llvm/trunk 165272)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
+!5 = !{}
 ; CHECK: DW_TAG_enumeration_type
 ; CHECK-NEXT: DW_AT_name
 ; CHECK-NEXT: DW_AT_byte_size
 ; CHECK-NEXT: DW_AT_declaration
-!9 = !{i32 1, !"Debug Info Version", i32 3}
+!6 = !{!0}
+!7 = !{i32 1, !"Debug Info Version", i32 3}

+ 22 - 21
test/DebugInfo/X86/externaltyperef.ll

@@ -21,31 +21,32 @@
 ; CHECK:   DW_TAG_imported_declaration
 ; CHECK:     DW_AT_import [DW_FORM_ref4]  {{.*}}[[B]]
 
+source_filename = "test/DebugInfo/X86/externaltyperef.ll"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.10.0"
 
 %class.A = type opaque
 
-@a = global %class.A* null, align 8, !dbg !6
+@a = global %class.A* null, align 8, !dbg !0
 
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!13, !14, !15}
-!llvm.ident = !{!16}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!12, !13, !14}
+!llvm.ident = !{!15}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !11, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.7.0 (trunk 242039) (llvm/trunk 242046)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !8, imports: !9)
+!3 = !DIFile(filename: "test.cpp", directory: "/")
+!4 = !{}
+!5 = !{!6, !7}
+!6 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !3, flags: DIFlagExternalTypeRef, identifier: "_ZTS1A")
+!7 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !3, flags: DIFlagExternalTypeRef, identifier: "_ZTSN1N1BE")
+!8 = !{!0}
+!9 = !{!10}
+!10 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !7, line: 4)
+!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
+!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.7.0 (trunk 242039) (llvm/trunk 242046)"}
 
-!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 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true))
-!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: !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}
-!16 = !{!"clang version 3.7.0 (trunk 242039) (llvm/trunk 242046)"}

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff