aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-12 07:05:14 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-12 07:05:14 +0000
commita54b7cbd452b3adb2f51346140d996b29c2cdb30 (patch)
tree00514e24a3fab3804f1a99557ebd343382d0dc27 /lib/Bytecode/Reader/Reader.h
parented3098989580ecaee7fc89de548afb4c811bea31 (diff)
For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 16, 32, and 64 bit integers. This change does several things: 1. Introduces a new Derived Type, IntegerType, to represent the number of bits in an integer. The Type classes SubclassData field is used to store the number of bits. This allows 2^23 bits in an integer type. 2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and 64-bit integers. These are replaced with just IntegerType which is not a primitive any more. 3. Adjust the rest of LLVM to account for this change. Note that while this incremental change lays the foundation for arbitrary bit-width integers, LLVM has not yet been converted to actually deal with them in any significant way. Most optimization passes, for example, will still only deal with the byte-width integer types. Future increments will rectify this situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.h')
-rw-r--r--lib/Bytecode/Reader/Reader.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Reader.h b/lib/Bytecode/Reader/Reader.h
index 677c39f99f..3e64f2d027 100644
--- a/lib/Bytecode/Reader/Reader.h
+++ b/lib/Bytecode/Reader/Reader.h
@@ -415,6 +415,20 @@ private:
BytecodeReader(const BytecodeReader &); // DO NOT IMPLEMENT
void operator=(const BytecodeReader &); // DO NOT IMPLEMENT
+ // This enum provides the values of the well-known type slots that are always
+ // emitted as the first few types in the table by the BytecodeWriter class.
+ enum WellKnownTypeSlots {
+ VoidTypeSlot = 0, ///< TypeID == VoidTyID
+ FloatTySlot = 1, ///< TypeID == FloatTyID
+ DoubleTySlot = 2, ///< TypeID == DoubleTyID
+ LabelTySlot = 3, ///< TypeID == LabelTyID
+ BoolTySlot = 4, ///< TypeID == IntegerTyID, width = 1
+ Int8TySlot = 5, ///< TypeID == IntegerTyID, width = 8
+ Int16TySlot = 6, ///< TypeID == IntegerTyID, width = 16
+ Int32TySlot = 7, ///< TypeID == IntegerTyID, width = 32
+ Int64TySlot = 8 ///< TypeID == IntegerTyID, width = 64
+ };
+
/// @}
/// @name Reader Primitives
/// @{