diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-17 02:30:20 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-17 02:30:20 +0000 |
commit | 05ebfd09382b8dc8cd26eaf8fb91fb73ce48290e (patch) | |
tree | 92e6efb5cab9251fd4ec1425cf2bc3be61340af2 /llvm/docs | |
parent | 25fd344aa4d69b18b1328c0a8b89dc539506a582 (diff) | |
download | bcm5719-llvm-05ebfd09382b8dc8cd26eaf8fb91fb73ce48290e.tar.gz bcm5719-llvm-05ebfd09382b8dc8cd26eaf8fb91fb73ce48290e.zip |
IR: Use ODR to unique DICompositeType members
Merge members that are describing the same member of the same ODR type,
even if other bits differ. If the file or line differ, we don't care;
if anything else differs, it's an ODR violation (and we still don't
really care).
For DISubprogram declarations, this looks at the LinkageName and Scope.
For DW_TAG_member instances of DIDerivedType, this looks at the Name and
Scope. In both cases, we know that the Scope follows ODR rules if it
has a non-empty identifier.
llvm-svn: 266548
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index b1edb500035..d3ad74ffd58 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -3976,7 +3976,10 @@ The following ``tag:`` values are valid: ``DW_TAG_member`` is used to define a member of a :ref:`composite type <DICompositeType>`. The type of the member is the ``baseType:``. The -``offset:`` is the member's bit offset. +``offset:`` is the member's bit offset. If the composite type has a non-empty +``identifier:``, then it respects ODR rules. In that case, the ``scope:`` +reference will be a :ref:`metadata string <metadata-string>`, and the member +will be uniqued solely based on its ``name:`` and ``scope:``. ``DW_TAG_inheritance`` and ``DW_TAG_friend`` are used in the ``elements:`` field of :ref:`composite types <DICompositeType>` to describe parents and @@ -4125,6 +4128,12 @@ metadata. 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:`DISubroutineType`. +When ``isDefinition: false``, subprograms describe a declaration in the type +tree as opposed to a definition of a funciton. If the scope is a +:ref:`metadata string <metadata-string>` then the composite type follows ODR +rules, and the subprogram declaration is uniqued based only on its +``linkageName:`` and ``scope:``. + .. code-block:: llvm define void @_Z3foov() !dbg !0 { @@ -4133,7 +4142,7 @@ the IR. The ``type:`` field must point at an :ref:`DISubroutineType`. !0 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, - isDefinition: false, scopeLine: 8, + isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, |