void ParseBytecode(
const unsigned char *Buf, ///< Beginning of the bytecode buffer
unsigned Length, ///< Length of the bytecode buffer
- const std::string &ModuleID, ///< An identifier for the module constructed.
- bool processFunctions=false ///< Process all function bodies fully.
+ const std::string &ModuleID ///< An identifier for the module constructed.
);
/// @brief Parse all function bodies
/// 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
+ /// LLVM 1.3 and earlier caused blocks and other fields to start on 32-bit
+ /// aligned boundaries. This can lead to as much as 30% bytecode size overhead
+ /// in various corner cases (lots of long instructions). In LLVM 1.4,
+ /// alignment of bytecode fields was done away with completely.
+ bool hasAlignment;
+
+ // In version 4, basic blocks have a minimum index of 0 whereas all the
+ // other primitives have a minimum index of 1 (because 0 is the "null"
+ // value. In version 5, we made this consistent.
+ bool hasInconsistentBBSlotNums;
+
+ // In version 4, the types SByte and UByte were encoded as vbr_uint so that
+ // signed values > 63 and unsigned values >127 would be encoded as two
+ // bytes. In version 5, they are encoded directly in a single byte.
+ bool hasVBRByteTypes;
+
+ // In version 4, modules begin with a "Module Block" which encodes a 4-byte
+ // integer value 0x01 to identify the module block. This is unnecessary and
+ // removed in version 5.
+ bool hasUnnecessaryModuleBlockId;
/// CompactionTypes - If a compaction table is active in the current function,
/// this is the mapping that it contains. We keep track of what resolved type
/// @brief Get a value from its typeid and slot number
Value* getValue(unsigned TypeID, unsigned num, bool Create = true);
- /// @brief Get a value from its type and slot number, ignoring compaction tables.
- Value *getGlobalTableValue(const Type *Ty, unsigned SlotNo);
+ /// @brief Get a value from its type and slot number, ignoring compaction
+ /// tables.
+ Value *getGlobalTableValue(unsigned TyID, unsigned SlotNo);
/// @brief Get a basic block for current function
BasicBlock *getBasicBlock(unsigned ID);
/// @brief A function for creating a BytecodeAnalzer as a handler
/// for the Bytecode reader.
-BytecodeHandler* createBytecodeAnalyzerHandler(BytecodeAnalysis& bca );
+BytecodeHandler* createBytecodeAnalyzerHandler(BytecodeAnalysis& bca,
+ std::ostream* output );
} // End llvm namespace