summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/CommandGuide/FileCheck.rst4
-rw-r--r--llvm/docs/LangRef.rst212
-rw-r--r--llvm/docs/SourceLevelDebugging.rst70
-rw-r--r--llvm/docs/tutorial/LangImpl8.rst34
4 files changed, 160 insertions, 160 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index f48bf474519..03c88297677 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -200,9 +200,9 @@ For example, the following works like you'd expect:
.. code-block:: llvm
- !0 = !MDLocation(line: 5, scope: !1, inlinedAt: !2)
+ !0 = !DILocation(line: 5, scope: !1, inlinedAt: !2)
- ; CHECK: !MDLocation(line: 5,
+ ; CHECK: !DILocation(line: 5,
; CHECK-NOT: column:
; CHECK-SAME: scope: ![[SCOPE:[0-9]+]]
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 767d97a6c81..b33266af7c1 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -2922,12 +2922,12 @@ order.
These aren't inherently debug info centric, but currently all the specialized
metadata nodes are related to debug info.
-.. _MDCompileUnit:
+.. _DICompileUnit:
-MDCompileUnit
+DICompileUnit
"""""""""""""
-``MDCompileUnit`` nodes represent a compile unit. The ``enums:``,
+``DICompileUnit`` nodes represent a compile unit. The ``enums:``,
``retainedTypes:``, ``subprograms:``, ``globals:`` and ``imports:`` fields are
tuples containing the debug info to be emitted along with the compile unit,
regardless of code optimizations (some nodes are only emitted if there are
@@ -2935,7 +2935,7 @@ references to them from instructions).
.. code-block:: llvm
- !0 = !MDCompileUnit(language: DW_LANG_C99, file: !1, producer: "clang",
+ !0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang",
isOptimized: true, flags: "-O2", runtimeVersion: 2,
splitDebugFilename: "abc.debug", emissionKind: 1,
enums: !2, retainedTypes: !3, subprograms: !4,
@@ -2947,33 +2947,33 @@ These descriptors are collected by a named metadata ``!llvm.dbg.cu``. They
keep track of subprograms, global variables, type information, and imported
entities (declarations and namespaces).
-.. _MDFile:
+.. _DIFile:
-MDFile
+DIFile
""""""
-``MDFile`` nodes represent files. The ``filename:`` can include slashes.
+``DIFile`` nodes represent files. The ``filename:`` can include slashes.
.. code-block:: llvm
- !0 = !MDFile(filename: "path/to/file", directory: "/path/to/dir")
+ !0 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
Files are sometimes used in ``scope:`` fields, and are the only valid target
for ``file:`` fields.
-.. _MDLocation:
+.. _DILocation:
-MDBasicType
+DIBasicType
"""""""""""
-``MDBasicType`` nodes represent primitive types, such as ``int``, ``bool`` and
+``DIBasicType`` nodes represent primitive types, such as ``int``, ``bool`` and
``float``. ``tag:`` defaults to ``DW_TAG_base_type``.
.. code-block:: llvm
- !0 = !MDBasicType(name: "unsigned char", size: 8, align: 8,
+ !0 = !DIBasicType(name: "unsigned char", size: 8, align: 8,
encoding: DW_ATE_unsigned_char)
- !1 = !MDBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
+ !1 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
The ``encoding:`` describes the details of the type. Usually it's one of the
following:
@@ -2988,12 +2988,12 @@ following:
DW_ATE_unsigned = 7
DW_ATE_unsigned_char = 8
-.. _MDSubroutineType:
+.. _DISubroutineType:
-MDSubroutineType
+DISubroutineType
""""""""""""""""
-``MDSubroutineType`` nodes represent subroutine types. Their ``types:`` field
+``DISubroutineType`` nodes represent subroutine types. Their ``types:`` field
refers to a tuple; the first operand is the return type, while the rest are the
types of the formal arguments in order. If the first operand is ``null``, that
represents a function with no return value (such as ``void foo() {}`` in C++).
@@ -3002,21 +3002,21 @@ represents a function with no return value (such as ``void foo() {}`` in C++).
!0 = !BasicType(name: "int", size: 32, align: 32, DW_ATE_signed)
!1 = !BasicType(name: "char", size: 8, align: 8, DW_ATE_signed_char)
- !2 = !MDSubroutineType(types: !{null, !0, !1}) ; void (int, char)
+ !2 = !DISubroutineType(types: !{null, !0, !1}) ; void (int, char)
-.. _MDDerivedType:
+.. _DIDerivedType:
-MDDerivedType
+DIDerivedType
"""""""""""""
-``MDDerivedType`` nodes represent types derived from other types, such as
+``DIDerivedType`` nodes represent types derived from other types, such as
qualified types.
.. code-block:: llvm
- !0 = !MDBasicType(name: "unsigned char", size: 8, align: 8,
+ !0 = !DIBasicType(name: "unsigned char", size: 8, align: 8,
encoding: DW_ATE_unsigned_char)
- !1 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 32,
+ !1 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 32,
align: 32)
The following ``tag:`` values are valid:
@@ -3034,7 +3034,7 @@ The following ``tag:`` values are valid:
DW_TAG_restrict_type = 55
``DW_TAG_member`` is used to define a member of a :ref:`composite type
-<MDCompositeType>` or :ref:`subprogram <MDSubprogram>`. The type of the member
+<DICompositeType>` or :ref:`subprogram <DISubprogram>`. The type of the member
is the ``baseType:``. The ``offset:`` is the member's bit offset.
``DW_TAG_formal_parameter`` is used to define a member which is a formal
argument of a subprogram.
@@ -3047,12 +3047,12 @@ argument of a subprogram.
Note that the ``void *`` type is expressed as a type derived from NULL.
-.. _MDCompositeType:
+.. _DICompositeType:
-MDCompositeType
+DICompositeType
"""""""""""""""
-``MDCompositeType`` nodes represent types composed of other types, like
+``DICompositeType`` nodes represent types composed of other types, like
structures and unions. ``elements:`` points to a tuple of the composed types.
If the source language supports ODR, the ``identifier:`` field gives the unique
@@ -3062,10 +3062,10 @@ can refer to composite types indirectly via a :ref:`metadata string
.. code-block:: llvm
- !0 = !MDEnumerator(name: "SixKind", value: 7)
- !1 = !MDEnumerator(name: "SevenKind", value: 7)
- !2 = !MDEnumerator(name: "NegEightKind", value: -8)
- !3 = !MDCompositeType(tag: DW_TAG_enumeration_type, name: "Enum", file: !12,
+ !0 = !DIEnumerator(name: "SixKind", value: 7)
+ !1 = !DIEnumerator(name: "SevenKind", value: 7)
+ !2 = !DIEnumerator(name: "NegEightKind", value: -8)
+ !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum", file: !12,
line: 2, size: 32, align: 32, identifier: "_M4Enum",
elements: !{!0, !1, !2})
@@ -3083,108 +3083,108 @@ The following ``tag:`` values are valid:
For ``DW_TAG_array_type``, the ``elements:`` should be :ref:`subrange
-descriptors <MDSubrange>`, each representing the range of subscripts at that
+descriptors <DISubrange>`, each representing the range of subscripts at that
level of indexing. The ``DIFlagVector`` flag to ``flags:`` indicates that an
array type is a native packed vector.
For ``DW_TAG_enumeration_type``, the ``elements:`` should be :ref:`enumerator
-descriptors <MDEnumerator>`, each representing the definition of an enumeration
+descriptors <DIEnumerator>`, each representing the definition of an enumeration
value for the set. All enumeration type descriptors are collected in the
-``enums:`` field of the :ref:`compile unit <MDCompileUnit>`.
+``enums:`` field of the :ref:`compile unit <DICompileUnit>`.
For ``DW_TAG_structure_type``, ``DW_TAG_class_type``, and
``DW_TAG_union_type``, the ``elements:`` should be :ref:`derived types
-<MDDerivedType>` with ``tag: DW_TAG_member`` or ``tag: DW_TAG_inheritance``.
+<DIDerivedType>` with ``tag: DW_TAG_member`` or ``tag: DW_TAG_inheritance``.
-.. _MDSubrange:
+.. _DISubrange:
-MDSubrange
+DISubrange
""""""""""
-``MDSubrange`` nodes are the elements for ``DW_TAG_array_type`` variants of
-:ref:`MDCompositeType`. ``count: -1`` indicates an empty array.
+``DISubrange`` nodes are the elements for ``DW_TAG_array_type`` variants of
+:ref:`DICompositeType`. ``count: -1`` indicates an empty array.
.. code-block:: llvm
- !0 = !MDSubrange(count: 5, lowerBound: 0) ; array counting from 0
- !1 = !MDSubrange(count: 5, lowerBound: 1) ; array counting from 1
- !2 = !MDSubrange(count: -1) ; empty array.
+ !0 = !DISubrange(count: 5, lowerBound: 0) ; array counting from 0
+ !1 = !DISubrange(count: 5, lowerBound: 1) ; array counting from 1
+ !2 = !DISubrange(count: -1) ; empty array.
-.. _MDEnumerator:
+.. _DIEnumerator:
-MDEnumerator
+DIEnumerator
""""""""""""
-``MDEnumerator`` nodes are the elements for ``DW_TAG_enumeration_type``
-variants of :ref:`MDCompositeType`.
+``DIEnumerator`` nodes are the elements for ``DW_TAG_enumeration_type``
+variants of :ref:`DICompositeType`.
.. code-block:: llvm
- !0 = !MDEnumerator(name: "SixKind", value: 7)
- !1 = !MDEnumerator(name: "SevenKind", value: 7)
- !2 = !MDEnumerator(name: "NegEightKind", value: -8)
+ !0 = !DIEnumerator(name: "SixKind", value: 7)
+ !1 = !DIEnumerator(name: "SevenKind", value: 7)
+ !2 = !DIEnumerator(name: "NegEightKind", value: -8)
-MDTemplateTypeParameter
+DITemplateTypeParameter
"""""""""""""""""""""""
-``MDTemplateTypeParameter`` nodes represent type parameters to generic source
-language constructs. They are used (optionally) in :ref:`MDCompositeType` and
-:ref:`MDSubprogram` ``templateParams:`` fields.
+``DITemplateTypeParameter`` nodes represent type parameters to generic source
+language constructs. They are used (optionally) in :ref:`DICompositeType` and
+:ref:`DISubprogram` ``templateParams:`` fields.
.. code-block:: llvm
- !0 = !MDTemplateTypeParameter(name: "Ty", type: !1)
+ !0 = !DITemplateTypeParameter(name: "Ty", type: !1)
-MDTemplateValueParameter
+DITemplateValueParameter
""""""""""""""""""""""""
-``MDTemplateValueParameter`` nodes represent value parameters to generic source
+``DITemplateValueParameter`` nodes represent value parameters to generic source
language constructs. ``tag:`` defaults to ``DW_TAG_template_value_parameter``,
but if specified can also be set to ``DW_TAG_GNU_template_template_param`` or
``DW_TAG_GNU_template_param_pack``. They are used (optionally) in
-:ref:`MDCompositeType` and :ref:`MDSubprogram` ``templateParams:`` fields.
+:ref:`DICompositeType` and :ref:`DISubprogram` ``templateParams:`` fields.
.. code-block:: llvm
- !0 = !MDTemplateValueParameter(name: "Ty", type: !1, value: i32 7)
+ !0 = !DITemplateValueParameter(name: "Ty", type: !1, value: i32 7)
-MDNamespace
+DINamespace
"""""""""""
-``MDNamespace`` nodes represent namespaces in the source language.
+``DINamespace`` nodes represent namespaces in the source language.
.. code-block:: llvm
- !0 = !MDNamespace(name: "myawesomeproject", scope: !1, file: !2, line: 7)
+ !0 = !DINamespace(name: "myawesomeproject", scope: !1, file: !2, line: 7)
-MDGlobalVariable
+DIGlobalVariable
""""""""""""""""
-``MDGlobalVariable`` nodes represent global variables in the source language.
+``DIGlobalVariable`` nodes represent global variables in the source language.
.. code-block:: llvm
- !0 = !MDGlobalVariable(name: "foo", linkageName: "foo", scope: !1,
+ !0 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !1,
file: !2, line: 7, type: !3, isLocal: true,
isDefinition: false, variable: i32* @foo,
declaration: !4)
All global variables should be referenced by the `globals:` field of a
-:ref:`compile unit <MDCompileUnit>`.
+:ref:`compile unit <DICompileUnit>`.
-.. _MDSubprogram:
+.. _DISubprogram:
-MDSubprogram
+DISubprogram
""""""""""""
-``MDSubprogram`` nodes represent functions from the source language. The
-``variables:`` field points at :ref:`variables <MDLocalVariable>` that must be
+``DISubprogram`` nodes represent functions from the source language. The
+``variables:`` field points at :ref:`variables <DILocalVariable>` that must be
retained, even if their IR counterparts are optimized out of the IR. The
-``type:`` field must point at an :ref:`MDSubroutineType`.
+``type:`` field must point at an :ref:`DISubroutineType`.
.. code-block:: llvm
- !0 = !MDSubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
+ !0 = !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
file: !2, line: 7, type: !3, isLocal: true,
isDefinition: false, scopeLine: 8, containingType: !4,
virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10,
@@ -3192,76 +3192,76 @@ retained, even if their IR counterparts are optimized out of the IR. The
function: void ()* @_Z3foov,
templateParams: !5, declaration: !6, variables: !7)
-.. _MDLexicalBlock:
+.. _DILexicalBlock:
-MDLexicalBlock
+DILexicalBlock
""""""""""""""
-``MDLexicalBlock`` nodes describe nested blocks within a :ref:`subprogram
-<MDSubprogram>`. The line number and column numbers are used to dinstinguish
+``DILexicalBlock`` nodes describe nested blocks within a :ref:`subprogram
+<DISubprogram>`. The line number and column numbers are used to dinstinguish
two lexical blocks at same depth. They are valid targets for ``scope:``
fields.
.. code-block:: llvm
- !0 = distinct !MDLexicalBlock(scope: !1, file: !2, line: 7, column: 35)
+ !0 = distinct !DILexicalBlock(scope: !1, file: !2, line: 7, column: 35)
Usually lexical blocks are ``distinct`` to prevent node merging based on
operands.
-.. _MDLexicalBlockFile:
+.. _DILexicalBlockFile:
-MDLexicalBlockFile
+DILexicalBlockFile
""""""""""""""""""
-``MDLexicalBlockFile`` nodes are used to discriminate between sections of a
-:ref:`lexical block <MDLexicalBlock>`. The ``file:`` field can be changed to
+``DILexicalBlockFile`` nodes are used to discriminate between sections of a
+:ref:`lexical block <DILexicalBlock>`. The ``file:`` field can be changed to
indicate textual inclusion, or the ``discriminator:`` field can be used to
discriminate between control flow within a single block in the source language.
.. code-block:: llvm
- !0 = !MDLexicalBlock(scope: !3, file: !4, line: 7, column: 35)
- !1 = !MDLexicalBlockFile(scope: !0, file: !4, discriminator: 0)
- !2 = !MDLexicalBlockFile(scope: !0, file: !4, discriminator: 1)
+ !0 = !DILexicalBlock(scope: !3, file: !4, line: 7, column: 35)
+ !1 = !DILexicalBlockFile(scope: !0, file: !4, discriminator: 0)
+ !2 = !DILexicalBlockFile(scope: !0, file: !4, discriminator: 1)
-MDLocation
+DILocation
""""""""""
-``MDLocation`` nodes represent source debug locations. The ``scope:`` field is
-mandatory, and points at an :ref:`MDLexicalBlockFile`, an
-:ref:`MDLexicalBlock`, or an :ref:`MDSubprogram`.
+``DILocation`` nodes represent source debug locations. The ``scope:`` field is
+mandatory, and points at an :ref:`DILexicalBlockFile`, an
+:ref:`DILexicalBlock`, or an :ref:`DISubprogram`.
.. code-block:: llvm
- !0 = !MDLocation(line: 2900, column: 42, scope: !1, inlinedAt: !2)
+ !0 = !DILocation(line: 2900, column: 42, scope: !1, inlinedAt: !2)
-.. _MDLocalVariable:
+.. _DILocalVariable:
-MDLocalVariable
+DILocalVariable
"""""""""""""""
-``MDLocalVariable`` nodes represent local variables in the source language.
+``DILocalVariable`` nodes represent local variables in the source language.
Instead of ``DW_TAG_variable``, they use LLVM-specific fake tags to
discriminate between local variables (``DW_TAG_auto_variable``) and subprogram
arguments (``DW_TAG_arg_variable``). In the latter case, the ``arg:`` field
specifies the argument position, and this variable will be included in the
-``variables:`` field of its :ref:`MDSubprogram`.
+``variables:`` field of its :ref:`DISubprogram`.
.. code-block:: llvm
- !0 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 0,
+ !0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 0,
scope: !3, file: !2, line: 7, type: !3,
flags: DIFlagArtificial)
- !1 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1,
+ !1 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1,
scope: !4, file: !2, line: 7, type: !3)
- !1 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "y",
+ !1 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y",
scope: !5, file: !2, line: 7, type: !3)
-MDExpression
+DIExpression
""""""""""""
-``MDExpression`` nodes represent DWARF expression sequences. They are used in
+``DIExpression`` nodes represent DWARF expression sequences. They are used in
:ref:`debug intrinsics<dbg_intrinsics>` (such as ``llvm.dbg.declare``) to
describe how the referenced LLVM variable relates to the source language
variable.
@@ -3275,30 +3275,30 @@ The current supported vocabulary is limited:
.. code-block:: llvm
- !0 = !MDExpression(DW_OP_deref)
- !1 = !MDExpression(DW_OP_plus, 3)
- !2 = !MDExpression(DW_OP_bit_piece, 3, 7)
- !3 = !MDExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
+ !0 = !DIExpression(DW_OP_deref)
+ !1 = !DIExpression(DW_OP_plus, 3)
+ !2 = !DIExpression(DW_OP_bit_piece, 3, 7)
+ !3 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_bit_piece, 3, 7)
-MDObjCProperty
+DIObjCProperty
""""""""""""""
-``MDObjCProperty`` nodes represent Objective-C property nodes.
+``DIObjCProperty`` nodes represent Objective-C property nodes.
.. code-block:: llvm
- !3 = !MDObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo",
+ !3 = !DIObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo",
getter: "getFoo", attributes: 7, type: !2)
-MDImportedEntity
+DIImportedEntity
""""""""""""""""
-``MDImportedEntity`` nodes represent entities (such as modules) imported into a
+``DIImportedEntity`` nodes represent entities (such as modules) imported into a
compile unit.
.. code-block:: llvm
- !2 = !MDImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0,
+ !2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0,
entity: !1, line: 7)
'``tbaa``' Metadata
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index 55e12d3efa0..95f5d07d16a 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -153,8 +153,8 @@ debugger to interpret the information.
To provide basic functionality, the LLVM debugger does have to make some
assumptions about the source-level language being debugged, though it keeps
these to a minimum. The only common features that the LLVM debugger assumes
-exist are `source files <LangRef.html#MDFile>`_, and `program objects
-<LangRef.html#MDGlobalVariable>`_. These abstract objects are used by a
+exist are `source files <LangRef.html#DIFile>`_, and `program objects
+<LangRef.html#DIGlobalVariable>`_. These abstract objects are used by a
debugger to form stack traces, show information about local variables, etc.
This section of the documentation first describes the representation aspects
@@ -181,9 +181,9 @@ provide debug information at various points in generated code.
This intrinsic provides information about a local element (e.g., variable).
The first argument is metadata holding the alloca for the variable. The second
-argument is a `local variable <LangRef.html#MDLocalVariable>`_ containing a
+argument is a `local variable <LangRef.html#DILocalVariable>`_ containing a
description of the variable. The third argument is a `complex expression
-<LangRef.html#MDExpression>`_.
+<LangRef.html#DIExpression>`_.
``llvm.dbg.value``
^^^^^^^^^^^^^^^^^^
@@ -196,8 +196,8 @@ This intrinsic provides information when a user source variable is set to a new
value. The first argument is the new value (wrapped as metadata). The second
argument is the offset in the user source variable where the new value is
written. The third argument is a `local variable
-<LangRef.html#MDLocalVariable>`_ containing a description of the variable. The
-third argument is a `complex expression <LangRef.html#MDExpression>`_.
+<LangRef.html#DILocalVariable>`_ containing a description of the variable. The
+third argument is a `complex expression <LangRef.html#DIExpression>`_.
Object lifetimes and scoping
============================
@@ -259,31 +259,31 @@ Compiled to LLVM, this function would be represented like this:
!llvm.module.flags = !{!7, !8, !9}
!llvm.ident = !{!10}
- !0 = !MDCompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231150) (llvm/trunk 231154)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
- !1 = !MDFile(filename: "/dev/stdin", directory: "/Users/dexonsmith/data/llvm/debug-info")
+ !0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231150) (llvm/trunk 231154)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
+ !1 = !DIFile(filename: "/dev/stdin", directory: "/Users/dexonsmith/data/llvm/debug-info")
!2 = !{}
!3 = !{!4}
- !4 = !MDSubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, function: void ()* @foo, variables: !2)
- !5 = !MDSubroutineType(types: !6)
+ !4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, function: void ()* @foo, variables: !2)
+ !5 = !DISubroutineType(types: !6)
!6 = !{null}
!7 = !{i32 2, !"Dwarf Version", i32 2}
!8 = !{i32 2, !"Debug Info Version", i32 3}
!9 = !{i32 1, !"PIC Level", i32 2}
!10 = !{!"clang version 3.7.0 (trunk 231150) (llvm/trunk 231154)"}
- !11 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "X", scope: !4, file: !1, line: 2, type: !12)
- !12 = !MDBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
- !13 = !MDExpression()
- !14 = !MDLocation(line: 2, column: 9, scope: !4)
- !15 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "Y", scope: !4, file: !1, line: 3, type: !12)
- !16 = !MDLocation(line: 3, column: 9, scope: !4)
- !17 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "Z", scope: !18, file: !1, line: 5, type: !12)
- !18 = distinct !MDLexicalBlock(scope: !4, file: !1, line: 4, column: 5)
- !19 = !MDLocation(line: 5, column: 11, scope: !18)
- !20 = !MDLocation(line: 6, column: 11, scope: !18)
- !21 = !MDLocation(line: 6, column: 9, scope: !18)
- !22 = !MDLocation(line: 8, column: 9, scope: !4)
- !23 = !MDLocation(line: 8, column: 7, scope: !4)
- !24 = !MDLocation(line: 9, column: 3, scope: !4)
+ !11 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "X", scope: !4, file: !1, line: 2, type: !12)
+ !12 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+ !13 = !DIExpression()
+ !14 = !DILocation(line: 2, column: 9, scope: !4)
+ !15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "Y", scope: !4, file: !1, line: 3, type: !12)
+ !16 = !DILocation(line: 3, column: 9, scope: !4)
+ !17 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "Z", scope: !18, file: !1, line: 5, type: !12)
+ !18 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 5)
+ !19 = !DILocation(line: 5, column: 11, scope: !18)
+ !20 = !DILocation(line: 6, column: 11, scope: !18)
+ !21 = !DILocation(line: 6, column: 9, scope: !18)
+ !22 = !DILocation(line: 8, column: 9, scope: !4)
+ !23 = !DILocation(line: 8, column: 7, scope: !4)
+ !24 = !DILocation(line: 9, column: 3, scope: !4)
This example illustrates a few important details about LLVM debugging
@@ -303,15 +303,15 @@ scope information for the variable ``X``.
.. code-block:: llvm
- !14 = !MDLocation(line: 2, column: 9, scope: !4)
- !4 = !MDSubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5,
+ !14 = !DILocation(line: 2, column: 9, scope: !4)
+ !4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5,
isLocal: false, isDefinition: true, scopeLine: 1,
isOptimized: false, function: void ()* @foo,
variables: !2)
Here ``!14`` is metadata providing `location information
-<LangRef.html#MDLocation>`_. In this example, scope is encoded by ``!4``, a
-`subprogram descriptor <LangRef.html#MDSubprogram>`_. This way the location
+<LangRef.html#DILocation>`_. In this example, scope is encoded by ``!4``, a
+`subprogram descriptor <LangRef.html#DISubprogram>`_. This way the location
information attached to the intrinsics indicates that the variable ``X`` is
declared at line number 2 at a function level scope in function ``foo``.
@@ -328,8 +328,8 @@ scope information for the variable ``Z``.
.. code-block:: llvm
- !18 = distinct !MDLexicalBlock(scope: !4, file: !1, line: 4, column: 5)
- !19 = !MDLocation(line: 5, column: 11, scope: !18)
+ !18 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 5)
+ !19 = !DILocation(line: 5, column: 11, scope: !18)
Here ``!19`` indicates that ``Z`` is declared at line number 5 and column
number 0 inside of lexical scope ``!18``. The lexical scope itself resides
@@ -406,7 +406,7 @@ a C/C++ front-end would generate the following descriptors:
!llvm.module.flags = !{!6, !7}
;; Define the compile unit.
- !0 = !MDCompileUnit(language: DW_LANG_C99, file: !1,
+ !0 = !DICompileUnit(language: DW_LANG_C99, file: !1,
producer:
"clang version 3.7.0 (trunk 231150) (llvm/trunk 231154)",
isOptimized: false, runtimeVersion: 0, emissionKind: 1,
@@ -416,7 +416,7 @@ a C/C++ front-end would generate the following descriptors:
;;
;; Define the file
;;
- !1 = !MDFile(filename: "/dev/stdin",
+ !1 = !DIFile(filename: "/dev/stdin",
directory: "/Users/dexonsmith/data/llvm/debug-info")
;; An empty array.
@@ -428,14 +428,14 @@ a C/C++ front-end would generate the following descriptors:
;;
;; Define the global variable itself.
;;
- !4 = !MDGlobalVariable(name: "MyGlobal", scope: !0, file: !1, line: 1,
+ !4 = !DIGlobalVariable(name: "MyGlobal", scope: !0, file: !1, line: 1,
type: !5, isLocal: false, isDefinition: true,
variable: i32* @MyGlobal)
;;
;; Define the type
;;
- !5 = !MDBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+ !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
;; Dwarf version to output.
!6 = !{i32 2, !"Dwarf Version", i32 2}
@@ -461,7 +461,7 @@ a C/C++ front-end would generate the following descriptors:
;;
;; Define the anchor for subprograms.
;;
- !4 = !MDSubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5,
+ !4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5,
isLocal: false, isDefinition: true, scopeLine: 1,
flags: DIFlagPrototyped, isOptimized: false,
function: i32 (i32, i8**)* @main, variables: !2)
diff --git a/llvm/docs/tutorial/LangImpl8.rst b/llvm/docs/tutorial/LangImpl8.rst
index 90c3b83cf08..0b9b39c84b7 100644
--- a/llvm/docs/tutorial/LangImpl8.rst
+++ b/llvm/docs/tutorial/LangImpl8.rst
@@ -187,13 +187,13 @@ expressions:
static DIBuilder *DBuilder;
struct DebugInfo {
- MDCompileUnit *TheCU;
- MDType *DblTy;
+ DICompileUnit *TheCU;
+ DIType *DblTy;
- MDType *getDoubleTy();
+ DIType *getDoubleTy();
} KSDbgInfo;
- MDType *DebugInfo::getDoubleTy() {
+ DIType *DebugInfo::getDoubleTy() {
if (DblTy.isValid())
return DblTy;
@@ -245,25 +245,25 @@ So the context:
.. code-block:: c++
- MDFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU.getFilename(),
+ DIFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU.getFilename(),
KSDbgInfo.TheCU.getDirectory());
-giving us an MDFile and asking the ``Compile Unit`` we created above for the
+giving us an DIFile and asking the ``Compile Unit`` we created above for the
directory and filename where we are currently. Then, for now, we use some
source locations of 0 (since our AST doesn't currently have source location
information) and construct our function definition:
.. code-block:: c++
- MDScope *FContext = Unit;
+ DIScope *FContext = Unit;
unsigned LineNo = 0;
unsigned ScopeLine = 0;
- MDSubprogram *SP = DBuilder->createFunction(
+ DISubprogram *SP = DBuilder->createFunction(
FContext, Name, StringRef(), Unit, LineNo,
CreateFunctionType(Args.size(), Unit), false /* internal linkage */,
- true /* definition */, ScopeLine, DebugNode::FlagPrototyped, false, F);
+ true /* definition */, ScopeLine, DINode::FlagPrototyped, false, F);
-and we now have an MDSubprogram that contains a reference to all of our
+and we now have an DISubprogram that contains a reference to all of our
metadata for the function.
Source Locations
@@ -330,7 +330,7 @@ by constructing another small function:
.. code-block:: c++
void DebugInfo::emitLocation(ExprAST *AST) {
- MDScope *Scope;
+ DIScope *Scope;
if (LexicalBlocks.empty())
Scope = TheCU;
else
@@ -347,11 +347,11 @@ of scopes:
.. code-block:: c++
- std::vector<MDScope *> LexicalBlocks;
- std::map<const PrototypeAST *, MDScope *> FnScopeMap;
+ std::vector<DIScope *> LexicalBlocks;
+ std::map<const PrototypeAST *, DIScope *> FnScopeMap;
and keep a map of each function to the scope that it represents (an
-MDSubprogram is also an MDScope).
+DISubprogram is also an DIScope).
Then we make sure to:
@@ -392,10 +392,10 @@ argument allocas in ``PrototypeAST::CreateArgumentAllocas``.
.. code-block:: c++
- MDScope *Scope = KSDbgInfo.LexicalBlocks.back();
- MDFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU.getFilename(),
+ DIScope *Scope = KSDbgInfo.LexicalBlocks.back();
+ DIFile *Unit = DBuilder->createFile(KSDbgInfo.TheCU.getFilename(),
KSDbgInfo.TheCU.getDirectory());
- MDLocalVariable D = DBuilder->createLocalVariable(
+ DILocalVariable D = DBuilder->createLocalVariable(
dwarf::DW_TAG_arg_variable, Scope, Args[Idx], Unit, Line,
KSDbgInfo.getDoubleTy(), Idx);
OpenPOWER on IntegriCloud