From afedcb36aaadfaec301cd34bb287164a07b6989d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 Nov 2005 07:20:25 +0000 Subject: [PATCH] describe extensions to the .bc format for function/global alignment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24217 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/BytecodeFormat.html | 74 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/docs/BytecodeFormat.html b/docs/BytecodeFormat.html index 6aa3ba5e106..7920dd53ece 100644 --- a/docs/BytecodeFormat.html +++ b/docs/BytecodeFormat.html @@ -992,12 +992,16 @@ platform independent module).
Global Variable Field
+
+

Global variables are written using an uint32_vbr -that encodes information about the global variable and a list of the -constant initializers for the global var, if any.

+that encodes information about the global variable, an optional extension vbr, +and a an optional initializers for the global var.

+

The table below provides the bit layout of the first uint32_vbr that describes the global variable.

+ @@ -1025,8 +1029,43 @@ follows.
+ +

When the Linkage type is set to 3 (internal) and the initializer field is set +to 0 (an invalid combination), an extension word follows the first uint32_vbr which encodes the real linkage and init flag, +and can includes more information:

+ + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
bit(0)Has initializer? Indicates the real value of the "Has + initializer" field for the global.
bit(2-4)Linkage type: Indicates the real value of the "linkage + type" field for the global.
bit(4-8)The log-base-2 of the alignment for the global.
bit(9-31)Currently unassigned.
+

The table below provides the format of the constant initializers for -the global variable field, if it has one.

+the global variable field, if it has one (indicated by the "Has initializer" +field).

+ @@ -1048,7 +1087,8 @@ numbers of the global variable's constant initializer.

Functions are written using an uint32_vbr -that encodes information about the function and a set of flags.

+that encodes information about the function and a set of flags. If needed, +an extension word may follow this first field.

The table below provides the bit layout of the uint32_vbr that describes the function.

@@ -1074,9 +1114,33 @@ href="#uint32_vbr">uint32_vbr that describes the function.

Block in the bytecode file for the function.
- + + + + + + +
bit(5-)bit(5-30) Type slot number of type for the function.
bit(31)Indicates whether an extension word follows.
+ +

If bit(31) is set, an additional uint32_vbr word +follows with the following fields:

+ + + + + + + + + + + + + + +
TypeDescription
bit(0-4)The log-base-2 of the alignment for the function.
bit(5-31)Currently unassigned.