There is no need for BytecodeParser to be an AbstractTypeUser. Instead, it

can just use PATypeHolders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8832 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-10-02 20:26:18 +00:00
parent 3200219843
commit c7b6f03501
2 changed files with 3 additions and 28 deletions

View File

@ -94,25 +94,6 @@ const Type *BytecodeParser::parseTypeConstant(const unsigned char *&Buf,
} }
} }
// refineAbstractType - The callback method is invoked when one of the
// elements of TypeValues becomes more concrete...
//
void BytecodeParser::refineAbstractType(const DerivedType *OldType,
const Type *NewType) {
TypeValuesListTy::iterator I = find(FunctionTypeValues.begin(),
FunctionTypeValues.end(), OldType);
if (I == FunctionTypeValues.end()) {
I = find(ModuleTypeValues.begin(), ModuleTypeValues.end(), OldType);
assert(I != ModuleTypeValues.end() &&
"Can't refine a type I don't know about!");
}
I->removeUserFromConcrete();
*I = NewType; // Update to point to new, more refined type.
}
// parseTypeConstants - We have to use this weird code to handle recursive // parseTypeConstants - We have to use this weird code to handle recursive
// types. We know that recursive types will only reference the current slab of // types. We know that recursive types will only reference the current slab of
// values in the type plane, but they can forward reference types before they // values in the type plane, but they can forward reference types before they
@ -132,7 +113,7 @@ void BytecodeParser::parseTypeConstants(const unsigned char *&Buf,
// Insert a bunch of opaque types to be resolved later... // Insert a bunch of opaque types to be resolved later...
for (unsigned i = 0; i < NumEntries; ++i) for (unsigned i = 0; i < NumEntries; ++i)
Tab.push_back(PATypeHandle(OpaqueType::get(), this)); Tab.push_back(OpaqueType::get());
// Loop through reading all of the types. Forward types will make use of the // Loop through reading all of the types. Forward types will make use of the
// opaque types just inserted. // opaque types just inserted.

View File

@ -43,7 +43,7 @@ struct LazyFunctionInfo {
unsigned FunctionSlot; unsigned FunctionSlot;
}; };
class BytecodeParser : public AbstractTypeUser, public AbstractModuleProvider { class BytecodeParser : public AbstractModuleProvider {
BytecodeParser(const BytecodeParser &); // DO NOT IMPLEMENT BytecodeParser(const BytecodeParser &); // DO NOT IMPLEMENT
void operator=(const BytecodeParser &); // DO NOT IMPLEMENT void operator=(const BytecodeParser &); // DO NOT IMPLEMENT
public: public:
@ -116,7 +116,7 @@ private: // All of this data is transient across calls to ParseBytecode
// TypesLoaded - This vector mirrors the Values[TypeTyID] plane. It is used // TypesLoaded - This vector mirrors the Values[TypeTyID] plane. It is used
// to deal with forward references to types. // to deal with forward references to types.
// //
typedef std::vector<PATypeHandle> TypeValuesListTy; typedef std::vector<PATypeHolder> TypeValuesListTy;
TypeValuesListTy ModuleTypeValues; TypeValuesListTy ModuleTypeValues;
TypeValuesListTy FunctionTypeValues; TypeValuesListTy FunctionTypeValues;
@ -189,12 +189,6 @@ private:
// resolve all references to the placeholder (if any) for the given value // resolve all references to the placeholder (if any) for the given value
void ResolveReferencesToValue(Value *Val, unsigned Slot); void ResolveReferencesToValue(Value *Val, unsigned Slot);
// refineAbstractType - The callback method is invoked when one of the
// elements of TypeValues becomes more concrete...
//
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
}; };
template<class SuperType> template<class SuperType>