DebugInfo: New metadata representation for global variables.

This patch reverses the edge from DIGlobalVariable to GlobalVariable.
This will allow us to more easily preserve debug info metadata when
manipulating global variables.

Fixes PR30362. A program for upgrading test cases is attached to that
bug.

Differential Revision: http://reviews.llvm.org/D20147

llvm-svn: 281284
diff --git a/llvm/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll b/llvm/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
index 62d88ca..bdab7e3 100644
--- a/llvm/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
+++ b/llvm/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll
@@ -3,7 +3,7 @@
 
 ; ModuleID = 'test.c'
 
-@GLB = common global i32 0, align 4
+@GLB = common global i32 0, align 4, !dbg !14
 
 define i32 @f() nounwind !dbg !5 {
   %LOC = alloca i32, align 4
@@ -27,7 +27,7 @@
 !8 = !{!9}
 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !12 = !{!14}
-!14 = !DIGlobalVariable(name: "GLB", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @GLB)
+!14 = !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)
diff --git a/llvm/test/DebugInfo/X86/DIModuleContext.ll b/llvm/test/DebugInfo/X86/DIModuleContext.ll
index 3955256..031676a 100644
--- a/llvm/test/DebugInfo/X86/DIModuleContext.ll
+++ b/llvm/test/DebugInfo/X86/DIModuleContext.ll
@@ -11,7 +11,7 @@
 
 %struct.s = type opaque
 
-@i = common global %struct.s* null, align 8
+@i = common global %struct.s* null, align 8, !dbg !4
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!7, !8}
@@ -20,7 +20,7 @@
 !1 = !DIFile(filename: "test.c", directory: "/")
 !2 = !{}
 !3 = !{!4}
-!4 = !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: %struct.s** @i)
+!4 = !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}
diff --git a/llvm/test/DebugInfo/X86/DW_AT_calling-convention.ll b/llvm/test/DebugInfo/X86/DW_AT_calling-convention.ll
index 6a64f5d..6650e7c 100644
--- a/llvm/test/DebugInfo/X86/DW_AT_calling-convention.ll
+++ b/llvm/test/DebugInfo/X86/DW_AT_calling-convention.ll
@@ -42,7 +42,7 @@
 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
+@"\01?fptr@@3P6IHHH@ZA" = global i32 (i32, i32)* @"\01?f@@YIHHH@Z", align 4, !dbg !4
 
 ; Function Attrs: nounwind readnone
 define x86_fastcallcc i32 @"\01?f@@YIHHH@Z"(i32 inreg %a, i32 inreg %b) #0 !dbg !12 {
@@ -67,7 +67,7 @@
 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
 !2 = !{}
 !3 = !{!4}
-!4 = distinct !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32 (i32, i32)** @"\01?fptr@@3P6IHHH@ZA")
+!4 = distinct !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}
diff --git a/llvm/test/DebugInfo/X86/DW_AT_specification.ll b/llvm/test/DebugInfo/X86/DW_AT_specification.ll
index edc1989..188b862 100644
--- a/llvm/test/DebugInfo/X86/DW_AT_specification.ll
+++ b/llvm/test/DebugInfo/X86/DW_AT_specification.ll
@@ -10,7 +10,7 @@
 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
 
 
-@_ZZN3foo3barEvE1x = constant i32 0, align 4
+@_ZZN3foo3barEvE1x = constant i32 0, align 4, !dbg !20
 
 define void @_ZN3foo3barEv()  !dbg !5 {
 entry:
@@ -32,7 +32,7 @@
 !12 = !DICompositeType(tag: DW_TAG_class_type, name: "foo", line: 1, size: 8, align: 8, file: !27, elements: !13)
 !13 = !{!11}
 !18 = !{!20}
-!20 = !DIGlobalVariable(name: "x", line: 5, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !21, variable: i32* @_ZZN3foo3barEvE1x)
+!20 = !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)
diff --git a/llvm/test/DebugInfo/X86/DW_TAG_friend.ll b/llvm/test/DebugInfo/X86/DW_TAG_friend.ll
index 5ce75cb..016bc26 100644
--- a/llvm/test/DebugInfo/X86/DW_TAG_friend.ll
+++ b/llvm/test/DebugInfo/X86/DW_TAG_friend.ll
@@ -12,8 +12,8 @@
 %class.A = type { i32 }
 %class.B = type { i32 }
 
-@a = global %class.A zeroinitializer, align 4
-@b = global %class.B zeroinitializer, align 4
+@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}
@@ -21,7 +21,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, emissionKind: FullDebug, file: !28, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5, !17}
-!5 = !DIGlobalVariable(name: "a", line: 10, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a)
+!5 = !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}
@@ -31,7 +31,7 @@
 !12 = !DISubroutineType(types: !13)
 !13 = !{null, !14}
 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !7)
-!17 = !DIGlobalVariable(name: "b", line: 11, isLocal: false, isDefinition: true, scope: null, file: !6, type: !18, variable: %class.B* @b)
+!17 = !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)
diff --git a/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll b/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll
index e70be4c..c95a7e0 100644
--- a/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll
+++ b/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll
@@ -6,7 +6,7 @@
 ; CHECK-NEXT:	info_string
  
 
-@i = common global i32 0                          ; <i32*> [#uses=2]
+@i = common global i32 0, !dbg !16                          ; <i32*> [#uses=2]
 
 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
 
@@ -45,7 +45,7 @@
 !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 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
+!16 = !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)
diff --git a/llvm/test/DebugInfo/X86/PR26148.ll b/llvm/test/DebugInfo/X86/PR26148.ll
index b195eaf..c930782 100644
--- a/llvm/test/DebugInfo/X86/PR26148.ll
+++ b/llvm/test/DebugInfo/X86/PR26148.ll
@@ -31,7 +31,7 @@
 
 %struct.S0 = type { i16, i32 }
 
-@a = common global %struct.S0 zeroinitializer, align 4
+@a = common global %struct.S0 zeroinitializer, align 4, !dbg !21
 
 declare void @llvm.dbg.declare(metadata, metadata, metadata)
 declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
@@ -84,7 +84,7 @@
 !18 = !DISubroutineType(types: !19)
 !19 = !{!15}
 !20 = !{!21}
-!21 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true, variable: %struct.S0* @a)
+!21 = !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}
diff --git a/llvm/test/DebugInfo/X86/arange-and-stub.ll b/llvm/test/DebugInfo/X86/arange-and-stub.ll
index 891429e..a56634c 100644
--- a/llvm/test/DebugInfo/X86/arange-and-stub.ll
+++ b/llvm/test/DebugInfo/X86/arange-and-stub.ll
@@ -10,7 +10,7 @@
 target triple = "x86_64-linux-gnu"
 
 @_ZTId = external constant i8*
-@zed = global [1 x void ()*] [void ()* @bar]
+@zed = global [1 x void ()*] [void ()* @bar], !dbg !11
 
 define void @foo() !dbg !4 {
   ret void
@@ -42,7 +42,7 @@
 !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 = !DIGlobalVariable(name: "zed", scope: !0, file: !5, line: 6, type: !12, isLocal: false, isDefinition: true, variable: [1 x void ()*]* @zed)
+!11 = !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)
diff --git a/llvm/test/DebugInfo/X86/arange.ll b/llvm/test/DebugInfo/X86/arange.ll
index 322459a..54156d6 100644
--- a/llvm/test/DebugInfo/X86/arange.ll
+++ b/llvm/test/DebugInfo/X86/arange.ll
@@ -22,7 +22,7 @@
 
 %struct.foo = type { i8 }
 
-@f = global %struct.foo zeroinitializer, align 1
+@f = global %struct.foo zeroinitializer, align 1, !dbg !10
 @i = external global i32
 
 !llvm.dbg.cu = !{!0}
@@ -39,7 +39,7 @@
 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !9 = !{!10}
-!10 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4, variable: %struct.foo* @f)
+!10 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4)
 !11 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo")
 !12 = !{i32 2, !"Dwarf Version", i32 4}
 !13 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/llvm/test/DebugInfo/X86/bitfields-dwarf4.ll b/llvm/test/DebugInfo/X86/bitfields-dwarf4.ll
index 5275fc6..a4ee76f 100644
--- a/llvm/test/DebugInfo/X86/bitfields-dwarf4.ll
+++ b/llvm/test/DebugInfo/X86/bitfields-dwarf4.ll
@@ -21,7 +21,7 @@
 
 %struct.PackedBits = type <{ i8, i32 }>
 
-@s = common global %struct.PackedBits zeroinitializer, align 1
+@s = common global %struct.PackedBits zeroinitializer, align 1, !dbg !4
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!14, !15, !16}
@@ -31,7 +31,7 @@
 !1 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm")
 !2 = !{}
 !3 = !{!4}
-!4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, variable: %struct.PackedBits* @s)
+!4 = distinct !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, align: 8, elements: !6)
 !6 = !{!7, !9, !13}
 
diff --git a/llvm/test/DebugInfo/X86/bitfields.ll b/llvm/test/DebugInfo/X86/bitfields.ll
index 1011558..9380ed4 100644
--- a/llvm/test/DebugInfo/X86/bitfields.ll
+++ b/llvm/test/DebugInfo/X86/bitfields.ll
@@ -48,7 +48,7 @@
 
 %struct.bitfield = type <{ i8, [3 x i8], i64 }>
 
-@b = common global %struct.bitfield zeroinitializer, align 4
+@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !4
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!13, !14, !15}
@@ -58,7 +58,7 @@
 !1 = !DIFile(filename: "bitfields.c", directory: "/")
 !2 = !{}
 !3 = !{!4}
-!4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true, variable: %struct.bitfield* @b)
+!4 = !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, align: 32, elements: !7)
 !7 = !{!8, !10, !11, !12}
