Add support for compressed bytecode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-11-06 23:17:23 +00:00
parent 2334e6d908
commit 17f52c5c46
5 changed files with 138 additions and 27 deletions

View File

@@ -47,10 +47,14 @@ public:
BytecodeReader(
BytecodeHandler* h = 0
) {
Handler = h;
Handler = h;
}
~BytecodeReader() { freeState(); }
~BytecodeReader() {
freeState();
if (bi.buff != 0)
::free(bi.buff);
}
/// @}
/// @name Types
@@ -63,6 +67,13 @@ public:
/// @brief The type used for a vector of potentially abstract types
typedef std::vector<PATypeHolder> TypeListTy;
/// @brief An internal buffer object used for handling decompression
struct BufferInfo {
char* buff;
unsigned size;
BufferInfo() { buff = 0; size = 0; }
};
/// This type provides a vector of Value* via the User class for
/// storage of Values that have been constructed when reading the
/// bytecode. Because of forward referencing, constant replacement
@@ -235,6 +246,8 @@ protected:
/// @name Data
/// @{
private:
BufferInfo bi; ///< Buffer info for decompression
BufPtr MemStart; ///< Start of the memory buffer
BufPtr MemEnd; ///< End of the memory buffer
BufPtr BlockStart; ///< Start of current block being parsed