Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.

llvm-svn: 37204
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.h b/llvm/lib/Bitcode/Reader/BitcodeReader.h
index 3e0f807..2f61b06 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.h
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.h
@@ -39,6 +39,10 @@
     ++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 @@
   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 @@
   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;