diff --git a/llvm/test/DebugInfo/X86/c-type-units.ll b/llvm/test/DebugInfo/X86/c-type-units.ll
index 37cb3d5..282937b 100644
--- a/llvm/test/DebugInfo/X86/c-type-units.ll
+++ b/llvm/test/DebugInfo/X86/c-type-units.ll
@@ -11,7 +11,7 @@
 
 %struct.foo = type {}
 
-@f = common global %struct.foo zeroinitializer, align 1
+@f = common global %struct.foo zeroinitializer, align 1, !dbg !4
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!7, !8}
@@ -21,7 +21,7 @@
 !1 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo")
 !2 = !{}
 !3 = !{!4}
-!4 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: %struct.foo* @f)
+!4 = !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)
 !7 = !{i32 2, !"Dwarf Version", i32 4}
diff --git a/llvm/test/DebugInfo/X86/concrete_out_of_line.ll b/llvm/test/DebugInfo/X86/concrete_out_of_line.ll
index 47b2e5f..de06a88 100644
--- a/llvm/test/DebugInfo/X86/concrete_out_of_line.ll
+++ b/llvm/test/DebugInfo/X86/concrete_out_of_line.ll
@@ -118,7 +118,7 @@
 !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 = !DIGlobalVariable(name: "mRefCnt", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !37, variable: i32* null)
+!49 = !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)
diff --git a/llvm/test/DebugInfo/X86/cu-ranges-odr.ll b/llvm/test/DebugInfo/X86/cu-ranges-odr.ll
index 163d933..13652a5 100644
--- a/llvm/test/DebugInfo/X86/cu-ranges-odr.ll
+++ b/llvm/test/DebugInfo/X86/cu-ranges-odr.ll
@@ -20,7 +20,7 @@
 
 %class.A = type { i32 }
 
-@a = global %class.A zeroinitializer, align 4
+@a = global %class.A zeroinitializer, align 4, !dbg !22
 @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 {
@@ -81,7 +81,7 @@
 !19 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !15, type: !20, variables: !2)
 !20 = !DISubroutineType(types: !2)
 !21 = !{!22}
-!22 = !DIGlobalVariable(name: "a", line: 8, isLocal: false, isDefinition: true, scope: null, file: !15, type: !4, variable: %class.A* @a)
+!22 = !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)"}
diff --git a/llvm/test/DebugInfo/X86/data_member_location.ll b/llvm/test/DebugInfo/X86/data_member_location.ll
index eea636b..fe021e4 100644
--- a/llvm/test/DebugInfo/X86/data_member_location.ll
+++ b/llvm/test/DebugInfo/X86/data_member_location.ll
@@ -28,7 +28,7 @@
 
 %struct.foo = type { i8, i32 }
 
-@f = global %struct.foo zeroinitializer, align 4
+@f = global %struct.foo zeroinitializer, align 4, !dbg !11
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!13, !15}
@@ -45,7 +45,7 @@
 !8 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 3, size: 32, align: 32, offset: 32, file: !1, scope: !4, baseType: !9)
 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !10 = !{!11}
-!11 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !12, type: !4, variable: %struct.foo* @f)
+!11 = !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")
 !13 = !{i32 2, !"Dwarf Version", i32 4}
 !14 = !{!"clang version 3.4 "}
diff --git a/llvm/test/DebugInfo/X86/dbg-subrange.ll b/llvm/test/DebugInfo/X86/dbg-subrange.ll
index 6c69053..aa733ac 100644
--- a/llvm/test/DebugInfo/X86/dbg-subrange.ll
+++ b/llvm/test/DebugInfo/X86/dbg-subrange.ll
@@ -3,7 +3,7 @@
 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
+@s = common global [4294967296 x i8] zeroinitializer, align 16, !dbg !13
 ; CHECK: .quad 4294967296 ## DW_AT_count
 
 define void @bar() nounwind uwtable ssp !dbg !5 {
@@ -22,7 +22,7 @@
 !7 = !DISubroutineType(types: !8)
 !8 = !{null}
 !11 = !{!13}
-!13 = !DIGlobalVariable(name: "s", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !14, variable: [4294967296 x i8]* @s)
+!13 = !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}
diff --git a/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll b/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
index f647d60..7db2582 100644
--- a/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
+++ b/llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
@@ -41,7 +41,7 @@
 
 %struct.S1 = type { float*, i32 }
 
-@p = common global %struct.S1 zeroinitializer, align 8
+@p = common global %struct.S1 zeroinitializer, align 8, !dbg !19
 
 define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) nounwind optsize ssp !dbg !0 {
 entry:
@@ -93,7 +93,7 @@
 !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 = !DIGlobalVariable(name: "p", line: 14, isLocal: false, isDefinition: true, scope: !2, file: !1, type: !11, variable: %struct.S1* @p)
+!19 = !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)
diff --git a/llvm/test/DebugInfo/X86/dbg-value-regmask-clobber.ll b/llvm/test/DebugInfo/X86/dbg-value-regmask-clobber.ll
index 31a0658..048c98d 100644
--- a/llvm/test/DebugInfo/X86/dbg-value-regmask-clobber.ll
+++ b/llvm/test/DebugInfo/X86/dbg-value-regmask-clobber.ll
@@ -36,7 +36,7 @@
 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
+@x = common global i32 0, align 4, !dbg !15
 
 ; Function Attrs: nounwind uwtable
 define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 !dbg !4 {
@@ -89,7 +89,7 @@
 !12 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 4, type: !8)
 !13 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 4, type: !7)
 !14 = !{!15}
-!15 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !16, isLocal: false, isDefinition: true, variable: i32* @x)
+!15 = !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}
diff --git a/llvm/test/DebugInfo/X86/debug-info-access.ll b/llvm/test/DebugInfo/X86/debug-info-access.ll
index f3ed35b..fa0752d 100644
--- a/llvm/test/DebugInfo/X86/debug-info-access.ll
+++ b/llvm/test/DebugInfo/X86/debug-info-access.ll
@@ -91,9 +91,9 @@
 %class.B = type { i8 }
 %union.U = type { i32 }
 
-@a = global %struct.A zeroinitializer, align 1
-@b = global %class.B zeroinitializer, align 1
-@u = global %union.U zeroinitializer, align 4
+@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
 
 ; Function Attrs: nounwind ssp uwtable
 define void @_Z4freev() #0 !dbg !30 {
@@ -140,9 +140,9 @@
 !32 = !DISubroutineType(types: !33)
 !33 = !{null}
 !34 = !{!35, !36, !37}
-!35 = !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !4, variable: %struct.A* @a)
-!36 = !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !12, variable: %class.B* @b)
-!37 = !DIGlobalVariable(name: "u", line: 39, isLocal: false, isDefinition: true, scope: null, file: !31, type: !22, variable: %union.U* @u)
+!35 = !DIGlobalVariable(name: "a", line: 37, isLocal: false, isDefinition: true, scope: null, file: !31, type: !4)
+!36 = !DIGlobalVariable(name: "b", line: 38, isLocal: false, isDefinition: true, scope: null, file: !31, type: !12)
+!37 = !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 "}
diff --git a/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll b/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll
index d041cf3..4ed3583 100644
--- a/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll
+++ b/llvm/test/DebugInfo/X86/debug-info-packed-struct.ll
@@ -139,10 +139,10 @@
 ; CHECK:          DW_AT_bit_offset {{.*}} (0x1f)
 ; CHECK:          DW_AT_data_member_location {{.*}}0c
 
-@l0 = common global %struct.layout0 zeroinitializer, align 8
-@l1 = common global %struct.layout1 zeroinitializer, align 4
-@l2 = common global %struct.layout2 zeroinitializer, align 1
-@l3 = common global %struct.layout3 zeroinitializer, align 4
+@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}
@@ -152,7 +152,7 @@
 !1 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/<stdin>", directory: "/llvm/_build.ninja.release")
 !2 = !{}
 !3 = !{!4, !18, !25, !35}
-!4 = !DIGlobalVariable(name: "l0", scope: !0, file: !5, line: 88, type: !6, isLocal: false, isDefinition: true, variable: %struct.layout0* @l0)
+!4 = !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, align: 64, elements: !7)
 !7 = !{!8, !10, !17}
@@ -166,14 +166,14 @@
 !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, align: 64, encoding: DW_ATE_signed)
 !17 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs16", scope: !6, file: !5, line: 18, baseType: !14, size: 1, align: 32, offset: 128)
-!18 = !DIGlobalVariable(name: "l1", scope: !0, file: !5, line: 89, type: !19, isLocal: false, isDefinition: true, variable: %struct.layout1* @l1)
+!18 = !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, align: 32, 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, align: 8)
 !22 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs1", scope: !19, file: !5, line: 36, baseType: !23, size: 64, align: 8, offset: 8)
 !23 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_anon", file: !5, line: 30, size: 64, align: 8, elements: !2)
 !24 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs9", scope: !19, file: !5, line: 37, baseType: !14, size: 1, align: 32, offset: 72)
-!25 = !DIGlobalVariable(name: "l2", scope: !0, file: !5, line: 90, type: !26, isLocal: false, isDefinition: true, variable: %struct.layout2* @l2)
+!25 = !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, align: 8, 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, align: 8)
@@ -183,7 +183,7 @@
 !32 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !30, file: !5, line: 51, baseType: !14, size: 4, align: 32)
 !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, align: 32, offset: 72)
-!35 = !DIGlobalVariable(name: "l3", scope: !0, file: !5, line: 91, type: !36, isLocal: false, isDefinition: true, variable: %struct.layout3* @l3)
+!35 = !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, align: 32, 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, align: 8)
diff --git a/llvm/test/DebugInfo/X86/debug-info-static-member.ll b/llvm/test/DebugInfo/X86/debug-info-static-member.ll
index cbe5117..017501e 100644
--- a/llvm/test/DebugInfo/X86/debug-info-static-member.ll
+++ b/llvm/test/DebugInfo/X86/debug-info-static-member.ll
@@ -38,9 +38,9 @@
 
 %class.C = type { i32 }
 
