From d536428cc7deb627b95d28607fc591732b037b02 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 22 Jan 2019 16:40:18 +0000 Subject: [PATCH] Add DIGlobalVariableExpression to LangRef git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351837 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.rst | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/LangRef.rst b/docs/LangRef.rst index 9168648db6e..044d21c991e 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -4511,13 +4511,36 @@ DIGlobalVariable .. code-block:: text - !0 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !1, - file: !2, line: 7, type: !3, isLocal: true, - isDefinition: false, variable: i32* @foo, - declaration: !4) + @foo = global i32, !dbg !0 + !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) + !1 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !2, + file: !3, line: 7, type: !4, isLocal: true, + isDefinition: false, declaration: !5) -All global variables should be referenced by the `globals:` field of a -:ref:`compile unit `. + +DIGlobalVariableExpression +"""""""""""""""""""""""""" + +``DIGlobalVariableExpression`` nodes tie a :ref:`DIGlobalVariable` together +with a :ref:`DIExpression`. + +.. code-block:: text + + @lower = global i32, !dbg !0 + @upper = global i32, !dbg !1 + !0 = !DIGlobalVariableExpression( + var: !2, + expr: !DIExpression(DW_OP_LLVM_fragment, 0, 32) + ) + !1 = !DIGlobalVariableExpression( + var: !2, + expr: !DIExpression(DW_OP_LLVM_fragment, 32, 32) + ) + !2 = !DIGlobalVariable(name: "split64", linkageName: "split64", scope: !3, + file: !4, line: 8, type: !5, declaration: !6) + +All global variable expressions should be referenced by the `globals:` field of +a :ref:`compile unit `. .. _DISubprogram: -- 2.50.1