From ce13935776a67c6bf7fffc3a0db76d27bfbd050a Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 16 Dec 2016 00:36:43 +0000 Subject: [IR] Remove the DIExpression field from DIGlobalVariable. This patch implements PR31013 by introducing a DIGlobalVariableExpression that holds a pair of DIGlobalVariable and DIExpression. Currently, DIGlobalVariables holds a DIExpression. This is not the best way to model this: (1) The DIGlobalVariable should describe the source level variable, not how to get to its location. (2) It makes it unsafe/hard to update the expressions when we call replaceExpression on the DIGLobalVariable. (3) It makes it impossible to represent a global variable that is in more than one location (e.g., a variable with multiple DW_OP_LLVM_fragment-s). We also moved away from attaching the DIExpression to DILocalVariable for the same reasons. https://llvm.org/bugs/show_bug.cgi?id=31013 Differential Revision: https://reviews.llvm.org/D26769 llvm-svn: 289902 --- llvm/test/DebugInfo/Generic/enum.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/test/DebugInfo/Generic/enum.ll') diff --git a/llvm/test/DebugInfo/Generic/enum.ll b/llvm/test/DebugInfo/Generic/enum.ll index b2154241126..ef00b2f84e0 100644 --- a/llvm/test/DebugInfo/Generic/enum.ll +++ b/llvm/test/DebugInfo/Generic/enum.ll @@ -70,7 +70,7 @@ attributes #1 = { nounwind readnone } !15 = !DISubroutineType(types: !16) !16 = !{null} !17 = !{!18} -!18 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !3) +!18 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !3)) !19 = !{i32 2, !"Dwarf Version", i32 3} !20 = !DILocalVariable(name: "b", line: 4, scope: !13, file: !14, type: !21) !21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -- cgit v1.2.3