-@_ZN1C1aE = global i32 4, align 4
-@_ZN1C1bE = global i32 2, align 4
-@_ZN1C1cE = global i32 1, align 4
+@_ZN1C1aE = global i32 4, align 4, !dbg !12
+@_ZN1C1bE = global i32 2, align 4, !dbg !27
+@_ZN1C1cE = global i32 1, align 4, !dbg !28
 
 define i32 @main() nounwind uwtable !dbg !5 {
 entry:
@@ -67,7 +67,7 @@
 !8 = !{!9}
 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !10 = !{!12, !27, !28}
-!12 = !DIGlobalVariable(name: "a", linkageName: "_ZN1C1aE", line: 14, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1aE, declaration: !15)
+!12 = !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)
@@ -82,8 +82,8 @@
 !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 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1bE, declaration: !19)
-!28 = !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", line: 16, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1cE, declaration: !23)
+!27 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, declaration: !19)
+!28 = !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)
diff --git a/llvm/test/DebugInfo/X86/debug-loc-frame.ll b/llvm/test/DebugInfo/X86/debug-loc-frame.ll
index 9a6b6aa..905e35b 100644
--- a/llvm/test/DebugInfo/X86/debug-loc-frame.ll
+++ b/llvm/test/DebugInfo/X86/debug-loc-frame.ll
@@ -42,10 +42,10 @@
 ; ModuleID = 'frame.c'
 source_filename = "frame.c"
 
-@data = global i32 17, align 4
-@sum = local_unnamed_addr global i32 0, align 4
-@zero = local_unnamed_addr global i32 0, align 4
-@ptr = common local_unnamed_addr global i32* null, align 8
+@data = global i32 17, align 4, !dbg !4
+@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
 
 ; Function Attrs: nounwind uwtable
 define i32 @main() local_unnamed_addr !dbg !13 {
@@ -83,11 +83,11 @@
 !1 = !DIFile(filename: "frame.c", directory: "/home/user/test")
 !2 = !{}
 !3 = !{!4, !6, !7, !8}
-!4 = distinct !DIGlobalVariable(name: "data", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @data)
+!4 = distinct !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 !DIGlobalVariable(name: "sum", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32* @sum)
-!7 = distinct !DIGlobalVariable(name: "zero", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, variable: i32* @zero)
-!8 = distinct !DIGlobalVariable(name: "ptr", scope: !0, file: !1, line: 4, type: !9, isLocal: false, isDefinition: true, variable: i32** @ptr)
+!6 = distinct !DIGlobalVariable(name: "sum", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true)
+!7 = distinct !DIGlobalVariable(name: "zero", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true)
+!8 = distinct !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}
diff --git a/llvm/test/DebugInfo/X86/debugger-tune.ll b/llvm/test/DebugInfo/X86/debugger-tune.ll
index 3c9288b..9e82c49 100644
--- a/llvm/test/DebugInfo/X86/debugger-tune.ll
+++ b/llvm/test/DebugInfo/X86/debugger-tune.ll
@@ -27,7 +27,7 @@
 ; SCE-NOT: apple_names
 
 
-@globalvar = global i32 0, align 4
+@globalvar = global i32 0, align 4, !dbg !4
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!6, !7}
@@ -37,7 +37,7 @@
 !1 = !DIFile(filename: "debugger-tune.cpp", directory: "/home/probinson/projects/scratch")
 !2 = !{}
 !3 = !{!4}
-!4 = !DIGlobalVariable(name: "globalvar", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @globalvar)
+!4 = !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}
diff --git a/llvm/test/DebugInfo/X86/decl-derived-member.ll b/llvm/test/DebugInfo/X86/decl-derived-member.ll
index 730af85..fec59f9 100644
--- a/llvm/test/DebugInfo/X86/decl-derived-member.ll
+++ b/llvm/test/DebugInfo/X86/decl-derived-member.ll
@@ -28,7 +28,7 @@
 
 $_ZN4baseC2Ev = comdat any
 
-@f = global %struct.foo zeroinitializer, align 8
+@f = global %struct.foo zeroinitializer, align 8, !dbg !29
 @__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 }]
@@ -128,7 +128,7 @@
 !26 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, file: !1, scope: !11, type: !27, variables: !2)
 !27 = !DISubroutineType(types: !2)
 !28 = !{!29}
-!29 = !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !4, variable: %struct.foo* @f)
+!29 = !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)"}
diff --git a/llvm/test/DebugInfo/X86/dllimport.ll b/llvm/test/DebugInfo/X86/dllimport.ll
index 60c3116..b809a9d 100644
--- a/llvm/test/DebugInfo/X86/dllimport.ll
+++ b/llvm/test/DebugInfo/X86/dllimport.ll
@@ -5,7 +5,7 @@
 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
+@"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4, !dbg !4
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!13, !14}
@@ -14,7 +14,7 @@
 !1 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
 !2 = !{}
 !3 = !{!4}
-!4 = distinct !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !0, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, variable: i32* @"\01?id@?$numpunct@D@@0HA", declaration: !7)
+!4 = distinct !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)
diff --git a/llvm/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll b/llvm/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll
index d9eb0ec..6be5d61 100644
--- a/llvm/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll
+++ b/llvm/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll
@@ -23,7 +23,7 @@
 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
+@global = global i32 2, align 4, !dbg !18
 
 ; Function Attrs: nounwind readnone uwtable
 define i32 @_Z3fooi(i32 %bar) #0 !dbg !4 {
@@ -77,7 +77,7 @@
 !15 = !DISubroutineType(types: !16)
 !16 = !{!8}
 !17 = !{!18}
-!18 = !DIGlobalVariable(name: "global", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @global)
+!18 = !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)
diff --git a/llvm/test/DebugInfo/X86/dwarf-aranges.ll b/llvm/test/DebugInfo/X86/dwarf-aranges.ll
index 2ec2467..d736b50 100644
--- a/llvm/test/DebugInfo/X86/dwarf-aranges.ll
+++ b/llvm/test/DebugInfo/X86/dwarf-aranges.ll
@@ -44,9 +44,9 @@
 
 target triple = "x86_64-unknown-linux-gnu"
 
-@some_data = global i32 4, align 4
-@some_other = global i32 5, section "strange+section", align 4
-@some_bss = common global i32 0, align 4
+@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
 
 define void @some_code() !dbg !4 {
 entry:
@@ -70,10 +70,10 @@
 !6 = !DISubroutineType(types: !7)
 !7 = !{null}
 !8 = !{!9, !11, !12}
-!9 = !DIGlobalVariable(name: "some_data", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @some_data)
+!9 = !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 = !DIGlobalVariable(name: "some_other", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @some_other)
-!12 = !DIGlobalVariable(name: "some_bss", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @some_bss)
+!11 = !DIGlobalVariable(name: "some_other", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10)
+!12 = !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)
diff --git a/llvm/test/DebugInfo/X86/dwarf-linkage-names.ll b/llvm/test/DebugInfo/X86/dwarf-linkage-names.ll
index 9e89ee9..a4437aa 100644
--- a/llvm/test/DebugInfo/X86/dwarf-linkage-names.ll
+++ b/llvm/test/DebugInfo/X86/dwarf-linkage-names.ll
@@ -38,7 +38,7 @@
 ; NOLINKAGE-NOT: .asciz   "_ZN4test10global_varE"
 ; NOLINKAGE-NOT: .asciz   "_ZN4test3barEv"
 
-@_ZN4test10global_varE = global i32 0, align 4
+@_ZN4test10global_varE = global i32 0, align 4, !dbg !10
 
 ; Function Attrs: nounwind uwtable
 define i32 @_ZN4test3barEv() #0 !dbg !4 {
@@ -62,7 +62,7 @@
 !7 = !{!8}
 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !9 = !{!10}
-!10 = !DIGlobalVariable(name: "global_var", linkageName: "_ZN4test10global_varE", scope: !5, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, variable: i32* @_ZN4test10global_varE)
+!10 = !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)"}
diff --git a/llvm/test/DebugInfo/X86/dwarf-public-names.ll b/llvm/test/DebugInfo/X86/dwarf-public-names.ll
index e6cdd7b..70fdb5b 100644
--- a/llvm/test/DebugInfo/X86/dwarf-public-names.ll
+++ b/llvm/test/DebugInfo/X86/dwarf-public-names.ll
@@ -57,9 +57,9 @@
 
 %struct.C = type { i8 }
 
-@_ZN1C22static_member_variableE = global i32 0, align 4
-@global_variable = global %struct.C zeroinitializer, align 1
-@_ZN2ns25global_namespace_variableE = global i32 1, align 4
+@_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
 
 define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 !dbg !3 {
 entry:
@@ -120,9 +120,9 @@
 !22 = !DISubroutineType(types: !23)
 !23 = !{null}
 !24 = !{!25, !26, !27}
-!25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, variable: i32* @_ZN1C22static_member_variableE, declaration: !10)
-!26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8, variable: %struct.C* @global_variable)
-!27 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11, variable: i32* @_ZN2ns25global_namespace_variableE)
+!25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, declaration: !10)
+!26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8)
+!27 = !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)
diff --git a/llvm/test/DebugInfo/X86/empty-array.ll b/llvm/test/DebugInfo/X86/empty-array.ll
index e927f9f..7c3cdc0 100644
--- a/llvm/test/DebugInfo/X86/empty-array.ll
+++ b/llvm/test/DebugInfo/X86/empty-array.ll
@@ -4,7 +4,7 @@
 
 %class.A = type { [0 x i32] }
 
-@a = global %class.A zeroinitializer, align 4
+@a = global %class.A zeroinitializer, align 4, !dbg !5
 
 ; CHECK: DW_TAG_class_type
 ; CHECK:      DW_TAG_member
