Clang format a few prior patches (NFC)
[oota-llvm.git] / include / llvm / Bitcode / LLVMBitCodes.h
index d5f3c7f60965918c2f1916f420104d8b610d01d2..a4ba05216adf68658d890ea5ff5a79d49f94db58 100644 (file)
 namespace llvm {
 namespace bitc {
   // The only top-level block type defined is for a module.
-  enum BlockIDs {
-    // Blocks
-    MODULE_BLOCK_ID          = FIRST_APPLICATION_BLOCKID,
-
-    // Module sub-block id's.
-    PARAMATTR_BLOCK_ID,
-    PARAMATTR_GROUP_BLOCK_ID,
-
-    CONSTANTS_BLOCK_ID,
-    FUNCTION_BLOCK_ID,
-
-    UNUSED_ID1,
-
-    VALUE_SYMTAB_BLOCK_ID,
-    METADATA_BLOCK_ID,
-    METADATA_ATTACHMENT_ID,
-
-    TYPE_BLOCK_ID_NEW,
-
-    USELIST_BLOCK_ID,
-
-    MODULE_STRTAB_BLOCK_ID,
-    FUNCTION_SUMMARY_BLOCK_ID,
-
-    OPERAND_BUNDLE_TAGS_BLOCK_ID
-  };
-
+enum BlockIDs {
+  // Blocks
+  MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID,
+
+  // Module sub-block id's.
+  PARAMATTR_BLOCK_ID,
+  PARAMATTR_GROUP_BLOCK_ID,
+
+  CONSTANTS_BLOCK_ID,
+  FUNCTION_BLOCK_ID,
+
+  // Block intended to contains information on the bitcode versioning.
+  // Can be used to provide better error messages when we fail to parse a
+  // bitcode file.
+  IDENTIFICATION_BLOCK_ID,
+
+  VALUE_SYMTAB_BLOCK_ID,
+  METADATA_BLOCK_ID,
+  METADATA_ATTACHMENT_ID,
+
+  TYPE_BLOCK_ID_NEW,
+
+  USELIST_BLOCK_ID,
+
+  MODULE_STRTAB_BLOCK_ID,
+  FUNCTION_SUMMARY_BLOCK_ID,
+
+  OPERAND_BUNDLE_TAGS_BLOCK_ID
+};
+
+/// Idenfitication block contains a string that describes the producer details,
+/// and an epoch that defines the auto-upgrade capability.
+enum IdentificationCodes {
+  IDENTIFICATION_CODE_STRING = 1, // IDENTIFICATION:      [strchr x N]
+  IDENTIFICATION_CODE_EPOCH = 2,  // EPOCH:               [epoch#]
+};
+
+/// The epoch that defines the auto-upgrade compatibility for the bitcode.
+///
+/// LLVM guarantees in a major release that a minor release can read bitcode
+/// generated by previous minor releases. We translate this by making the reader
+/// accepting only bitcode with the same epoch, except for the X.0 release which
+/// also accepts N-1.
+enum { BITCODE_CURRENT_EPOCH = 0 };
 
   /// MODULE blocks have a number of optional fields and subblocks.
   enum ModuleCodes {