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/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}