@@ -30,7 +30,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a)
+!5 = !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}
diff --git a/llvm/test/DebugInfo/X86/enum-class.ll b/llvm/test/DebugInfo/X86/enum-class.ll
index eaf43d2..247215d 100644
--- a/llvm/test/DebugInfo/X86/enum-class.ll
+++ b/llvm/test/DebugInfo/X86/enum-class.ll
@@ -1,9 +1,9 @@
 ; 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
-@b = global i64 0, align 8
-@c = global i32 0, align 4
+@a = global i32 0, align 4, !dbg !19
+@b = global i64 0, align 8, !dbg !20
+@c = global i32 0, align 4, !dbg !21
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!23}
@@ -24,9 +24,9 @@
 !14 = !DIEnumerator(name: "C1", value: 1) ; [ DW_TAG_enumerator ]
 !15 = !{}
 !17 = !{!19, !20, !21}
-!19 = !DIGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !4, type: !3, variable: i32* @a)
-!20 = !DIGlobalVariable(name: "b", line: 5, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8, variable: i64* @b)
-!21 = !DIGlobalVariable(name: "c", line: 6, isLocal: false, isDefinition: true, scope: null, file: !4, type: !12, variable: i32* @c)
+!19 = !DIGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !4, type: !3)
+!20 = !DIGlobalVariable(name: "b", line: 5, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8)
+!21 = !DIGlobalVariable(name: "c", line: 6, isLocal: false, isDefinition: true, scope: null, file: !4, type: !12)
 !22 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
 
 ; CHECK: DW_TAG_enumeration_type [{{.*}}]
diff --git a/llvm/test/DebugInfo/X86/enum-fwd-decl.ll b/llvm/test/DebugInfo/X86/enum-fwd-decl.ll
index c01f513..e05e105 100644
--- a/llvm/test/DebugInfo/X86/enum-fwd-decl.ll
+++ b/llvm/test/DebugInfo/X86/enum-fwd-decl.ll
@@ -1,7 +1,7 @@
 ; 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
+@e = global i16 0, align 2, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!9}
@@ -9,7 +9,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 165274) (llvm/trunk 165272)", isOptimized: false, emissionKind: FullDebug, file: !8, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "e", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i16* @e)
+!5 = !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")
diff --git a/llvm/test/DebugInfo/X86/externaltyperef.ll b/llvm/test/DebugInfo/X86/externaltyperef.ll
index 7d89559..1bc69a9 100644
--- a/llvm/test/DebugInfo/X86/externaltyperef.ll
+++ b/llvm/test/DebugInfo/X86/externaltyperef.ll
@@ -26,7 +26,7 @@
 
 %class.A = type opaque
 
-@a = global %class.A* null, align 8
+@a = global %class.A* null, align 8, !dbg !6
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!13, !14, !15}
@@ -38,7 +38,7 @@
 !3 = !{!4, !9}
 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTS1A")
 !5 = !{!6}
-!6 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: %class.A** @a)
+!6 = !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")
diff --git a/llvm/test/DebugInfo/X86/fission-cu.ll b/llvm/test/DebugInfo/X86/fission-cu.ll
index 96bb6e2..8d1e2f9 100644
--- a/llvm/test/DebugInfo/X86/fission-cu.ll
+++ b/llvm/test/DebugInfo/X86/fission-cu.ll
@@ -3,7 +3,7 @@
 ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s
 ; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
 
-@a = common global i32 0, align 4
+@a = common global i32 0, align 4, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!9}
@@ -11,7 +11,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, splitDebugFilename: "baz.dwo", emissionKind: FullDebug, file: !8, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @a)
+!5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
 !6 = !DIFile(filename: "baz.c", directory: "/usr/local/google/home/echristo/tmp")
 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !8 = !DIFile(filename: "baz.c", directory: "/usr/local/google/home/echristo/tmp")
diff --git a/llvm/test/DebugInfo/X86/generate-odr-hash.ll b/llvm/test/DebugInfo/X86/generate-odr-hash.ll
index a2ee2b9..f8a7a29 100644
--- a/llvm/test/DebugInfo/X86/generate-odr-hash.ll
+++ b/llvm/test/DebugInfo/X86/generate-odr-hash.ll
@@ -173,10 +173,10 @@
 %struct.anon = type { i32, i32 }
 %struct.baz = type { i8 }
 
-@b = global %struct.bar zeroinitializer, align 1
-@_ZN7echidna8capybara8mongoose6animalE = global %"class.echidna::capybara::mongoose::fluffy" zeroinitializer, align 4
-@w = internal global %"struct.<anonymous namespace>::walrus" zeroinitializer, align 1
-@wom = global %struct.wombat zeroinitializer, align 4
+@b = global %struct.bar zeroinitializer, align 1, !dbg !39
+@_ZN7echidna8capybara8mongoose6animalE = global %"class.echidna::capybara::mongoose::fluffy" zeroinitializer, align 4, !dbg !40
+@w = internal global %"struct.<anonymous namespace>::walrus" zeroinitializer, align 1, !dbg !41
+@wom = global %struct.wombat zeroinitializer, align 4, !dbg !42
 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
 
 ; Function Attrs: nounwind uwtable
@@ -256,10 +256,10 @@
 !36 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, unit: !0, scopeLine: 25, file: !1, scope: !23, type: !37, variables: !2)
 !37 = !DISubroutineType(types: !2)
 !38 = !{!39, !40, !41, !42}
-!39 = !DIGlobalVariable(name: "b", line: 3, isLocal: false, isDefinition: true, scope: null, file: !23, type: !4, variable: %struct.bar* @b)
-!40 = !DIGlobalVariable(name: "animal", linkageName: "_ZN7echidna8capybara8mongoose6animalE", line: 18, isLocal: false, isDefinition: true, scope: !7, file: !23, type: !6, variable: %"class.echidna::capybara::mongoose::fluffy"* @_ZN7echidna8capybara8mongoose6animalE)
-!41 = !DIGlobalVariable(name: "w", line: 29, isLocal: true, isDefinition: true, scope: null, file: !23, type: !28, variable: %"struct.<anonymous namespace>::walrus"* @w)
-!42 = !DIGlobalVariable(name: "wom", line: 38, isLocal: false, isDefinition: true, scope: null, file: !23, type: !14, variable: %struct.wombat* @wom)
+!39 = !DIGlobalVariable(name: "b", line: 3, isLocal: false, isDefinition: true, scope: null, file: !23, type: !4)
+!40 = !DIGlobalVariable(name: "animal", linkageName: "_ZN7echidna8capybara8mongoose6animalE", line: 18, isLocal: false, isDefinition: true, scope: !7, file: !23, type: !6)
+!41 = !DIGlobalVariable(name: "w", line: 29, isLocal: true, isDefinition: true, scope: null, file: !23, type: !28)
+!42 = !DIGlobalVariable(name: "wom", line: 38, isLocal: false, isDefinition: true, scope: null, file: !23, type: !14)
 !43 = !{i32 2, !"Dwarf Version", i32 4}
 !44 = !{i32 1, !"Debug Info Version", i32 3}
 !45 = !{!"clang version 3.5 "}
diff --git a/llvm/test/DebugInfo/X86/gnu-public-names.ll b/llvm/test/DebugInfo/X86/gnu-public-names.ll
index 026e086..dade8bb 100644
--- a/llvm/test/DebugInfo/X86/gnu-public-names.ll
+++ b/llvm/test/DebugInfo/X86/gnu-public-names.ll
@@ -230,14 +230,14 @@
 %struct.C = type { i8 }
 %"struct.ns::D" = type { i32 }
 
-@_ZN1C22static_member_variableE = global i32 0, align 4
-@global_variable = global %struct.C zeroinitializer, align 1
-@_ZN2ns25global_namespace_variableE = global i32 1, align 4
-@_ZN2ns1dE = global %"struct.ns::D" zeroinitializer, align 4
-@_ZZ2f3vE1z = internal global i32 0, align 4
-@_ZN12_GLOBAL__N_11iE = internal global i32 0, align 4
-@_ZN12_GLOBAL__N_15inner1bE = internal global i32 0, align 4
-@_ZN5outer12_GLOBAL__N_11cE = internal global i32 0, align 4
+@_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !32
+@global_variable = global %struct.C zeroinitializer, align 1, !dbg !33
+@_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !34
+@_ZN2ns1dE = global %"struct.ns::D" zeroinitializer, align 4, !dbg !35
+@_ZZ2f3vE1z = internal global i32 0, align 4, !dbg !36
+@_ZN12_GLOBAL__N_11iE = internal global i32 0, align 4, !dbg !37
+@_ZN12_GLOBAL__N_15inner1bE = internal global i32 0, align 4, !dbg !39
+@_ZN5outer12_GLOBAL__N_11cE = internal global i32 0, align 4, !dbg !41
 
 ; Function Attrs: nounwind uwtable
 define void @_ZN1C15member_functionEv(%struct.C* %this) #0 align 2 !dbg !20 {
@@ -331,16 +331,16 @@
 !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
 !30 = distinct !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !1, file: !1, line: 57, type: !13, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
 !31 = !{!32, !33, !34, !35, !36, !37, !39, !41}
