Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit d536428

Browse files
committed
Add DIGlobalVariableExpression to LangRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351837 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f26bb9e commit d536428

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

docs/LangRef.rst

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,13 +4511,36 @@ DIGlobalVariable
45114511

45124512
.. code-block:: text
45134513

4514-
!0 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !1,
4515-
file: !2, line: 7, type: !3, isLocal: true,
4516-
isDefinition: false, variable: i32* @foo,
4517-
declaration: !4)
4514+
@foo = global i32, !dbg !0
4515+
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
4516+
!1 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !2,
4517+
file: !3, line: 7, type: !4, isLocal: true,
4518+
isDefinition: false, declaration: !5)
45184519

4519-
All global variables should be referenced by the `globals:` field of a
4520-
:ref:`compile unit <DICompileUnit>`.
4520+
4521+
DIGlobalVariableExpression
4522+
""""""""""""""""""""""""""
4523+
4524+
``DIGlobalVariableExpression`` nodes tie a :ref:`DIGlobalVariable` together
4525+
with a :ref:`DIExpression`.
4526+
4527+
.. code-block:: text
4528+
4529+
@lower = global i32, !dbg !0
4530+
@upper = global i32, !dbg !1
4531+
!0 = !DIGlobalVariableExpression(
4532+
var: !2,
4533+
expr: !DIExpression(DW_OP_LLVM_fragment, 0, 32)
4534+
)
4535+
!1 = !DIGlobalVariableExpression(
4536+
var: !2,
4537+
expr: !DIExpression(DW_OP_LLVM_fragment, 32, 32)
4538+
)
4539+
!2 = !DIGlobalVariable(name: "split64", linkageName: "split64", scope: !3,
4540+
file: !4, line: 8, type: !5, declaration: !6)
4541+
4542+
All global variable expressions should be referenced by the `globals:` field of
4543+
a :ref:`compile unit <DICompileUnit>`.
45214544

45224545
.. _DISubprogram:
45234546

0 commit comments

Comments
 (0)