summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2014-06-20 10:08:11 +0000
committerOliver Stannard <oliver.stannard@arm.com>2014-06-20 10:08:11 +0000
commite5241cc48858af7c6ca58ae677b69323e8f84eb5 (patch)
tree318382ea8a0b6d8fbb3c03d846aeb64dd54cec78 /docs
parenta5efeb6b39304f5d34d74a5e32e5142d84eb2a43 (diff)
downloadllvm-e5241cc48858af7c6ca58ae677b69323e8f84eb5.tar.gz
llvm-e5241cc48858af7c6ca58ae677b69323e8f84eb5.tar.bz2
llvm-e5241cc48858af7c6ca58ae677b69323e8f84eb5.tar.xz
Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size.
Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size based on module flags metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index b75058fa9a..c535443e2c 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -3146,6 +3146,42 @@ Each individual option is required to be either a valid option for the target's
linker, or an option that is reserved by the target specific assembly writer or
object file emitter. No other aspect of these options is defined by the IR.
+C type width Module Flags Metadata
+----------------------------------
+
+The ARM backend emits a section into each generated object file describing the
+options that it was compiled with (in a compiler-independent way) to prevent
+linking incompatible objects, and to allow automatic library selection. Some
+of these options are not visible at the IR level, namely wchar_t width and enum
+width.
+
+To pass this information to the backend, these options are encoded in module
+flags metadata, using the following key-value pairs:
+
+.. list-table::
+ :header-rows: 1
+ :widths: 30 70
+
+ * - Key
+ - Value
+
+ * - short_wchar
+ - * 0 --- sizeof(wchar_t) == 4
+ * 1 --- sizeof(wchar_t) == 2
+
+ * - short_enum
+ - * 0 --- Enums are at least as large as an ``int``.
+ * 1 --- Enums are stored in the smallest integer type which can
+ represent all of its values.
+
+For example, the following metadata section specifies that the module was
+compiled with a ``wchar_t`` width of 4 bytes, and the underlying type of an
+enum is the smallest type which can represent all of its values::
+
+ !llvm.module.flags = !{!0, !1}
+ !0 = metadata !{i32 1, metadata !"short_wchar", i32 1}
+ !1 = metadata !{i32 1, metadata !"short_enum", i32 0}
+
.. _intrinsicglobalvariables:
Intrinsic Global Variables