-!32 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !0, file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, variable: i32* @_ZN1C22static_member_variableE, declaration: !6)
-!33 = !DIGlobalVariable(name: "global_variable", scope: !0, file: !1, line: 17, type: !4, isLocal: false, isDefinition: true, variable: %struct.C* @global_variable)
-!34 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !16, file: !1, line: 27, type: !7, isLocal: false, isDefinition: true, variable: i32* @_ZN2ns25global_namespace_variableE)
-!35 = !DIGlobalVariable(name: "d", linkageName: "_ZN2ns1dE", scope: !16, file: !1, line: 31, type: !15, isLocal: false, isDefinition: true, variable: %"struct.ns::D"* @_ZN2ns1dE)
-!36 = !DIGlobalVariable(name: "z", scope: !26, file: !1, line: 41, type: !7, isLocal: true, isDefinition: true, variable: i32* @_ZZ2f3vE1z)
-!37 = !DIGlobalVariable(name: "i", linkageName: "_ZN12_GLOBAL__N_11iE", scope: !38, file: !1, line: 37, type: !7, isLocal: true, isDefinition: true, variable: i32* @_ZN12_GLOBAL__N_11iE)
+!32 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !0, file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, declaration: !6)
+!33 = !DIGlobalVariable(name: "global_variable", scope: !0, file: !1, line: 17, type: !4, isLocal: false, isDefinition: true)
+!34 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !16, file: !1, line: 27, type: !7, isLocal: false, isDefinition: true)
+!35 = !DIGlobalVariable(name: "d", linkageName: "_ZN2ns1dE", scope: !16, file: !1, line: 31, type: !15, isLocal: false, isDefinition: true)
+!36 = !DIGlobalVariable(name: "z", scope: !26, file: !1, line: 41, type: !7, isLocal: true, isDefinition: true)
+!37 = !DIGlobalVariable(name: "i", linkageName: "_ZN12_GLOBAL__N_11iE", scope: !38, file: !1, line: 37, type: !7, isLocal: true, isDefinition: true)
 !38 = !DINamespace(scope: null, file: !1, line: 36)
-!39 = !DIGlobalVariable(name: "b", linkageName: "_ZN12_GLOBAL__N_15inner1bE", scope: !40, file: !1, line: 47, type: !7, isLocal: true, isDefinition: true, variable: i32* @_ZN12_GLOBAL__N_15inner1bE)
+!39 = !DIGlobalVariable(name: "b", linkageName: "_ZN12_GLOBAL__N_15inner1bE", scope: !40, file: !1, line: 47, type: !7, isLocal: true, isDefinition: true)
 !40 = !DINamespace(name: "inner", scope: !38, file: !1, line: 46)
-!41 = !DIGlobalVariable(name: "c", linkageName: "_ZN5outer12_GLOBAL__N_11cE", scope: !42, file: !1, line: 53, type: !7, isLocal: true, isDefinition: true, variable: i32* @_ZN5outer12_GLOBAL__N_11cE)
+!41 = !DIGlobalVariable(name: "c", linkageName: "_ZN5outer12_GLOBAL__N_11cE", scope: !42, file: !1, line: 53, type: !7, isLocal: true, isDefinition: true)
 !42 = !DINamespace(scope: !43, file: !1, line: 52)
 !43 = !DINamespace(name: "outer", scope: null, file: !1, line: 51)
 !44 = !{!45, !47}
diff --git a/llvm/test/DebugInfo/X86/inline-member-function.ll b/llvm/test/DebugInfo/X86/inline-member-function.ll
index bdf0667..f4c18bb 100644
--- a/llvm/test/DebugInfo/X86/inline-member-function.ll
+++ b/llvm/test/DebugInfo/X86/inline-member-function.ll
@@ -34,7 +34,7 @@
 
 %struct.foo = type { i8 }
 
-@i = global i32 0, align 4
+@i = global i32 0, align 4, !dbg !19
 
 ; Function Attrs: uwtable
 define i32 @main() #0 !dbg !13 {
@@ -82,7 +82,7 @@
 !16 = !{!9}
 !17 = distinct !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !4, type: !7, declaration: !6, variables: !2)
 !18 = !{!19}
-!19 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: null, file: !14, type: !9, variable: i32* @i)
+!19 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: null, file: !14, type: !9)
 !20 = !{i32 2, !"Dwarf Version", i32 4}
 !21 = !{i32 1, !"Debug Info Version", i32 3}
 !22 = !{!"clang version 3.5.0 "}
diff --git a/llvm/test/DebugInfo/X86/inlined-indirect-value.ll b/llvm/test/DebugInfo/X86/inlined-indirect-value.ll
index ea5d88a..c19bd15 100644
--- a/llvm/test/DebugInfo/X86/inlined-indirect-value.ll
+++ b/llvm/test/DebugInfo/X86/inlined-indirect-value.ll
@@ -19,8 +19,8 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-@x = common global i32 0, align 4
-@y = common global i32 0, align 4
+@x = common global i32 0, align 4, !dbg !10
+@y = common global i32 0, align 4, !dbg !12
 
 define i32 @main() !dbg !4 {
 ; CHECK: .loc 1 {{[89]}}
@@ -58,9 +58,9 @@
 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !8 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !2)
 !9 = !{!10, !12}
-!10 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !11, isLocal: false, isDefinition: true, variable: i32* @x)
+!10 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !11, isLocal: false, isDefinition: true)
 !11 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
-!12 = !DIGlobalVariable(name: "y", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @y)
+!12 = !DIGlobalVariable(name: "y", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true)
 !13 = !{i32 2, !"Dwarf Version", i32 4}
 !14 = !{i32 2, !"Debug Info Version", i32 3}
 !16 = !DILocation(line: 4, column: 9, scope: !17, inlinedAt: !18)
diff --git a/llvm/test/DebugInfo/X86/isel-cse-line.ll b/llvm/test/DebugInfo/X86/isel-cse-line.ll
index dfb058b..7140a4d 100644
--- a/llvm/test/DebugInfo/X86/isel-cse-line.ll
+++ b/llvm/test/DebugInfo/X86/isel-cse-line.ll
@@ -31,8 +31,8 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-@glb_start = global i64 17, align 8
-@glb_end = global i64 42, align 8
+@glb_start = global i64 17, align 8, !dbg !7
+@glb_end = global i64 42, align 8, !dbg !10
 
 ; Function Attrs: norecurse nounwind uwtable
 define i32 @main() !dbg !14 {
@@ -73,10 +73,10 @@
 !4 = !DIDerivedType(tag: DW_TAG_typedef, name: "fp_t", file: !1, line: 1, baseType: !5)
 !5 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
 !6 = !{!7, !10}
-!7 = distinct !DIGlobalVariable(name: "glb_start", scope: !0, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i64* @glb_start)
+!7 = distinct !DIGlobalVariable(name: "glb_start", scope: !0, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true)
 !8 = !DIDerivedType(tag: DW_TAG_typedef, name: "int_t", file: !1, line: 2, baseType: !9)
 !9 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
-!10 = distinct !DIGlobalVariable(name: "glb_end", scope: !0, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, variable: i64* @glb_end)
+!10 = distinct !DIGlobalVariable(name: "glb_end", scope: !0, file: !1, line: 5, 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.9.0 (trunk 268246)"}
diff --git a/llvm/test/DebugInfo/X86/linkage-name.ll b/llvm/test/DebugInfo/X86/linkage-name.ll
index 295b898..a84cde7 100644
--- a/llvm/test/DebugInfo/X86/linkage-name.ll
+++ b/llvm/test/DebugInfo/X86/linkage-name.ll
@@ -7,7 +7,7 @@
 
 %class.A = type { i8 }
 
-@a = global %class.A zeroinitializer, align 1
+@a = global %class.A zeroinitializer, align 1, !dbg !20
 
 define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) nounwind uwtable ssp align 2 !dbg !5 {
 entry:
@@ -39,7 +39,7 @@
 !12 = !{!13}
 !13 = !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, file: !6, scope: !11, type: !7)
 !18 = !{!20}
-!20 = !DIGlobalVariable(name: "a", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !11, variable: %class.A* @a)
+!20 = !DIGlobalVariable(name: "a", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !11)
 !21 = !DILocalVariable(name: "this", line: 5, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !22)
 !22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11)
 !23 = !DILocation(line: 5, column: 8, scope: !5)
diff --git a/llvm/test/DebugInfo/X86/live-debug-values.ll b/llvm/test/DebugInfo/X86/live-debug-values.ll
index eca3010..d7a8298 100644
--- a/llvm/test/DebugInfo/X86/live-debug-values.ll
+++ b/llvm/test/DebugInfo/X86/live-debug-values.ll
@@ -39,7 +39,7 @@
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-@m = common global i32 0, align 4
+@m = common global i32 0, align 4, !dbg !16
 @.str = private unnamed_addr constant [13 x i8] c"m(main): %d\0A\00", align 1
 
 ; Function Attrs: nounwind uwtable
@@ -119,7 +119,7 @@
 !13 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 6, type: !8)
 !14 = !DILocalVariable(name: "n", scope: !4, file: !1, line: 7, type: !7)
 !15 = !{!16}
-!16 = !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @m)
+!16 = !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true)
 !17 = !{i32 2, !"Dwarf Version", i32 4}
 !18 = !{i32 2, !"Debug Info Version", i32 3}
 !19 = !{!"clang version 3.8.0 (trunk 253049) "}
diff --git a/llvm/test/DebugInfo/X86/memberfnptr.ll b/llvm/test/DebugInfo/X86/memberfnptr.ll
index bb6dca9..6d54824 100644
--- a/llvm/test/DebugInfo/X86/memberfnptr.ll
+++ b/llvm/test/DebugInfo/X86/memberfnptr.ll
@@ -16,7 +16,7 @@
 
 %struct.A = type { i8 }
 
-@p = global { i64, i64 } { i64 ptrtoint (void (%struct.A*)* @_ZN1A3fooEv to i64), i64 0 }, align 8
+@p = global { i64, i64 } { i64 ptrtoint (void (%struct.A*)* @_ZN1A3fooEv to i64), i64 0 }, align 8, !dbg !11
 
 declare void @_ZN1A3fooEv(%struct.A*)
 
@@ -35,7 +35,7 @@
 !8 = !{null, !9}
 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
 !10 = !{!11}
-!11 = !DIGlobalVariable(name: "p", line: 5, isLocal: false, isDefinition: true, scope: null, file: !12, type: !13, variable: { i64, i64 }* @p)
+!11 = !DIGlobalVariable(name: "p", line: 5, isLocal: false, isDefinition: true, scope: null, file: !12, type: !13)
 !12 = !DIFile(filename: "memberfnptr.cpp", directory: "")
 !13 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, size: 64, baseType: !7, extraData: !4)
 !14 = !{i32 2, !"Dwarf Version", i32 2}
