OLD | NEW |
---|---|
1 //===- NaClBitCodes.h - Enum values for the bitcode format ------*- C++ -*-===// | 1 //===- NaClBitCodes.h - Enum values for the bitcode format ------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This header Bitcode enum values. | 10 // This header Bitcode enum values. |
11 // | 11 // |
12 // The enum values defined in this file should be considered permanent. If | 12 // The enum values defined in this file should be considered permanent. If |
13 // new features are added, they should have values added at the end of the | 13 // new features are added, they should have values added at the end of the |
14 // respective lists. | 14 // respective lists. |
15 // | 15 // |
16 //===----------------------------------------------------------------------===// | 16 //===----------------------------------------------------------------------===// |
17 | 17 |
18 #ifndef LLVM_BITCODE_NACL_NACLBITCODES_H | 18 #ifndef LLVM_BITCODE_NACL_NACLBITCODES_H |
19 #define LLVM_BITCODE_NACL_NACLBITCODES_H | 19 #define LLVM_BITCODE_NACL_NACLBITCODES_H |
20 | 20 |
21 #include "llvm/ADT/SmallVector.h" | 21 #include "llvm/ADT/SmallVector.h" |
22 #include "llvm/Support/DataTypes.h" | 22 #include "llvm/Support/DataTypes.h" |
23 #include "llvm/Support/ErrorHandling.h" | 23 #include "llvm/Support/ErrorHandling.h" |
24 #include "llvm/Support/MathExtras.h" | 24 #include "llvm/Support/MathExtras.h" |
25 #include <climits> | |
Jim Stichnoth
2016/03/14 22:46:49
Should includes be sorted?
Karl
2016/03/15 20:29:41
This code was (originally) copied from LLVM, and i
| |
25 #include <cassert> | 26 #include <cassert> |
26 | 27 |
27 namespace llvm { | 28 namespace llvm { |
28 class raw_ostream; | 29 class raw_ostream; |
29 | 30 |
30 namespace naclbitc { | 31 namespace naclbitc { |
31 enum StandardWidths { | 32 enum StandardWidths { |
32 BlockIDWidth = 8, // We use VBR-8 for block IDs. | 33 BlockIDWidth = 8, // We use VBR-8 for block IDs. |
33 CodeLenWidth = 4, // Codelen are VBR-4. | 34 CodeLenWidth = 4, // Codelen are VBR-4. |
34 BlockSizeWidth = 32, // BlockSize up to 2^32 32-bit words = 16GB per block. | 35 BlockSizeWidth = 32, // BlockSize up to 2^32 32-bit words = 16GB per block. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 | 75 |
75 /// StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO | 76 /// StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO |
76 /// block, which contains metadata about other blocks in the file. | 77 /// block, which contains metadata about other blocks in the file. |
77 enum StandardBlockIDs { | 78 enum StandardBlockIDs { |
78 /// BLOCKINFO_BLOCK is used to define metadata about blocks, for example, | 79 /// BLOCKINFO_BLOCK is used to define metadata about blocks, for example, |
79 /// standard abbrevs that should be available to all blocks of a specified | 80 /// standard abbrevs that should be available to all blocks of a specified |
80 /// ID. | 81 /// ID. |
81 BLOCKINFO_BLOCK_ID = 0, | 82 BLOCKINFO_BLOCK_ID = 0, |
82 | 83 |
83 // Block IDs 1-7 are reserved for future expansion. | 84 // Block IDs 1-7 are reserved for future expansion. |
84 FIRST_APPLICATION_BLOCKID = 8 | 85 FIRST_APPLICATION_BLOCKID = 8, |
86 // Dummy block added around all records in a bitcode file. Allows the code | |
87 // to treat top-level records like all other records (i.e. all records | |
88 // appear in a block). | |
89 TOP_LEVEL_BLOCKID = UINT_MAX | |
Derek Schuff
2016/03/15 17:47:04
Does it matter that this block will be considered
Karl
2016/03/15 20:29:41
Yes, you are right. It does raise TOP_LEVEL_BLOCKI
| |
85 }; | 90 }; |
86 | 91 |
87 /// BlockInfoCodes - The blockinfo block contains metadata about user-defined | 92 /// BlockInfoCodes - The blockinfo block contains metadata about user-defined |
88 /// blocks. | 93 /// blocks. |
89 enum BlockInfoCodes { | 94 enum BlockInfoCodes { |
90 // DEFINE_ABBREV has magic semantics here, applying to the current SETBID'd | 95 // DEFINE_ABBREV has magic semantics here, applying to the current SETBID'd |
91 // block, instead of the BlockInfo block. | 96 // block, instead of the BlockInfo block. |
92 | 97 |
93 BLOCKINFO_CODE_SETBID = 1, // SETBID: [blockid#] | 98 BLOCKINFO_CODE_SETBID = 1, // SETBID: [blockid#] |
94 // The following two codes were removed | 99 // The following two codes were removed |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 | 405 |
401 // Creates a selector range to handle fixed abbrevations up to | 406 // Creates a selector range to handle fixed abbrevations up to |
402 // the specified value. | 407 // the specified value. |
403 explicit NaClBitcodeSelectorAbbrev(unsigned MaxAbbrev) | 408 explicit NaClBitcodeSelectorAbbrev(unsigned MaxAbbrev) |
404 : IsFixed(true), | 409 : IsFixed(true), |
405 NumBits(NaClBitsNeededForValue(MaxAbbrev)) {} | 410 NumBits(NaClBitsNeededForValue(MaxAbbrev)) {} |
406 }; | 411 }; |
407 } // End llvm namespace | 412 } // End llvm namespace |
408 | 413 |
409 #endif | 414 #endif |
OLD | NEW |