[llvm] r311004 - [DI] Every DIGlobalVariable should have a type.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 06:39:07 PDT 2017


Author: davide
Date: Wed Aug 16 06:39:07 2017
New Revision: 311004

URL: http://llvm.org/viewvc/llvm-project?rev=311004&view=rev
Log:
[DI] Every DIGlobalVariable should have a type.

I'll make this a verifier check to catch other violations. This
commit fixes the tests already in tree.

Modified:
    llvm/trunk/test/Assembler/diglobalvariable.ll
    llvm/trunk/test/Linker/odr.ll
    llvm/trunk/test/Transforms/GlobalMerge/debug-info.ll

Modified: llvm/trunk/test/Assembler/diglobalvariable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/diglobalvariable.ll?rev=311004&r1=311003&r2=311004&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/diglobalvariable.ll (original)
+++ llvm/trunk/test/Assembler/diglobalvariable.ll Wed Aug 16 06:39:07 2017
@@ -20,5 +20,6 @@
 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "Class", size: 8, align: 8)
 !7 = !DIDerivedType(tag: DW_TAG_member, name: "mem", flags: DIFlagStaticMember, scope: !6, baseType: !3)
 
-; CHECK: !8 = !DIGlobalVariable(name: "mem", scope: !0, isLocal: false, isDefinition: true, declaration: !7)
-!8 = !DIGlobalVariable(name: "mem", scope: !0, declaration: !7)
+; CHECK: !8 = !DIGlobalVariable(name: "mem", scope: !0, type: !9, isLocal: false, isDefinition: true, declaration: !7)
+!8 = !DIGlobalVariable(name: "mem", scope: !0, declaration: !7, type: !9)
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)

Modified: llvm/trunk/test/Linker/odr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/odr.ll?rev=311004&r1=311003&r2=311004&view=diff
==============================================================================
--- llvm/trunk/test/Linker/odr.ll (original)
+++ llvm/trunk/test/Linker/odr.ll Wed Aug 16 06:39:07 2017
@@ -11,7 +11,7 @@ source_filename = "test/Linker/odr.ll"
 !llvm.module.flags = !{!8}
 
 !0 = !DIGlobalVariableExpression(var: !1)
-!1 = !DIGlobalVariable(name: "c", scope: null, isLocal: false, isDefinition: true)
+!1 = !DIGlobalVariable(name: "c", scope: null, isLocal: false, isDefinition: true, type: !9)
 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, retainedTypes: !4, globals: !7)
 !3 = !DIFile(filename: "a", directory: "")
 !4 = !{!5}
@@ -19,4 +19,4 @@ source_filename = "test/Linker/odr.ll"
 !6 = distinct !DISubprogram(name: "b", scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !2)
 !7 = !{!0}
 !8 = !{i32 2, !"Debug Info Version", i32 3}
-
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)

Modified: llvm/trunk/test/Transforms/GlobalMerge/debug-info.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalMerge/debug-info.ll?rev=311004&r1=311003&r2=311004&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/GlobalMerge/debug-info.ll (original)
+++ llvm/trunk/test/Transforms/GlobalMerge/debug-info.ll Wed Aug 16 06:39:07 2017
@@ -14,17 +14,17 @@ define void @use1() {
   ret void
 }
 ; CHECK: [[A]] = !DIGlobalVariableExpression(var: [[AVAR:![0-9]+]])
-; CHECK: [[AVAR]] = !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true)
+; CHECK: [[AVAR]] = !DIGlobalVariable(name: "a", scope: null, type: !2, isLocal: false, isDefinition: true)
 ; CHECK: [[B]] = !DIGlobalVariableExpression(var: [[BVAR:![0-9]+]], expr: [[EXPR:![0-9]+]])
-; CHECK: [[BVAR]] = !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true)
+; CHECK: [[BVAR]] = !DIGlobalVariable(name: "b", scope: null, type: !2, isLocal: false, isDefinition: true)
 ; CHECK: [[EXPR]] = !DIExpression(DW_OP_plus_uconst, 4)
 
 !llvm.module.flags = !{!4, !5}
 
 !0 = !DIGlobalVariableExpression(var: !1)
-!1 = !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true)
+!1 = !DIGlobalVariable(name: "a", scope: null, type: !6, isLocal: false, isDefinition: true)
 !2 = !DIGlobalVariableExpression(var: !3)
-!3 = !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true)
+!3 = !DIGlobalVariable(name: "b", scope: null, type: !6, isLocal: false, isDefinition: true)
 !4 = !{i32 2, !"Debug Info Version", i32 3}
 !5 = !{i32 2, !"Dwarf Version", i32 4}
-
+!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)




More information about the llvm-commits mailing list