diff --git a/llvm/test/DebugInfo/X86/misched-dbg-value.ll b/llvm/test/DebugInfo/X86/misched-dbg-value.ll
index 96d5980..5b923ff 100644
--- a/llvm/test/DebugInfo/X86/misched-dbg-value.ll
+++ b/llvm/test/DebugInfo/X86/misched-dbg-value.ll
@@ -36,15 +36,15 @@
 
 %struct.Record = type { %struct.Record*, i32, i32, i32, [31 x i8] }
 
-@Version = global [4 x i8] c"1.1\00", align 1
-@IntGlob = common global i32 0, align 4
-@BoolGlob = common global i32 0, align 4
-@Char1Glob = common global i8 0, align 1
-@Char2Glob = common global i8 0, align 1
-@Array1Glob = common global [51 x i32] zeroinitializer, align 16
-@Array2Glob = common global [51 x [51 x i32]] zeroinitializer, align 16
-@PtrGlb = common global %struct.Record* null, align 8
-@PtrGlbNext = common global %struct.Record* null, align 8
+@Version = global [4 x i8] c"1.1\00", align 1, !dbg !30
+@IntGlob = common global i32 0, align 4, !dbg !35
+@BoolGlob = common global i32 0, align 4, !dbg !36
+@Char1Glob = common global i8 0, align 1, !dbg !38
+@Char2Glob = common global i8 0, align 1, !dbg !39
+@Array1Glob = common global [51 x i32] zeroinitializer, align 16, !dbg !40
+@Array2Glob = common global [51 x [51 x i32]] zeroinitializer, align 16, !dbg !42
+@PtrGlb = common global %struct.Record* null, align 8, !dbg !46
+@PtrGlbNext = common global %struct.Record* null, align 8, !dbg !63
 
 define void @Proc8(i32* nocapture %Array1Par, [51 x i32]* nocapture %Array2Par, i32 %IntParI1, i32 %IntParI2) nounwind optsize !dbg !12 {
 entry:
@@ -132,23 +132,23 @@
 !27 = !DILocalVariable(name: "IntLoc", line: 186, scope: !12, file: !3, type: !21)
 !28 = !DILocalVariable(name: "IntIndex", line: 187, scope: !12, file: !3, type: !21)
 !29 = !{!30, !35, !36, !38, !39, !40, !42, !46, !63}
-!30 = !DIGlobalVariable(name: "Version", line: 111, isLocal: false, isDefinition: true, scope: null, file: !3, type: !31, variable: [4 x i8]* @Version)
+!30 = !DIGlobalVariable(name: "Version", line: 111, isLocal: false, isDefinition: true, scope: null, file: !3, type: !31)
 !31 = !DICompositeType(tag: DW_TAG_array_type, size: 32, align: 8, baseType: !32, elements: !33)
 !32 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
 !33 = !{!34}
 !34 = !DISubrange(count: 4)
-!35 = !DIGlobalVariable(name: "IntGlob", line: 171, isLocal: false, isDefinition: true, scope: null, file: !3, type: !16, variable: i32* @IntGlob)
-!36 = !DIGlobalVariable(name: "BoolGlob", line: 172, isLocal: false, isDefinition: true, scope: null, file: !3, type: !37, variable: i32* @BoolGlob)
+!35 = !DIGlobalVariable(name: "IntGlob", line: 171, isLocal: false, isDefinition: true, scope: null, file: !3, type: !16)
+!36 = !DIGlobalVariable(name: "BoolGlob", line: 172, isLocal: false, isDefinition: true, scope: null, file: !3, type: !37)
 !37 = !DIDerivedType(tag: DW_TAG_typedef, name: "boolean", line: 149, file: !82, baseType: !16)
-!38 = !DIGlobalVariable(name: "Char1Glob", line: 173, isLocal: false, isDefinition: true, scope: null, file: !3, type: !32, variable: i8* @Char1Glob)
-!39 = !DIGlobalVariable(name: "Char2Glob", line: 174, isLocal: false, isDefinition: true, scope: null, file: !3, type: !32, variable: i8* @Char2Glob)
-!40 = !DIGlobalVariable(name: "Array1Glob", line: 175, isLocal: false, isDefinition: true, scope: null, file: !3, type: !41, variable: [51 x i32]* @Array1Glob)
+!38 = !DIGlobalVariable(name: "Char1Glob", line: 173, isLocal: false, isDefinition: true, scope: null, file: !3, type: !32)
+!39 = !DIGlobalVariable(name: "Char2Glob", line: 174, isLocal: false, isDefinition: true, scope: null, file: !3, type: !32)
+!40 = !DIGlobalVariable(name: "Array1Glob", line: 175, isLocal: false, isDefinition: true, scope: null, file: !3, type: !41)
 !41 = !DIDerivedType(tag: DW_TAG_typedef, name: "Array1Dim", line: 135, file: !82, baseType: !18)
-!42 = !DIGlobalVariable(name: "Array2Glob", line: 176, isLocal: false, isDefinition: true, scope: null, file: !3, type: !43, variable: [51 x [51 x i32]]* @Array2Glob)
+!42 = !DIGlobalVariable(name: "Array2Glob", line: 176, isLocal: false, isDefinition: true, scope: null, file: !3, type: !43)
 !43 = !DIDerivedType(tag: DW_TAG_typedef, name: "Array2Dim", line: 136, file: !82, baseType: !44)
 !44 = !DICompositeType(tag: DW_TAG_array_type, size: 83232, align: 32, baseType: !16, elements: !45)
 !45 = !{!20, !20}
-!46 = !DIGlobalVariable(name: "PtrGlb", line: 177, isLocal: false, isDefinition: true, scope: null, file: !3, type: !47, variable: %struct.Record** @PtrGlb)
+!46 = !DIGlobalVariable(name: "PtrGlb", line: 177, isLocal: false, isDefinition: true, scope: null, file: !3, type: !47)
 !47 = !DIDerivedType(tag: DW_TAG_typedef, name: "RecordPtr", line: 148, file: !82, baseType: !48)
 !48 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !49)
 !49 = !DIDerivedType(tag: DW_TAG_typedef, name: "RecordType", line: 147, file: !82, baseType: !50)
@@ -165,7 +165,7 @@
 !60 = !DICompositeType(tag: DW_TAG_array_type, size: 248, align: 8, baseType: !32, elements: !61)
 !61 = !{!62}
 !62 = !DISubrange(count: 31)
-!63 = !DIGlobalVariable(name: "PtrGlbNext", line: 178, isLocal: false, isDefinition: true, scope: null, file: !3, type: !47, variable: %struct.Record** @PtrGlbNext)
+!63 = !DIGlobalVariable(name: "PtrGlbNext", line: 178, isLocal: false, isDefinition: true, scope: null, file: !3, type: !47)
 !64 = !DILocation(line: 181, scope: !12)
 !65 = !DILocation(line: 182, scope: !12)
 !66 = !DILocation(line: 183, scope: !12)
diff --git a/llvm/test/DebugInfo/X86/multiple-aranges.ll b/llvm/test/DebugInfo/X86/multiple-aranges.ll
index b07d718..77e1eee 100644
--- a/llvm/test/DebugInfo/X86/multiple-aranges.ll
+++ b/llvm/test/DebugInfo/X86/multiple-aranges.ll
@@ -38,8 +38,8 @@
 ; ModuleID = 'test.bc'
 target triple = "x86_64-unknown-linux-gnu"
 
-@kittens = global i32 4, align 4
-@rainbows = global i32 5, align 4
+@kittens = global i32 4, align 4, !dbg !4
+@rainbows = global i32 5, align 4, !dbg !10
 
 !llvm.dbg.cu = !{!0, !7}
 !llvm.module.flags = !{!12, !13}
@@ -48,13 +48,13 @@
 !1 = !DIFile(filename: "test1.c", directory: "/home/kayamon")
 !2 = !{}
 !3 = !{!4}
-!4 = !DIGlobalVariable(name: "kittens", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6, variable: i32* @kittens)
+!4 = !DIGlobalVariable(name: "kittens", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !6)
 !5 = !DIFile(filename: "test1.c", directory: "/home/kayamon")
 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !7 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !8, enums: !2, retainedTypes: !2, globals: !9, imports: !2)
 !8 = !DIFile(filename: "test2.c", directory: "/home/kayamon")
 !9 = !{!10}
-!10 = !DIGlobalVariable(name: "rainbows", line: 1, isLocal: false, isDefinition: true, scope: null, file: !11, type: !6, variable: i32* @rainbows)
+!10 = !DIGlobalVariable(name: "rainbows", line: 1, isLocal: false, isDefinition: true, scope: null, file: !11, type: !6)
 !11 = !DIFile(filename: "test2.c", directory: "/home/kayamon")
 !12 = !{i32 2, !"Dwarf Version", i32 4}
 !13 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/llvm/test/DebugInfo/X86/multiple-at-const-val.ll b/llvm/test/DebugInfo/X86/multiple-at-const-val.ll
index 052d905..fcfd48f 100644
--- a/llvm/test/DebugInfo/X86/multiple-at-const-val.ll
+++ b/llvm/test/DebugInfo/X86/multiple-at-const-val.ll
@@ -56,7 +56,7 @@
 !960 = distinct !DISubprogram(name: "main", line: 73, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 73, file: !1802, scope: null, type: !54, variables: !955)
 !961 = !DIFile(filename: "student2.cpp", directory: "/privite/tmp")
 !1786 = !{!1800}
