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
This commit is contained in:
Chris Lattner
2007-05-18 04:02:46 +00:00
parent e829e92edc
commit b348bb8125
2 changed files with 91 additions and 54 deletions

View File

@@ -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;