diff options
author | Chris Lattner <sabre@nondot.org> | 2007-05-18 04:02:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-05-18 04:02:46 +0000 |
commit | b348bb81253a1105d23ab1a1771f8d2a6546aa1b (patch) | |
tree | 7756d93356676e19d840c9ea89c5e3b59a1bac78 /lib/Bitcode/Reader/BitcodeReader.h | |
parent | e829e92edcc763ad527ab6d95bd6cb5610f38133 (diff) |
Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h index 3e0f807d9d..2f61b06c60 100644 --- a/lib/Bitcode/Reader/BitcodeReader.h +++ b/lib/Bitcode/Reader/BitcodeReader.h @@ -39,6 +39,10 @@ public: ++NumOperands; } + void clear() { + std::vector<Use>().swap(Uses); + } + Value *operator[](unsigned i) const { return getOperand(i); } Value *back() const { return Uses.back(); } @@ -111,8 +115,11 @@ public: BitcodeReader(MemoryBuffer *buffer) : Buffer(buffer), ErrorString(0) { HasReversedFunctionsWithBodies = false; } - ~BitcodeReader(); + ~BitcodeReader() { + FreeState(); + } + void FreeState(); /// releaseMemoryBuffer - This causes the reader to completely forget about /// the memory buffer it contains, which prevents the buffer from being @@ -124,6 +131,7 @@ public: virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0); virtual Module *materializeModule(std::string *ErrInfo = 0); virtual void dematerializeFunction(Function *F); + virtual Module *releaseModule(std::string *ErrInfo = 0); bool Error(const char *Str) { ErrorString = Str; |