X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FBitCodeFormat.rst;h=34485b538c54861fda1611c4e763089bfb2ebc28;hb=5179f70b34af959847d6567e5764538a42782596;hp=9363a62d0806b2730395bdf3e2f5bf73031c97ca;hpb=bce07a0c3bb907488e75bcabe0d7c6a8fb9c7132;p=oota-llvm.git diff --git a/docs/BitCodeFormat.rst b/docs/BitCodeFormat.rst index 9363a62d080..34485b538c5 100644 --- a/docs/BitCodeFormat.rst +++ b/docs/BitCodeFormat.rst @@ -28,8 +28,9 @@ Unlike XML, the bitstream format is a binary encoding, and unlike XML it provides a mechanism for the file to self-describe "abbreviations", which are effectively size optimizations for the content. -LLVM IR files may be optionally embedded into a `wrapper`_ structure that makes -it easy to embed extra data along with LLVM IR files. +LLVM IR files may be optionally embedded into a `wrapper`_ structure, or in a +`native object file`_. Both of these mechanisms make it easy to embed extra +data along with LLVM IR files. This document first describes the LLVM bitstream format, describes the wrapper format, then describes the record structure used by LLVM IR files. @@ -460,6 +461,19 @@ to the start of the bitcode stream in the file, and the Size field is the size in bytes of the stream. CPUType is a target-specific value that can be used to encode the CPU of the target. +.. _native object file: + +Native Object File Wrapper Format +================================= + +Bitcode files for LLVM IR may also be wrapped in a native object file +(i.e. ELF, COFF, Mach-O). The bitcode must be stored in a section of the +object file named ``.llvmbc``. This wrapper format is useful for accommodating +LTO in compilation pipelines where intermediate objects must be native object +files which contain metadata in other sections. + +Not all tools support this format. + .. _encoding of LLVM IR: LLVM IR Encoding @@ -688,7 +702,8 @@ global variable. The operand fields are: * ``weak_odr``: code 10 * ``linkonce_odr``: code 11 * ``available_externally``: code 12 - * ``linker_private``: code 13 + * deprecated : code 13 + * deprecated : code 14 * alignment*: The logarithm base 2 of the variable's requested alignment, plus 1 @@ -713,7 +728,7 @@ global variable. The operand fields are: * *unnamed_addr*: If present and non-zero, indicates that the variable has ``unnamed_addr`` -.. _dllstorageclass: +.. _bcdllstorageclass: * *dllstorageclass*: If present, an encoding of the DLL storage class of this variable: @@ -739,6 +754,8 @@ function. The operand fields are: * ``coldcc``: code 9 * ``webkit_jscc``: code 12 * ``anyregcc``: code 13 + * ``preserve_mostcc``: code 14 + * ``preserve_allcc``: code 15 * ``x86_stdcallcc``: code 64 * ``x86_fastcallcc``: code 65 * ``arm_apcscc``: code 66 @@ -770,7 +787,8 @@ function. The operand fields are: * *prefix*: If non-zero, the value index of the prefix data for this function, plus 1. -* *dllstorageclass*: An encoding of the `dllstorageclass`_ of this function +* *dllstorageclass*: An encoding of the + :ref:`dllstorageclass` of this function MODULE_CODE_ALIAS Record ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -788,7 +806,8 @@ fields are * *visibility*: If present, an encoding of the `visibility`_ of the alias -* *dllstorageclass*: If present, an encoding of the `dllstorageclass`_ of the alias +* *dllstorageclass*: If present, an encoding of the + :ref:`dllstorageclass` of the alias MODULE_CODE_PURGEVALS Record ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1090,7 +1109,7 @@ named type. VALUE_SYMTAB_BLOCK Contents --------------------------- -The ``VALUE_SYMTAB_BLOCK`` block (id 14) ... +The ``VALUE_SYMTAB_BLOCK`` block (id 14) ... .. _METADATA_BLOCK: