aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-14 22:00:09 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-14 22:00:09 +0000
commitd3539b8a5ef399114e8187a839f0b49225abc002 (patch)
tree9701f331d86a810d7f19f60437ecec1fe608709d /lib/Bytecode
parent61aaf2e0afe8b119094faf67912f0446a7c7d71e (diff)
Simplify handling of decompression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/Reader.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/Bytecode/Reader/Reader.h b/lib/Bytecode/Reader/Reader.h
index 72a6040366..c78faf625f 100644
--- a/lib/Bytecode/Reader/Reader.h
+++ b/lib/Bytecode/Reader/Reader.h
@@ -47,13 +47,14 @@ public:
BytecodeReader(
BytecodeHandler* h = 0
) {
+ decompressedBlock = 0;
Handler = h;
}
~BytecodeReader() {
freeState();
- if (bi.buff != 0)
- ::free(bi.buff);
+ if (decompressedBlock)
+ ::free(decompressedBlock);
}
/// @}
@@ -67,18 +68,6 @@ public:
/// @brief The type used for a vector of potentially abstract types
typedef std::vector<PATypeHolder> TypeListTy;
- /// This structure is only used when a bytecode file is compressed.
- /// As bytecode is being decompressed, the memory buffer might need
- /// to be reallocated. The buffer allocation is handled in a callback
- /// and this structure is needed to retain information across calls
- /// to the callback.
- /// @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
@@ -251,7 +240,7 @@ protected:
/// @name Data
/// @{
private:
- BufferInfo bi; ///< Buffer info for decompression
+ char* decompressedBlock; ///< Result of decompression
BufPtr MemStart; ///< Start of the memory buffer
BufPtr MemEnd; ///< End of the memory buffer
BufPtr BlockStart; ///< Start of current block being parsed