• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- NaClBitcodeDefs.h ----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Defines some common types/constants used by bitcode readers and
11 // writers. It is intended to make clear assumptions made in
12 // representing bitcode files.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_BITCODE_NACL_NACLBITCODEDEFS_H
17 #define LLVM_BITCODE_NACL_NACLBITCODEDEFS_H
18 
19 namespace llvm {
20 
21 namespace naclbitc {
22 
23 // Special record codes used to model codes for predefined records.
24 // They are very large so that they do not conflict with existing
25 // record codes for user-defined blocks.
26 enum SpecialBlockCodes {
27   BLK_CODE_ENTER = 65535,
28   BLK_CODE_EXIT  = 65534,
29   BLK_CODE_DEFINE_ABBREV = 65533,
30   BLK_CODE_HEADER = 65532
31 };
32 
33 } // end of namespace naclbitc
34 
35 /// Defines type for value indicies in bitcode. Like a size_t, but
36 /// fixed across platforms.
37 typedef uint32_t NaClBcIndexSize_t;
38 
39 /// Signed version of NaClBcIndexSize_t. Used to define relative indices.
40 typedef int32_t NaClRelBcIndexSize_t;
41 
42 /// Defines maximum allowed bitcode index in bitcode files.
43 static const size_t NaClBcIndexSize_t_Max =
44     std::numeric_limits<NaClBcIndexSize_t>::max();
45 
46 /// Defines the maximum number of initializers allowed, based on ILP32.
47 static const size_t MaxNaClGlobalVarInits =
48     std::numeric_limits<uint32_t>::max();
49 
50 } // end of namespace llvm
51 
52 
53 #endif // LLVM_BITCODE_NACL_NACLBITCODEDEFS_H
54