LLVM 19.0.0git
BitCodeEnums.h
Go to the documentation of this file.
1//===- BitCodeEnums.h - Core enums for the bitstream format -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This header defines "core" bitstream enum values.
10// It has been separated from the other header that defines bitstream enum
11// values, BitCodes.h, to allow tools to track changes to the various
12// bitstream and bitcode enums without needing to fully or partially build
13// LLVM itself.
14//
15// The enum values defined in this file should be considered permanent. If
16// new features are added, they should have values added at the end of the
17// respective lists.
18//
19//===----------------------------------------------------------------------===//
20
21#ifndef LLVM_BITSTREAM_BITCODEENUMS_H
22#define LLVM_BITSTREAM_BITCODEENUMS_H
23
24namespace llvm {
25/// Offsets of the 32-bit fields of bitstream wrapper header.
26enum BitstreamWrapperHeader : unsigned {
32 BWH_HeaderSize = 5 * 4
33};
34
35namespace bitc {
37 BlockIDWidth = 8, // We use VBR-8 for block IDs.
38 CodeLenWidth = 4, // Codelen are VBR-4.
39 BlockSizeWidth = 32 // BlockSize up to 2^32 32-bit words = 16GB per block.
40};
41
42// The standard abbrev namespace always has a way to exit a block, enter a
43// nested block, define abbrevs, and define an unabbreviated record.
45 END_BLOCK = 0, // Must be zero to guarantee termination for broken bitcode.
47
48 /// DEFINE_ABBREV - Defines an abbrev for the current block. It consists
49 /// of a vbr5 for # operand infos. Each operand info is emitted with a
50 /// single bit to indicate if it is a literal encoding. If so, the value is
51 /// emitted with a vbr8. If not, the encoding is emitted as 3 bits followed
52 /// by the info value as a vbr5 if needed.
54
55 // UNABBREV_RECORDs are emitted with a vbr6 for the record code, followed by
56 // a vbr6 for the # operands, followed by vbr6's for each operand.
58
59 // This is not a code, this is a marker for the first abbrev assignment.
61};
62
63/// StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO
64/// block, which contains metadata about other blocks in the file.
66 /// BLOCKINFO_BLOCK is used to define metadata about blocks, for example,
67 /// standard abbrevs that should be available to all blocks of a specified
68 /// ID.
70
71 // Block IDs 1-7 are reserved for future expansion.
73};
74
75/// BlockInfoCodes - The blockinfo block contains metadata about user-defined
76/// blocks.
78 // DEFINE_ABBREV has magic semantics here, applying to the current SETBID'd
79 // block, instead of the BlockInfo block.
80
81 BLOCKINFO_CODE_SETBID = 1, // SETBID: [blockid#]
82 BLOCKINFO_CODE_BLOCKNAME = 2, // BLOCKNAME: [name]
83 BLOCKINFO_CODE_SETRECORDNAME = 3 // BLOCKINFO_CODE_SETRECORDNAME:
84 // [id, name]
85};
86
87} // namespace bitc
88} // namespace llvm
89
90#endif
BlockInfoCodes
BlockInfoCodes - The blockinfo block contains metadata about user-defined blocks.
Definition: BitCodeEnums.h:77
@ BLOCKINFO_CODE_BLOCKNAME
Definition: BitCodeEnums.h:82
@ BLOCKINFO_CODE_SETRECORDNAME
Definition: BitCodeEnums.h:83
@ BLOCKINFO_CODE_SETBID
Definition: BitCodeEnums.h:81
StandardBlockIDs
StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO block, which contains metadat...
Definition: BitCodeEnums.h:65
@ BLOCKINFO_BLOCK_ID
BLOCKINFO_BLOCK is used to define metadata about blocks, for example, standard abbrevs that should be...
Definition: BitCodeEnums.h:69
@ FIRST_APPLICATION_BLOCKID
Definition: BitCodeEnums.h:72
@ DEFINE_ABBREV
DEFINE_ABBREV - Defines an abbrev for the current block.
Definition: BitCodeEnums.h:53
@ FIRST_APPLICATION_ABBREV
Definition: BitCodeEnums.h:60
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
BitstreamWrapperHeader
Offsets of the 32-bit fields of bitstream wrapper header.
Definition: BitCodeEnums.h:26
@ BWH_OffsetField
Definition: BitCodeEnums.h:29
@ BWH_VersionField
Definition: BitCodeEnums.h:28
@ BWH_MagicField
Definition: BitCodeEnums.h:27
@ BWH_HeaderSize
Definition: BitCodeEnums.h:32
@ BWH_CPUTypeField
Definition: BitCodeEnums.h:31
@ BWH_SizeField
Definition: BitCodeEnums.h:30