-!1800 = !DIGlobalVariable(name: "badbit", linkageName: "badbit", line: 331, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !78, variable: i32 1, declaration: !77)
+!1800 = !DIGlobalVariable(name: "badbit", linkageName: "badbit", line: 331, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !78, expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value), declaration: !77)
 !1801 = !DIFile(filename: "os_base.h", directory: "/privite/tmp")
 !1802 = !DIFile(filename: "student2.cpp", directory: "/privite/tmp")
 !1803 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll b/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll
index ee5f2d9..9f1b2502 100644
--- a/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll
+++ b/llvm/test/DebugInfo/X86/nondefault-subrange-array.ll
@@ -3,7 +3,7 @@
 
 %class.A = type { [42 x i32] }
 
-@a = global %class.A zeroinitializer, align 4
+@a = global %class.A zeroinitializer, align 4, !dbg !5
 
 ; Check that we can handle non-default array bounds. In this case, the array
 ; goes from [-3, 38].
@@ -33,7 +33,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a)
+!5 = !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}
diff --git a/llvm/test/DebugInfo/X86/objc-fwd-decl.ll b/llvm/test/DebugInfo/X86/objc-fwd-decl.ll
index af12e16..9a6895a 100644
--- a/llvm/test/DebugInfo/X86/objc-fwd-decl.ll
+++ b/llvm/test/DebugInfo/X86/objc-fwd-decl.ll
@@ -7,7 +7,7 @@
 
 %0 = type opaque
 
-@a = common global %0* null, align 8
+@a = common global %0* null, align 8, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!9, !10, !11, !12, !14}
@@ -15,7 +15,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.1 (trunk 152054 trunk 152094)", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !13, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %0** @a)
+!5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
 !6 = !DIFile(filename: "foo.m", directory: "/Users/echristo")
 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
 !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "FooBarBaz", line: 1, flags: DIFlagFwdDecl, runtimeLang: DW_LANG_ObjC, file: !13)
diff --git a/llvm/test/DebugInfo/X86/pointer-type-size.ll b/llvm/test/DebugInfo/X86/pointer-type-size.ll
index e26ea2e..6de3596 100644
--- a/llvm/test/DebugInfo/X86/pointer-type-size.ll
+++ b/llvm/test/DebugInfo/X86/pointer-type-size.ll
@@ -6,7 +6,7 @@
 
 %struct.crass = type { i8* }
 
-@crass = common global %struct.crass zeroinitializer, align 8
+@crass = common global %struct.crass zeroinitializer, align 8, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!14}
@@ -14,7 +14,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 147882)", isOptimized: false, emissionKind: FullDebug, file: !13, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "crass", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.crass* @crass)
+!5 = !DIGlobalVariable(name: "crass", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
 !6 = !DIFile(filename: "foo.c", directory: "/Users/echristo/tmp")
 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "crass", line: 1, size: 64, align: 64, file: !13, elements: !8)
 !8 = !{!9}
diff --git a/llvm/test/DebugInfo/X86/pr12831.ll b/llvm/test/DebugInfo/X86/pr12831.ll
index 99decb6..2b0400d 100644
--- a/llvm/test/DebugInfo/X86/pr12831.ll
+++ b/llvm/test/DebugInfo/X86/pr12831.ll
@@ -174,7 +174,7 @@
 !126 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !6, scope: null, type: !23, templateParams: !47, declaration: !22, variables: !1)
 !127 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !117, templateParams: !120, declaration: !116, variables: !1)
 !128 = !{!130}
-!130 = !DIGlobalVariable(name: "__stored_locally", linkageName: "__stored_locally", line: 2, isLocal: true, isDefinition: true, scope: !114, file: !6, type: !131, variable: i1 1)
+!130 = !DIGlobalVariable(name: "__stored_locally", linkageName: "__stored_locally", line: 2, isLocal: true, isDefinition: true, scope: !114, file: !6, type: !131, expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
 !131 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !132)
 !132 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
 !133 = !DILocalVariable(name: "this", line: 19, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !134)
diff --git a/llvm/test/DebugInfo/X86/ref_addr_relocation.ll b/llvm/test/DebugInfo/X86/ref_addr_relocation.ll
index c6bf3ce..167a154 100644
--- a/llvm/test/DebugInfo/X86/ref_addr_relocation.ll
+++ b/llvm/test/DebugInfo/X86/ref_addr_relocation.ll
@@ -52,8 +52,8 @@
 
 %struct.foo = type { i8 }
 
-@f = global %struct.foo zeroinitializer, align 1
-@g = global %struct.foo zeroinitializer, align 1
+@f = global %struct.foo zeroinitializer, align 1, !dbg !7
+@g = global %struct.foo zeroinitializer, align 1, !dbg !12
 
 !llvm.dbg.cu = !{!0, !9}
 !llvm.module.flags = !{!14, !15}
@@ -65,12 +65,12 @@
 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 8, align: 8, file: !5, elements: !2, identifier: "_ZTS3foo")
 !5 = !DIFile(filename: "./hdr.h", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")
 !6 = !{!7}
-!7 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !8, type: !4, variable: %struct.foo* @f)
+!7 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !8, type: !4)
 !8 = !DIFile(filename: "tu1.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")
 !9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !2, retainedTypes: !3, globals: !11, imports: !2)
 !10 = !DIFile(filename: "tu2.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")
 !11 = !{!12}
-!12 = !DIGlobalVariable(name: "g", line: 2, isLocal: false, isDefinition: true, scope: null, file: !13, type: !4, variable: %struct.foo* @g)
+!12 = !DIGlobalVariable(name: "g", line: 2, isLocal: false, isDefinition: true, scope: null, file: !13, type: !4)
 !13 = !DIFile(filename: "tu2.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")
 !14 = !{i32 2, !"Dwarf Version", i32 2}
 !15 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/llvm/test/DebugInfo/X86/stack-value-dwarf4.ll b/llvm/test/DebugInfo/X86/stack-value-dwarf4.ll
new file mode 100644
index 0000000..ad2aeb2
--- /dev/null
+++ b/llvm/test/DebugInfo/X86/stack-value-dwarf4.ll
@@ -0,0 +1,37 @@
+; RUN: llc -o - %s | FileCheck --check-prefix=CHECK-DWARF2 %s
+; RUN: llc -dwarf-version=4 -o - %s | FileCheck --check-prefix=CHECK-DWARF4 %s
+
+target datalayout = "e-p:64:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+; CHECK-DWARF2:      .byte	13                      # DW_AT_location
+; CHECK-DWARF2-NEXT: .byte	3
+; CHECK-DWARF2-NEXT: .quad	g
+; CHECK-DWARF2-NEXT: .byte	16
+; CHECK-DWARF2-NEXT: .byte	4
+; CHECK-DWARF2-NEXT: .byte	16
+; CHECK-DWARF2-NEXT: .byte	4
+
+; CHECK-DWARF4:      .byte	14                      # DW_AT_location
+; CHECK-DWARF4-NEXT: .byte	3
+; CHECK-DWARF4-NEXT: .quad	g
+; CHECK-DWARF4-NEXT: .byte	16
+; CHECK-DWARF4-NEXT: .byte	4
+; CHECK-DWARF4-NEXT: .byte	16
+; CHECK-DWARF4-NEXT: .byte	4
+; CHECK-DWARF4-NEXT: .byte	159
+
+@g = global i32 0, !dbg !2
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", file: !4, globals: !1, emissionKind: FullDebug)
+!1 = !{!2}
+!2 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, expr: !3, type: !5)
+!3 = !DIExpression(DW_OP_constu, 4, DW_OP_constu, 4, DW_OP_stack_value)
+!4 = !DIFile(filename: "<stdin>", directory: "/")
+!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+
+!6 = !{i32 2, !"Dwarf Version", i32 2}
+!7 = !{i32 2, !"Debug Info Version", i32 3}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!6, !7}
diff --git a/llvm/test/DebugInfo/X86/stringpool.ll b/llvm/test/DebugInfo/X86/stringpool.ll
index 970871c..87d1c61 100644
--- a/llvm/test/DebugInfo/X86/stringpool.ll
+++ b/llvm/test/DebugInfo/X86/stringpool.ll
@@ -1,7 +1,7 @@
 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=LINUX
 ; RUN: llc -mtriple=x86_64-darwin < %s | FileCheck %s --check-prefix=DARWIN
 
-@yyyy = common global i32 0, align 4
+@yyyy = common global i32 0, align 4, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!9}
@@ -9,7 +9,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143009)", isOptimized: true, emissionKind: FullDebug, file: !8, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "yyyy", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @yyyy)
+!5 = !DIGlobalVariable(name: "yyyy", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
 !6 = !DIFile(filename: "z.c", directory: "/home/nicholas")
 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !8 = !DIFile(filename: "z.c", directory: "/home/nicholas")
diff --git a/llvm/test/DebugInfo/X86/struct-loc.ll b/llvm/test/DebugInfo/X86/struct-loc.ll
index b5da533..b3acab0 100644
--- a/llvm/test/DebugInfo/X86/struct-loc.ll
+++ b/llvm/test/DebugInfo/X86/struct-loc.ll
@@ -9,7 +9,7 @@
 
 %struct.foo = type { i32 }
 
-@f = common global %struct.foo zeroinitializer, align 4
+@f = common global %struct.foo zeroinitializer, align 4, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!12}
@@ -17,7 +17,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, emissionKind: FullDebug, file: !11, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "f", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.foo* @f)
+!5 = !DIGlobalVariable(name: "f", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
 !6 = !DIFile(filename: "struct_bug.c", directory: "/Users/echristo/tmp")
 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 32, align: 32, file: !11, elements: !8)
 !8 = !{!9}
diff --git a/llvm/test/DebugInfo/X86/template.ll b/llvm/test/DebugInfo/X86/template.ll
index 337f238..d17874d 100644
--- a/llvm/test/DebugInfo/X86/template.ll
+++ b/llvm/test/DebugInfo/X86/template.ll
@@ -60,8 +60,8 @@
 
 %"struct.y_impl<int>::nested" = type { i8 }
 
