Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:22

0001 //===- BitCodeEnums.h - Core enums for the bitstream format -----*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This header defines "core" bitstream enum values.
0010 // It has been separated from the other header that defines bitstream enum
0011 // values, BitCodes.h, to allow tools to track changes to the various
0012 // bitstream and bitcode enums without needing to fully or partially build
0013 // LLVM itself.
0014 //
0015 // The enum values defined in this file should be considered permanent.  If
0016 // new features are added, they should have values added at the end of the
0017 // respective lists.
0018 //
0019 //===----------------------------------------------------------------------===//
0020 
0021 #ifndef LLVM_BITSTREAM_BITCODEENUMS_H
0022 #define LLVM_BITSTREAM_BITCODEENUMS_H
0023 
0024 namespace llvm {
0025 /// Offsets of the 32-bit fields of bitstream wrapper header.
0026 enum BitstreamWrapperHeader : unsigned {
0027   BWH_MagicField = 0 * 4,
0028   BWH_VersionField = 1 * 4,
0029   BWH_OffsetField = 2 * 4,
0030   BWH_SizeField = 3 * 4,
0031   BWH_CPUTypeField = 4 * 4,
0032   BWH_HeaderSize = 5 * 4
0033 };
0034 
0035 namespace bitc {
0036 enum StandardWidths {
0037   BlockIDWidth = 8,   // We use VBR-8 for block IDs.
0038   CodeLenWidth = 4,   // Codelen are VBR-4.
0039   BlockSizeWidth = 32 // BlockSize up to 2^32 32-bit words = 16GB per block.
0040 };
0041 
0042 // The standard abbrev namespace always has a way to exit a block, enter a
0043 // nested block, define abbrevs, and define an unabbreviated record.
0044 enum FixedAbbrevIDs {
0045   END_BLOCK = 0, // Must be zero to guarantee termination for broken bitcode.
0046   ENTER_SUBBLOCK = 1,
0047 
0048   /// DEFINE_ABBREV - Defines an abbrev for the current block.  It consists
0049   /// of a vbr5 for # operand infos.  Each operand info is emitted with a
0050   /// single bit to indicate if it is a literal encoding.  If so, the value is
0051   /// emitted with a vbr8.  If not, the encoding is emitted as 3 bits followed
0052   /// by the info value as a vbr5 if needed.
0053   DEFINE_ABBREV = 2,
0054 
0055   // UNABBREV_RECORDs are emitted with a vbr6 for the record code, followed by
0056   // a vbr6 for the # operands, followed by vbr6's for each operand.
0057   UNABBREV_RECORD = 3,
0058 
0059   // This is not a code, this is a marker for the first abbrev assignment.
0060   FIRST_APPLICATION_ABBREV = 4
0061 };
0062 
0063 /// StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO
0064 /// block, which contains metadata about other blocks in the file.
0065 enum StandardBlockIDs {
0066   /// BLOCKINFO_BLOCK is used to define metadata about blocks, for example,
0067   /// standard abbrevs that should be available to all blocks of a specified
0068   /// ID.
0069   BLOCKINFO_BLOCK_ID = 0,
0070 
0071   // Block IDs 1-7 are reserved for future expansion.
0072   FIRST_APPLICATION_BLOCKID = 8
0073 };
0074 
0075 /// BlockInfoCodes - The blockinfo block contains metadata about user-defined
0076 /// blocks.
0077 enum BlockInfoCodes {
0078   // DEFINE_ABBREV has magic semantics here, applying to the current SETBID'd
0079   // block, instead of the BlockInfo block.
0080 
0081   BLOCKINFO_CODE_SETBID = 1,       // SETBID: [blockid#]
0082   BLOCKINFO_CODE_BLOCKNAME = 2,    // BLOCKNAME: [name]
0083   BLOCKINFO_CODE_SETRECORDNAME = 3 // BLOCKINFO_CODE_SETRECORDNAME:
0084                                    //                             [id, name]
0085 };
0086 
0087 } // namespace bitc
0088 } // namespace llvm
0089 
0090 #endif