diff options
author | Javed Absar <javed.absar@arm.com> | 2017-05-11 12:28:08 +0000 |
---|---|---|
committer | Javed Absar <javed.absar@arm.com> | 2017-05-11 12:28:08 +0000 |
commit | a8ddcaa55ffc1b6e0851410402b280461978c1bd (patch) | |
tree | c6a2e7d88c7ec093fe67f0eef61dc2ebf4085353 /docs | |
parent | 9651b57a88a63c3c935e329e93f885f3853c5b7f (diff) |
[IR] Allow attributes with global variables
This patch extends llvm-ir to allow attributes to be set on global variables.
An RFC was sent out earlier by my colleague James Molloy: http://lists.llvm.org/pipermail/cfe-dev/2017-March/053100.html
A key part of that proposal was to extend LLVM-IR to carry attributes on global variables.
This generic feature could be useful for multiple purposes.
In our present context, it would be useful to carry user specified sections for bss/rodata/data.
Reviewed by: Jonathan Roelofs, Reid Kleckner
Differential Revision: https://reviews.llvm.org/D32009
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.rst | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index dc6350c5520d..e7c2888cd0d1 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -641,8 +641,9 @@ 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>` and -an optional list of attached :ref:`metadata <metadata>`, +Globals can also have a :ref:`DLL storage class <dllstorageclass>`, +an optional :ref:`global attributes <glattrs>` and +an optional list of attached :ref:`metadata <metadata>`. Variables and aliases can have a :ref:`Thread Local Storage Model <tls_model>`. @@ -1624,6 +1625,14 @@ example: the ELF x86-64 abi, but it can be disabled for some compilation units. +.. _glattrs: + +Global Attributes +----------------- + +Attributes may be set to communicate additional information about a global variable. +Unlike :ref:`function attributes <fnattrs>`, attributes on a global variable +are grouped into a single :ref:`attribute group <attrgrp>`. .. _opbundles: |