Changeset View
Changeset View
Standalone View
Standalone View
docs/LangRef.rst
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 5,095 Lines • ▼ Show 20 Lines | .. code-block:: llvm | ||||
!0 = !{!"magic ptr"} | !0 = !{!"magic ptr"} | ||||
!1 = !{!"other ptr"} | !1 = !{!"other ptr"} | ||||
'``type``' Metadata | '``type``' Metadata | ||||
^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^ | ||||
See :doc:`TypeMetadata`. | See :doc:`TypeMetadata`. | ||||
'``associated``' Metadata | |||||
^^^^^^^^^^^^^^^^^^^ | |||||
The ``associated`` metadata may be attached to a global object | |||||
declaration with a single argument that references another global object. | |||||
This metadata prevents discarding of the global object in linker GC | |||||
mehdi_amini: 80 cols.
| |||||
unless the referenced object is also discarded. The linker support for | |||||
this feature is spotty. For best compatibility, globals carrying this | |||||
Not Done ReplyInline ActionsI don't think this is an OK property of metadata. mehdi_amini: I don't think this is an OK property of metadata.
Have you look for another representation that… | |||||
Not Done ReplyInline ActionsIt does not seem to be that bad. After all, !type and !absolute_symbol already have that property, they just don't document it. eugenis: It does not seem to be that bad. After all, !type and !absolute_symbol already have that… | |||||
Not Done ReplyInline ActionsHow about now? eugenis: How about now?
Under this list of conditions the metadata can be discarded, which will make the… | |||||
Not Done ReplyInline ActionsFrom LangRef: A transformation is required to drop any metadata attachment that it does not know or know it can’t preserve. Currently there is an exception for metadata attachment to globals for !type and !absolute_symbol which can’t be unconditionally dropped unless the global is itself deleted. mehdi_amini: From LangRef:
```
A transformation is required to drop any metadata attachment that it does… | |||||
Not Done ReplyInline ActionsAh thanks, I was expecting to find this in the individual metadata type's sections. eugenis: Ah thanks, I was expecting to find this in the individual metadata type's sections. | |||||
metadata must also | |||||
mehdi_aminiUnsubmitted Not Done ReplyInline Actionscolon? mehdi_amini: colon?
Also, since it seems to be advisory and not mandatory I wouldn't use "must" but "may". | |||||
- Be in a comdat with the referenced global. | |||||
- Be in @llvm.compiler.used. | |||||
- Have an explicit section with a name which is a valid C identifier. | |||||
mehdi_aminiUnsubmitted From the sentence this list is just "guidelines", correct? Is it still "valid" to use the associated MD without a section? In different comdats? mehdi_amini: From the sentence this list is just "guidelines", correct? Is it still "valid" to use the… | |||||
It does not have any effect on non-ELF targets. | |||||
Example: | |||||
.. code-block:: llvm | |||||
$a = comdat any | |||||
@a = global i32 1, comdat $a | |||||
@b = internal global i32 2, comdat $a, section "abc", !associated !0 | |||||
!0 = !{i32* @a} | |||||
Module Flags Metadata | Module Flags Metadata | ||||
===================== | ===================== | ||||
Information about the module as a whole is difficult to convey to LLVM's | Information about the module as a whole is difficult to convey to LLVM's | ||||
subsystems. The LLVM IR isn't sufficient to transmit this information. | subsystems. The LLVM IR isn't sufficient to transmit this information. | ||||
The ``llvm.module.flags`` named metadata exists in order to facilitate | The ``llvm.module.flags`` named metadata exists in order to facilitate | ||||
this. These flags are in the form of key / value pairs --- much like a | this. These flags are in the form of key / value pairs --- much like a | ||||
▲ Show 20 Lines • Show All 8,081 Lines • Show Last 20 Lines |
80 cols.