diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-25 18:07:36 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-25 18:07:36 +0000 |
commit | ad89bd6a1a74d3d3223d9eb23e16f10c02f836fa (patch) | |
tree | a8ec89130546e3cc17246b1c143eb9143d8a1b02 /lib/Bytecode/Reader/Reader.h | |
parent | 0be13e7f1468ba101188a5e1b1f1a20a676b3569 (diff) |
bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
in multiples of 64KByte chunks rather than in multiples of some smaller
(default) number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.h')
-rw-r--r-- | lib/Bytecode/Reader/Reader.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Reader.h b/lib/Bytecode/Reader/Reader.h index 9120377130..c93958419c 100644 --- a/lib/Bytecode/Reader/Reader.h +++ b/lib/Bytecode/Reader/Reader.h @@ -56,6 +56,7 @@ public: /// @name Types /// @{ public: + /// @brief A convenience type for the buffer pointer typedef const unsigned char* BufPtr; @@ -268,6 +269,36 @@ private: /// from Value style of bytecode file is being read. bool hasTypeDerivedFromValue; + /// LLVM 1.2 and earlier encoded block headers as two uint (8 bytes), one for + /// the size and one for the type. This is a bit wasteful, especially for small + /// files where the 8 bytes per block is a large fraction of the total block + /// size. In LLVM 1.3, the block type and length are encoded into a single + /// uint32 by restricting the number of block types (limit 31) and the maximum + /// size of a block (limit 2^27-1=134,217,727). Note that the module block + /// still uses the 8-byte format so the maximum size of a file can be + /// 2^32-1 bytes long. + bool hasLongBlockHeaders; + + /// LLVM 1.2 and earlier wrote floating point values in a platform specific + /// bit ordering. This was fixed in LLVM 1.3 + bool hasPlatformSpecificFloatingPoint; + + /// LLVM 1.2 and earlier wrote type slot numbers as vbr_uint32. In LLVM 1.3 + /// this has been reduced to vbr_uint24. It shouldn't make much difference + /// since we haven't run into a module with > 24 million types, but for safety + /// the 24-bit restriction has been enforced in 1.3 to free some bits in + /// various places and to ensure consistency. In particular, global vars are + /// restricted to 24-bits. + bool has32BitTypes; + + /// LLVM 1.2 and earlier did not provide a target triple nor a list of + /// libraries on which the bytecode is dependent. LLVM 1.3 provides these + /// features, for use in future versions of LLVM. + bool hasNoDependentLibraries; + + /// LLVM 1.2 and earlier encoded the file version as part of the module block + /// but this information may be needed to + /// CompactionTable - If a compaction table is active in the current function, /// this is the mapping that it contains. std::vector<const Type*> CompactionTypes; @@ -430,6 +461,10 @@ private: /// @brief Read an unsigned integer with variable bit rate encoding inline unsigned read_vbr_uint(); + /// @brief Read an unsigned integer of no more than 24-bits with variable + /// bit rate encoding. + inline unsigned read_vbr_uint24(); + /// @brief Read an unsigned 64-bit integer with variable bit rate encoding. inline uint64_t read_vbr_uint64(); |