summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-05-31 23:01:54 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-05-31 23:01:54 +0000
commitcceae7feda8e33194d1a6c5963bd4114bb8d2b36 (patch)
treed7f155b4ea8004651b1aadf412465b0d3950f9e6 /llvm/docs
parent81fbadb63f4d28f62950e2e2c4967f1429b3ca55 (diff)
downloadbcm5719-llvm-cceae7feda8e33194d1a6c5963bd4114bb8d2b36.tar.gz
bcm5719-llvm-cceae7feda8e33194d1a6c5963bd4114bb8d2b36.zip
Add support for metadata attachments for global variables.
This patch adds an IR, assembly and bitcode representation for metadata attachments for globals. Future patches will port existing features to use these new attachments. Differential Revision: http://reviews.llvm.org/D20074 llvm-svn: 271348
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/BitCodeFormat.rst10
-rw-r--r--llvm/docs/LangRef.rst5
2 files changed, 13 insertions, 2 deletions
diff --git a/llvm/docs/BitCodeFormat.rst b/llvm/docs/BitCodeFormat.rst
index edab66ead64..ac051c49bc8 100644
--- a/llvm/docs/BitCodeFormat.rst
+++ b/llvm/docs/BitCodeFormat.rst
@@ -856,6 +856,16 @@ be one ``GCNAME`` record for each garbage collector name referenced in function
``gc`` attributes within the module. These records can be referenced by 1-based
index in the *gc* fields of ``FUNCTION`` records.
+MODULE_CODE_GLOBALVAR_ATTACHMENT Record
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``[GLOBALVAR_ATTACHMENT, valueid, n x [id, mdnode]]``
+
+The ``GLOBALVAR_ATTACHMENT`` record (code 19) describes the metadata
+attachments for a global variable. The ``valueid`` is the value index for
+the global variable, and the remaining fields are pairs of metadata name
+indices and metadata node indices.
+
.. _PARAMATTR_BLOCK:
PARAMATTR_BLOCK Contents
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 4882ac106b8..2a1c7a00049 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -619,7 +619,8 @@ assume that the globals are densely packed in their section and try to
iterate over them as an array, alignment padding would break this
iteration. The maximum alignment is ``1 << 29``.
-Globals can also have a :ref:`DLL storage class <dllstorageclass>`.
+Globals can also have a :ref:`DLL storage class <dllstorageclass>` and
+an optional list of attached :ref:`metadata <metadata>`,
Variables and aliases can have a
:ref:`Thread Local Storage Model <tls_model>`.
@@ -630,7 +631,7 @@ Syntax::
[unnamed_addr] [AddrSpace] [ExternallyInitialized]
<global | constant> <Type> [<InitializerConstant>]
[, section "name"] [, comdat [($name)]]
- [, align <Alignment>]
+ [, align <Alignment>] (, !name !N)*
For example, the following defines a global in a numbered address space
with an initializer, section, and alignment:
OpenPOWER on IntegriCloud