++NumOperands;
}
+ void clear() {
+ std::vector<Use>().swap(Uses);
+ }
+
Value *operator[](unsigned i) const { return getOperand(i); }
Value *back() const { return Uses.back(); }
// When reading the module header, this list is populated with functions that
// have bodies later in the file.
std::vector<Function*> FunctionsWithBodies;
+
+ // When intrinsic functions are encountered which require upgrading they are
+ // stored here with their replacement function.
+ typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap;
+ UpgradedIntrinsicMap UpgradedIntrinsics;
// After the module header has been read, the FunctionsWithBodies list is
// reversed. This keeps track of whether we've done this yet.
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
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;