[llvm-commits] CVS: llvm/include/llvm/Bytecode/Format.h

LLVM llvm at cs.uiuc.edu
Sun Jul 25 10:50:10 PDT 2004



Changes in directory llvm/include/llvm/Bytecode:

Format.h updated: 1.9 -> 1.10

---
Log message:

bug 402: http://llvm.cs.uiuc.edu/PR402 :
A new set of block identifiers has been added for version 1.3 so that the
range of values can fit within 5 bits. This aids in halving the size of
block headers.


---
Diffs of the changes:  (+45 -0)

Index: llvm/include/llvm/Bytecode/Format.h
diff -u llvm/include/llvm/Bytecode/Format.h:1.9 llvm/include/llvm/Bytecode/Format.h:1.10
--- llvm/include/llvm/Bytecode/Format.h:1.9	Sun Jan 18 15:09:23 2004
+++ llvm/include/llvm/Bytecode/Format.h	Sun Jul 25 12:50:00 2004
@@ -32,6 +32,7 @@
     SymbolTable,
     ModuleGlobalInfo,
     GlobalTypePlane,
+    DependentLibs,
 
     // Function subtypes:
     // Can also have ConstantPool block
@@ -48,6 +49,50 @@
     // encoded more efficiently.
     CompactionTable = 0x33,
   };
+
+  /// In LLVM 1.3 format, the identifier and the size of the block are
+  /// encoded into a single vbr_uint32 with 5 bits for the block identifier 
+  /// and 27-bits for block length. This limits blocks to a maximum of 
+  /// 128MBytes of data, and block types to 31 which should be sufficient 
+  /// for the foreseeable usage. Because the values of block identifiers MUST
+  /// fit within 5 bits (values 1-31), this enumeration is used to ensure
+  /// smaller values are used for 1.3 and subsequent bytecode versions.
+  /// @brief The block number identifiers used in LLVM 1.3 bytecode
+  /// format.
+  enum CompressedBytecodeBlockIdentifiers {
+
+    // Zero value ist verbotten!
+    Reserved_DoNotUse = 0x00,      ///< Don't use this!
+
+    // This is the uber block that contains the rest of the blocks.
+    ModuleBlockID = 0x01,          ///< 1.3 identifier for modules
+
+    // Module subtypes:
+
+    // This is the identifier for a function
+    FunctionBlockID = 0x02,        ///< 1.3 identifier for Functions
+    ConstantPoolBlockID = 0x03,    ///< 1.3 identifier for constant pool
+    SymbolTableBlockID = 0x04,     ///< 1.3 identifier for symbol table
+    ModuleGlobalInfoBlockID = 0x05,///< 1.3 identifier for module globals
+    GlobalTypePlaneBlockID = 0x06, ///< 1.3 identifier for global types
+
+    // Function subtypes:
+
+    // InstructionList - The instructions in the body of a function.  This
+    // superceeds the old BasicBlock node used in LLVM 1.0.
+    InstructionListBlockID = 0x07, ///< 1.3 identifier for insruction list      
+
+    // CompactionTable - blocks with this id are used to define local remapping
+    // tables for a function, allowing the indices used within the function to
+    // be as small as possible.  This often allows the instructions to be
+    // encoded more efficiently.
+    CompactionTableBlockID = 0x08, ///< 1.3 identifier for compaction tables
+
+    // Dependent Libraries - blocks with this id contain strings of library 
+    // names, as they might appear on a -l option to the linker.
+    DependentLibsBlockID = 0x09,  ///< 1.3 identifier for list of dependent libs
+  };
+
 };
 
 } // End llvm namespace





More information about the llvm-commits mailing list