-@glbl = global i32 0, align 4
-@n = global %"struct.y_impl<int>::nested" zeroinitializer, align 1
+@glbl = global i32 0, align 4, !dbg !31
+@n = global %"struct.y_impl<int>::nested" zeroinitializer, align 1, !dbg !32
 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_template.cpp, i8* null }]
 
 define internal void @__cxx_global_var_init() section ".text.startup" !dbg !10 {
@@ -119,8 +119,8 @@
 !28 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_template.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, unit: !0, file: !1, scope: !11, type: !29, variables: !2)
 !29 = !DISubroutineType(types: !2)
 !30 = !{!31, !32}
-!31 = !DIGlobalVariable(name: "glbl", line: 3, isLocal: false, isDefinition: true, scope: null, file: !11, type: !7, variable: i32* @glbl)
-!32 = !DIGlobalVariable(name: "n", line: 4, isLocal: false, isDefinition: true, scope: null, file: !11, type: !8, variable: %"struct.y_impl<int>::nested"* @n)
+!31 = !DIGlobalVariable(name: "glbl", line: 3, isLocal: false, isDefinition: true, scope: null, file: !11, type: !7)
+!32 = !DIGlobalVariable(name: "n", line: 4, isLocal: false, isDefinition: true, scope: null, file: !11, type: !8)
 !33 = !{i32 2, !"Dwarf Version", i32 4}
 !34 = !{i32 2, !"Debug Info Version", i32 3}
 !35 = !{!"clang version 3.6.0 (trunk 224394) (llvm/trunk 224384)"}
diff --git a/llvm/test/DebugInfo/X86/tls.ll b/llvm/test/DebugInfo/X86/tls.ll
index 5533c45..40c356b 100644
--- a/llvm/test/DebugInfo/X86/tls.ll
+++ b/llvm/test/DebugInfo/X86/tls.ll
@@ -96,8 +96,8 @@
 ; template int func<&glbl>(); // create a second reference to 'glbl'
 
 
-@tls = thread_local global i32 0, align 4
-@glbl = global i32 0, align 4
+@tls = thread_local global i32 0, align 4, !dbg !13
+@glbl = global i32 0, align 4, !dbg !14
 
 ; Function Attrs: nounwind uwtable
 define weak_odr i32 @_Z4funcIXadL_Z4glblEEEiv() #0 !dbg !4 {
@@ -123,8 +123,8 @@
 !10 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "I", type: !11, value: i32* @glbl)
 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
 !12 = !{!13, !14}
-!13 = !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @tls)
-!14 = !DIGlobalVariable(name: "glbl", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8, variable: i32* @glbl)
+!13 = !DIGlobalVariable(name: "tls", line: 1, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8)
+!14 = !DIGlobalVariable(name: "glbl", line: 2, isLocal: false, isDefinition: true, scope: null, file: !5, type: !8)
 !15 = !{i32 2, !"Dwarf Version", i32 4}
 !16 = !{i32 1, !"Debug Info Version", i32 3}
 !17 = !{!"clang version 3.5 "}
diff --git a/llvm/test/DebugInfo/X86/type_units_with_addresses.ll b/llvm/test/DebugInfo/X86/type_units_with_addresses.ll
index f75e32a..e145626 100644
--- a/llvm/test/DebugInfo/X86/type_units_with_addresses.ll
+++ b/llvm/test/DebugInfo/X86/type_units_with_addresses.ll
@@ -102,11 +102,11 @@
 %struct.S4_1 = type { i8 }
 %struct.S4_2 = type { i8 }
 
-@i = global i32 0, align 4
-@a = global %struct.S1 zeroinitializer, align 1
-@s2 = global %struct.S2 zeroinitializer, align 1
-@s3 = global %struct.S3 zeroinitializer, align 1
-@s4 = global %struct.S4 zeroinitializer, align 1
+@i = global i32 0, align 4, !dbg !28
+@a = global %struct.S1 zeroinitializer, align 1, !dbg !30
+@s2 = global %struct.S2 zeroinitializer, align 1, !dbg !31
+@s3 = global %struct.S3 zeroinitializer, align 1, !dbg !32
+@s4 = global %struct.S4 zeroinitializer, align 1, !dbg !33
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!34, !35}
@@ -140,12 +140,12 @@
 !25 = !{!26}
 !26 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "T", type: !7, value: i32* @i)
 !27 = !{!28, !30, !31, !32, !33}
-!28 = !DIGlobalVariable(name: "i", line: 1, isLocal: false, isDefinition: true, scope: null, file: !29, type: !8, variable: i32* @i)
+!28 = !DIGlobalVariable(name: "i", line: 1, isLocal: false, isDefinition: true, scope: null, file: !29, type: !8)
 !29 = !DIFile(filename: "tu.cpp", directory: "/tmp/dbginfo")
-!30 = !DIGlobalVariable(name: "a", line: 6, isLocal: false, isDefinition: true, scope: null, file: !29, type: !4, variable: %struct.S1* @a)
-!31 = !DIGlobalVariable(name: "s2", line: 15, isLocal: false, isDefinition: true, scope: null, file: !29, type: !9, variable: %struct.S2* @s2)
-!32 = !DIGlobalVariable(name: "s3", line: 27, isLocal: false, isDefinition: true, scope: null, file: !29, type: !13, variable: %struct.S3* @s3)
-!33 = !DIGlobalVariable(name: "s4", line: 39, isLocal: false, isDefinition: true, scope: null, file: !29, type: !19, variable: %struct.S4* @s4)
+!30 = !DIGlobalVariable(name: "a", line: 6, isLocal: false, isDefinition: true, scope: null, file: !29, type: !4)
+!31 = !DIGlobalVariable(name: "s2", line: 15, isLocal: false, isDefinition: true, scope: null, file: !29, type: !9)
+!32 = !DIGlobalVariable(name: "s3", line: 27, isLocal: false, isDefinition: true, scope: null, file: !29, type: !13)
+!33 = !DIGlobalVariable(name: "s4", line: 39, isLocal: false, isDefinition: true, scope: null, file: !29, type: !19)
 !34 = !{i32 2, !"Dwarf Version", i32 4}
 !35 = !{i32 1, !"Debug Info Version", i32 3}
 !36 = !{!"clang version 3.5.0 "}
diff --git a/llvm/test/DebugInfo/X86/unattached-global.ll b/llvm/test/DebugInfo/X86/unattached-global.ll
new file mode 100644
index 0000000..d271e4e
--- /dev/null
+++ b/llvm/test/DebugInfo/X86/unattached-global.ll
@@ -0,0 +1,19 @@
+; RUN: llc -o - %s | FileCheck %s
+
+target datalayout = "e-p:64:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+; CHECK: .byte    0                       # DW_AT_location
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", file: !4, globals: !1, emissionKind: FullDebug)
+!1 = !{!2}
+!2 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, expr: !3, type: !5)
+!3 = !DIExpression(DW_OP_plus, 4)
+!4 = !DIFile(filename: "<stdin>", directory: "/")
+!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+
+!6 = !{i32 2, !"Dwarf Version", i32 2}
+!7 = !{i32 2, !"Debug Info Version", i32 3}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!6, !7}
diff --git a/llvm/test/DebugInfo/X86/union-template.ll b/llvm/test/DebugInfo/X86/union-template.ll
index 58d44c7..437d616 100644
--- a/llvm/test/DebugInfo/X86/union-template.ll
+++ b/llvm/test/DebugInfo/X86/union-template.ll
@@ -9,7 +9,7 @@
 
 %"union.PR15637::Value" = type { i32 }
 
-@_ZN7PR156371fE = global %"union.PR15637::Value" zeroinitializer, align 4
+@_ZN7PR156371fE = global %"union.PR15637::Value" zeroinitializer, align 4, !dbg !10
 
 define void @_ZN7PR156371gEf(float %value) #0 !dbg !4 {
 entry:
@@ -38,7 +38,7 @@
 !7 = !{null, !8}
 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
 !9 = !{!10}
-!10 = !DIGlobalVariable(name: "f", linkageName: "_ZN7PR156371fE", line: 6, isLocal: false, isDefinition: true, scope: !5, file: !11, type: !12, variable: %"union.PR15637::Value"* @_ZN7PR156371fE)
+!10 = !DIGlobalVariable(name: "f", linkageName: "_ZN7PR156371fE", line: 6, isLocal: false, isDefinition: true, scope: !5, file: !11, type: !12)
 !11 = !DIFile(filename: "foo.cc", directory: "/usr/local/google/home/echristo/tmp")
 !12 = !DICompositeType(tag: DW_TAG_union_type, name: "Value<float>", line: 2, size: 32, align: 32, file: !1, scope: !5, elements: !13, templateParams: !21)
 !13 = !{!14, !16}
diff --git a/llvm/test/DebugInfo/X86/vector.ll b/llvm/test/DebugInfo/X86/vector.ll
index 7d6abd7..3bd5e6f 100644
--- a/llvm/test/DebugInfo/X86/vector.ll
+++ b/llvm/test/DebugInfo/X86/vector.ll
@@ -7,7 +7,7 @@
 ;
 ; v4si a
 
-@a = common global <4 x i32> zeroinitializer, align 16
+@a = common global <4 x i32> zeroinitializer, align 16, !dbg !5
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!13}
@@ -15,7 +15,7 @@
 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171825) (llvm/trunk 171822)", isOptimized: false, emissionKind: FullDebug, file: !12, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
 !1 = !{}
 !3 = !{!5}
-!5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: <4 x i32>* @a)
+!5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7)
 !6 = !DIFile(filename: "foo.c", directory: "/Users/echristo")
 !7 = !DIDerivedType(tag: DW_TAG_typedef, name: "v4si", line: 1, file: !12, baseType: !8)
 !8 = !DICompositeType(tag: DW_TAG_array_type, size: 128, align: 128, flags: DIFlagVector, baseType: !9, elements: !10)