mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-11 07:18:44 +00:00
Check in a bunch of minor fixes, plus a whole lot of #if 0'd out code, which will hopefully be enabled in the near future
This does not make any functionality changes llvm-svn: 8355
This commit is contained in:
parent
849c3fbdcc
commit
d62bda202e
@ -1,4 +1,4 @@
|
|||||||
//===-- Type.cpp - Implement the Type class ----------------------*- C++ -*--=//
|
//===-- Type.cpp - Implement the Type class -------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements the Type class for the VMCore library.
|
// This file implements the Type class for the VMCore library.
|
||||||
//
|
//
|
||||||
@ -451,7 +451,7 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2,
|
|||||||
|
|
||||||
// Two really annoying special cases that breaks an otherwise nice simple
|
// Two really annoying special cases that breaks an otherwise nice simple
|
||||||
// algorithm is the fact that arraytypes have sizes that differentiates types,
|
// algorithm is the fact that arraytypes have sizes that differentiates types,
|
||||||
// and that method types can be varargs or not. Consider this now.
|
// and that function types can be varargs or not. Consider this now.
|
||||||
if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
|
if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
|
||||||
if (ATy->getNumElements() != cast<ArrayType>(Ty2)->getNumElements())
|
if (ATy->getNumElements() != cast<ArrayType>(Ty2)->getNumElements())
|
||||||
return false;
|
return false;
|
||||||
@ -483,13 +483,12 @@ class TypeMap : public AbstractTypeUser {
|
|||||||
typedef std::map<ValType, PATypeHandle> MapTy;
|
typedef std::map<ValType, PATypeHandle> MapTy;
|
||||||
MapTy Map;
|
MapTy Map;
|
||||||
public:
|
public:
|
||||||
|
typedef typename MapTy::iterator iterator;
|
||||||
~TypeMap() { print("ON EXIT"); }
|
~TypeMap() { print("ON EXIT"); }
|
||||||
|
|
||||||
inline TypeClass *get(const ValType &V) {
|
inline TypeClass *get(const ValType &V) {
|
||||||
typename std::map<ValType, PATypeHandle>::iterator I
|
iterator I = Map.find(V);
|
||||||
= Map.find(V);
|
return I != Map.end() ? (TypeClass*)I->second.get() : 0;
|
||||||
// TODO: FIXME: When Types are not CONST.
|
|
||||||
return (I != Map.end()) ? (TypeClass*)I->second.get() : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void add(const ValType &V, TypeClass *T) {
|
inline void add(const ValType &V, TypeClass *T) {
|
||||||
@ -497,13 +496,26 @@ public:
|
|||||||
print("add");
|
print("add");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iterator getEntryForType(TypeClass *Ty) {
|
||||||
|
iterator I = Map.find(ValType::get(Ty));
|
||||||
|
if (I == Map.end()) print("ERROR!");
|
||||||
|
assert(I != Map.end() && "Didn't find type entry!");
|
||||||
|
return I;
|
||||||
|
}
|
||||||
|
|
||||||
// containsEquivalent - Return true if the typemap contains a type that is
|
// containsEquivalent - Return true if the typemap contains a type that is
|
||||||
// structurally equivalent to the specified type.
|
// structurally equivalent to the specified type.
|
||||||
//
|
//
|
||||||
inline const TypeClass *containsEquivalent(const TypeClass *Ty) {
|
inline TypeClass *containsEquivalent(TypeClass *Ty) { //iterator TyIt) {
|
||||||
for (typename MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
//const TypeClass *Ty = (const TypeClass*)TyIt->second.get();
|
||||||
if (I->second.get() != Ty && TypesEqual(Ty, I->second.get()))
|
for (iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
||||||
return (TypeClass*)I->second.get();
|
if (I->second.get() != Ty && TypesEqual(Ty, I->second.get())) {
|
||||||
|
TypeClass *New = (TypeClass*)I->second.get();
|
||||||
|
#if 0
|
||||||
|
Map.erase(TyIt); // The old entry is now dead!
|
||||||
|
#endif
|
||||||
|
return New;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,8 +530,8 @@ public:
|
|||||||
<< *OldTy << " replacement == " << (void*)NewTy
|
<< *OldTy << " replacement == " << (void*)NewTy
|
||||||
<< ", " << *NewTy << "\n";
|
<< ", " << *NewTy << "\n";
|
||||||
#endif
|
#endif
|
||||||
for (typename MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
for (iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
||||||
if (I->second == OldTy) {
|
if (I->second.get() == OldTy) {
|
||||||
// Check to see if the type just became concrete. If so, remove self
|
// Check to see if the type just became concrete. If so, remove self
|
||||||
// from user list.
|
// from user list.
|
||||||
I->second.removeUserFromConcrete();
|
I->second.removeUserFromConcrete();
|
||||||
@ -528,18 +540,24 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void remove(const ValType &OldVal) {
|
void remove(const ValType &OldVal) {
|
||||||
typename MapTy::iterator I = Map.find(OldVal);
|
iterator I = Map.find(OldVal);
|
||||||
assert(I != Map.end() && "TypeMap::remove, element not found!");
|
assert(I != Map.end() && "TypeMap::remove, element not found!");
|
||||||
Map.erase(I);
|
Map.erase(I);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void remove(iterator I) {
|
||||||
|
assert(I != Map.end() && "Cannot remove invalid iterator pointer!");
|
||||||
|
Map.erase(I);
|
||||||
|
}
|
||||||
|
|
||||||
void print(const char *Arg) const {
|
void print(const char *Arg) const {
|
||||||
#ifdef DEBUG_MERGE_TYPES
|
#ifdef DEBUG_MERGE_TYPES
|
||||||
std::cerr << "TypeMap<>::" << Arg << " table contents:\n";
|
std::cerr << "TypeMap<>::" << Arg << " table contents:\n";
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
for (MapTy::const_iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
for (typename MapTy::const_iterator I = Map.begin(), E = Map.end();
|
||||||
std::cerr << " " << (++i) << ". " << I->second << " "
|
I != E; ++I)
|
||||||
<< *I->second << "\n";
|
std::cerr << " " << (++i) << ". " << (void*)I->second.get() << " "
|
||||||
|
<< *I->second.get() << "\n";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,6 +640,8 @@ public:
|
|||||||
ArgTypes.push_back(PATypeHandle(MVT.ArgTypes[i], this));
|
ArgTypes.push_back(PATypeHandle(MVT.ArgTypes[i], this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static FunctionValType get(const FunctionType *FT);
|
||||||
|
|
||||||
// Subclass should override this... to update self as usual
|
// Subclass should override this... to update self as usual
|
||||||
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
||||||
if (RetTy == OldType) RetTy = NewType;
|
if (RetTy == OldType) RetTy = NewType;
|
||||||
@ -648,6 +668,17 @@ public:
|
|||||||
// Define the actual map itself now...
|
// Define the actual map itself now...
|
||||||
static TypeMap<FunctionValType, FunctionType> FunctionTypes;
|
static TypeMap<FunctionValType, FunctionType> FunctionTypes;
|
||||||
|
|
||||||
|
FunctionValType FunctionValType::get(const FunctionType *FT) {
|
||||||
|
// Build up a FunctionValType
|
||||||
|
std::vector<const Type *> ParamTypes;
|
||||||
|
ParamTypes.reserve(FT->getParamTypes().size());
|
||||||
|
for (unsigned i = 0, e = FT->getParamTypes().size(); i != e; ++i)
|
||||||
|
ParamTypes.push_back(FT->getParamType(i));
|
||||||
|
return FunctionValType(FT->getReturnType(), ParamTypes, FT->isVarArg(),
|
||||||
|
FunctionTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// FunctionType::get - The factory function for the FunctionType class...
|
// FunctionType::get - The factory function for the FunctionType class...
|
||||||
FunctionType *FunctionType::get(const Type *ReturnType,
|
FunctionType *FunctionType::get(const Type *ReturnType,
|
||||||
const std::vector<const Type*> &Params,
|
const std::vector<const Type*> &Params,
|
||||||
@ -664,6 +695,17 @@ FunctionType *FunctionType::get(const Type *ReturnType,
|
|||||||
return MT;
|
return MT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FunctionType::dropAllTypeUses(bool inMap) {
|
||||||
|
#if 0
|
||||||
|
//if (inMap) FunctionTypes.remove(FunctionTypes.getEntryForType(this));
|
||||||
|
|
||||||
|
// Drop all uses of other types, which might be recursive.
|
||||||
|
ResultType = Type::VoidTy;
|
||||||
|
ParamTys.clear();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Array Type Factory...
|
// Array Type Factory...
|
||||||
//
|
//
|
||||||
@ -681,6 +723,9 @@ public:
|
|||||||
: ValTypeBase<ArrayValType, ArrayType>(AVT), ValTy(AVT.ValTy, this),
|
: ValTypeBase<ArrayValType, ArrayType>(AVT), ValTy(AVT.ValTy, this),
|
||||||
Size(AVT.Size) {}
|
Size(AVT.Size) {}
|
||||||
|
|
||||||
|
static ArrayValType get(const ArrayType *AT);
|
||||||
|
|
||||||
|
|
||||||
// Subclass should override this... to update self as usual
|
// Subclass should override this... to update self as usual
|
||||||
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
||||||
assert(ValTy == OldType);
|
assert(ValTy == OldType);
|
||||||
@ -701,6 +746,11 @@ public:
|
|||||||
|
|
||||||
static TypeMap<ArrayValType, ArrayType> ArrayTypes;
|
static TypeMap<ArrayValType, ArrayType> ArrayTypes;
|
||||||
|
|
||||||
|
ArrayValType ArrayValType::get(const ArrayType *AT) {
|
||||||
|
return ArrayValType(AT->getElementType(), AT->getNumElements(), ArrayTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) {
|
ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) {
|
||||||
assert(ElementType && "Can't get array of null types!");
|
assert(ElementType && "Can't get array of null types!");
|
||||||
|
|
||||||
@ -717,6 +767,16 @@ ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) {
|
|||||||
return AT;
|
return AT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ArrayType::dropAllTypeUses(bool inMap) {
|
||||||
|
#if 0
|
||||||
|
//if (inMap) ArrayTypes.remove(ArrayTypes.getEntryForType(this));
|
||||||
|
ElementType = Type::IntTy;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Struct Type Factory...
|
// Struct Type Factory...
|
||||||
//
|
//
|
||||||
@ -744,6 +804,8 @@ public:
|
|||||||
ElTypes.push_back(PATypeHandle(SVT.ElTypes[i], this));
|
ElTypes.push_back(PATypeHandle(SVT.ElTypes[i], this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static StructValType get(const StructType *ST);
|
||||||
|
|
||||||
// Subclass should override this... to update self as usual
|
// Subclass should override this... to update self as usual
|
||||||
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
||||||
for (unsigned i = 0; i < ElTypes.size(); ++i)
|
for (unsigned i = 0; i < ElTypes.size(); ++i)
|
||||||
@ -763,6 +825,17 @@ public:
|
|||||||
|
|
||||||
static TypeMap<StructValType, StructType> StructTypes;
|
static TypeMap<StructValType, StructType> StructTypes;
|
||||||
|
|
||||||
|
StructValType StructValType::get(const StructType *ST) {
|
||||||
|
std::vector<const Type *> ElTypes;
|
||||||
|
ElTypes.reserve(ST->getElementTypes().size());
|
||||||
|
for (unsigned i = 0, e = ST->getElementTypes().size(); i != e; ++i)
|
||||||
|
ElTypes.push_back(ST->getElementTypes()[i]);
|
||||||
|
|
||||||
|
return StructValType(ElTypes, StructTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
StructType *StructType::get(const std::vector<const Type*> &ETypes) {
|
StructType *StructType::get(const std::vector<const Type*> &ETypes) {
|
||||||
StructValType STV(ETypes, StructTypes);
|
StructValType STV(ETypes, StructTypes);
|
||||||
StructType *ST = StructTypes.get(STV);
|
StructType *ST = StructTypes.get(STV);
|
||||||
@ -777,6 +850,15 @@ StructType *StructType::get(const std::vector<const Type*> &ETypes) {
|
|||||||
return ST;
|
return ST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StructType::dropAllTypeUses(bool inMap) {
|
||||||
|
#if 0
|
||||||
|
//if (inMap) StructTypes.remove(StructTypes.getEntryForType(this));
|
||||||
|
ETypes.clear();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Pointer Type Factory...
|
// Pointer Type Factory...
|
||||||
//
|
//
|
||||||
@ -795,6 +877,8 @@ public:
|
|||||||
PointerValType(const PointerValType &PVT)
|
PointerValType(const PointerValType &PVT)
|
||||||
: ValTypeBase<PointerValType, PointerType>(PVT), ValTy(PVT.ValTy, this) {}
|
: ValTypeBase<PointerValType, PointerType>(PVT), ValTy(PVT.ValTy, this) {}
|
||||||
|
|
||||||
|
static PointerValType get(const PointerType *PT);
|
||||||
|
|
||||||
// Subclass should override this... to update self as usual
|
// Subclass should override this... to update self as usual
|
||||||
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
virtual void doRefinement(const DerivedType *OldType, const Type *NewType) {
|
||||||
assert(ValTy == OldType);
|
assert(ValTy == OldType);
|
||||||
@ -814,6 +898,11 @@ public:
|
|||||||
|
|
||||||
static TypeMap<PointerValType, PointerType> PointerTypes;
|
static TypeMap<PointerValType, PointerType> PointerTypes;
|
||||||
|
|
||||||
|
PointerValType PointerValType::get(const PointerType *PT) {
|
||||||
|
return PointerValType(PT->getElementType(), PointerTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PointerType *PointerType::get(const Type *ValueType) {
|
PointerType *PointerType::get(const Type *ValueType) {
|
||||||
assert(ValueType && "Can't get a pointer to <null> type!");
|
assert(ValueType && "Can't get a pointer to <null> type!");
|
||||||
PointerValType PVT(ValueType, PointerTypes);
|
PointerValType PVT(ValueType, PointerTypes);
|
||||||
@ -830,6 +919,13 @@ PointerType *PointerType::get(const Type *ValueType) {
|
|||||||
return PT;
|
return PT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PointerType::dropAllTypeUses(bool inMap) {
|
||||||
|
#if 0
|
||||||
|
//if (inMap) PointerTypes.remove(PointerTypes.getEntryForType(this));
|
||||||
|
ElementType = Type::IntTy;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void debug_type_tables() {
|
void debug_type_tables() {
|
||||||
FunctionTypes.dump();
|
FunctionTypes.dump();
|
||||||
ArrayTypes.dump();
|
ArrayTypes.dump();
|
||||||
@ -891,12 +987,12 @@ void DerivedType::removeAbstractTypeUser(AbstractTypeUser *U) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// refineAbstractTypeTo - This function is used to when it is discovered that
|
// refineAbstractTypeToInternal - This function is used to when it is discovered
|
||||||
// the 'this' abstract type is actually equivalent to the NewType specified.
|
// that the 'this' abstract type is actually equivalent to the NewType
|
||||||
// This causes all users of 'this' to switch to reference the more concrete
|
// specified. This causes all users of 'this' to switch to reference the more
|
||||||
// type NewType and for 'this' to be deleted.
|
// concrete type NewType and for 'this' to be deleted.
|
||||||
//
|
//
|
||||||
void DerivedType::refineAbstractTypeTo(const Type *NewType) {
|
void DerivedType::refineAbstractTypeToInternal(const Type *NewType, bool inMap){
|
||||||
assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!");
|
assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!");
|
||||||
assert(this != NewType && "Can't refine to myself!");
|
assert(this != NewType && "Can't refine to myself!");
|
||||||
|
|
||||||
@ -924,6 +1020,14 @@ void DerivedType::refineAbstractTypeTo(const Type *NewType) {
|
|||||||
//
|
//
|
||||||
addAbstractTypeUser(this);
|
addAbstractTypeUser(this);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// To make the situation simpler, we ask the subclass to remove this type from
|
||||||
|
// the type map, and to replace any type uses with uses of non-abstract types.
|
||||||
|
// This dramatically limits the amount of recursive type trouble we can find
|
||||||
|
// ourselves in.
|
||||||
|
dropAllTypeUses(inMap);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Count the number of self uses. Stop looping when sizeof(list) == NSU.
|
// Count the number of self uses. Stop looping when sizeof(list) == NSU.
|
||||||
unsigned NumSelfUses = 0;
|
unsigned NumSelfUses = 0;
|
||||||
|
|
||||||
@ -972,6 +1076,10 @@ void DerivedType::refineAbstractTypeTo(const Type *NewType) {
|
|||||||
//
|
//
|
||||||
assert((NewTy == this || AbstractTypeUsers.back() == this) &&
|
assert((NewTy == this || AbstractTypeUsers.back() == this) &&
|
||||||
"Only self uses should be left!");
|
"Only self uses should be left!");
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
assert(AbstractTypeUsers.size() == 1 && "This type should get deleted!");
|
||||||
|
#endif
|
||||||
removeAbstractTypeUser(this);
|
removeAbstractTypeUser(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,6 +1162,14 @@ void FunctionType::refineAbstractType(const DerivedType *OldType,
|
|||||||
<< *OldType << "], " << (void*)NewType << " ["
|
<< *OldType << "], " << (void*)NewType << " ["
|
||||||
<< *NewType << "])\n";
|
<< *NewType << "])\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Look up our current type map entry..
|
||||||
|
#if 0
|
||||||
|
TypeMap<FunctionValType, FunctionType>::iterator TMI =
|
||||||
|
FunctionTypes.getEntryForType(this);
|
||||||
|
assert(TMI->second == this);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Find the type element we are refining...
|
// Find the type element we are refining...
|
||||||
if (ResultType == OldType) {
|
if (ResultType == OldType) {
|
||||||
ResultType.removeUserFromConcrete();
|
ResultType.removeUserFromConcrete();
|
||||||
@ -1066,7 +1182,7 @@ void FunctionType::refineAbstractType(const DerivedType *OldType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (const FunctionType *MT = FunctionTypes.containsEquivalent(this)) {
|
if (const FunctionType *MT = FunctionTypes.containsEquivalent(this)) {
|
||||||
refineAbstractTypeTo(MT); // Different type altogether...
|
refineAbstractTypeToInternal(MT, false); // Different type altogether...
|
||||||
} else {
|
} else {
|
||||||
// If the type is currently thought to be abstract, rescan all of our
|
// If the type is currently thought to be abstract, rescan all of our
|
||||||
// subtypes to see if the type has just become concrete!
|
// subtypes to see if the type has just become concrete!
|
||||||
@ -1088,12 +1204,19 @@ void ArrayType::refineAbstractType(const DerivedType *OldType,
|
|||||||
<< *NewType << "])\n";
|
<< *NewType << "])\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// Look up our current type map entry..
|
||||||
|
TypeMap<ArrayValType, ArrayType>::iterator TMI =
|
||||||
|
ArrayTypes.getEntryForType(this);
|
||||||
|
assert(TMI->second == this);
|
||||||
|
#endif
|
||||||
|
|
||||||
assert(getElementType() == OldType);
|
assert(getElementType() == OldType);
|
||||||
ElementType.removeUserFromConcrete();
|
ElementType.removeUserFromConcrete();
|
||||||
ElementType = NewType;
|
ElementType = NewType;
|
||||||
|
|
||||||
if (const ArrayType *AT = ArrayTypes.containsEquivalent(this)) {
|
if (const ArrayType *AT = ArrayTypes.containsEquivalent(this)) {
|
||||||
refineAbstractTypeTo(AT); // Different type altogether...
|
refineAbstractTypeToInternal(AT, false); // Different type altogether...
|
||||||
} else {
|
} else {
|
||||||
// If the type is currently thought to be abstract, rescan all of our
|
// If the type is currently thought to be abstract, rescan all of our
|
||||||
// subtypes to see if the type has just become concrete!
|
// subtypes to see if the type has just become concrete!
|
||||||
@ -1114,6 +1237,14 @@ void StructType::refineAbstractType(const DerivedType *OldType,
|
|||||||
<< *OldType << "], " << (void*)NewType << " ["
|
<< *OldType << "], " << (void*)NewType << " ["
|
||||||
<< *NewType << "])\n";
|
<< *NewType << "])\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// Look up our current type map entry..
|
||||||
|
TypeMap<StructValType, StructType>::iterator TMI =
|
||||||
|
StructTypes.getEntryForType(this);
|
||||||
|
assert(TMI->second == this);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = ETypes.size()-1; i >= 0; --i)
|
for (int i = ETypes.size()-1; i >= 0; --i)
|
||||||
if (ETypes[i] == OldType) {
|
if (ETypes[i] == OldType) {
|
||||||
ETypes[i].removeUserFromConcrete();
|
ETypes[i].removeUserFromConcrete();
|
||||||
@ -1123,7 +1254,7 @@ void StructType::refineAbstractType(const DerivedType *OldType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (const StructType *ST = StructTypes.containsEquivalent(this)) {
|
if (const StructType *ST = StructTypes.containsEquivalent(this)) {
|
||||||
refineAbstractTypeTo(ST); // Different type altogether...
|
refineAbstractTypeToInternal(ST, false); // Different type altogether...
|
||||||
} else {
|
} else {
|
||||||
// If the type is currently thought to be abstract, rescan all of our
|
// If the type is currently thought to be abstract, rescan all of our
|
||||||
// subtypes to see if the type has just become concrete!
|
// subtypes to see if the type has just become concrete!
|
||||||
@ -1144,12 +1275,19 @@ void PointerType::refineAbstractType(const DerivedType *OldType,
|
|||||||
<< *NewType << "])\n";
|
<< *NewType << "])\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// Look up our current type map entry..
|
||||||
|
TypeMap<PointerValType, PointerType>::iterator TMI =
|
||||||
|
PointerTypes.getEntryForType(this);
|
||||||
|
assert(TMI->second == this);
|
||||||
|
#endif
|
||||||
|
|
||||||
assert(ElementType == OldType);
|
assert(ElementType == OldType);
|
||||||
ElementType.removeUserFromConcrete();
|
ElementType.removeUserFromConcrete();
|
||||||
ElementType = NewType;
|
ElementType = NewType;
|
||||||
|
|
||||||
if (const PointerType *PT = PointerTypes.containsEquivalent(this)) {
|
if (const PointerType *PT = PointerTypes.containsEquivalent(this)) {
|
||||||
refineAbstractTypeTo(PT); // Different type altogether...
|
refineAbstractTypeToInternal(PT, false); // Different type altogether...
|
||||||
} else {
|
} else {
|
||||||
// If the type is currently thought to be abstract, rescan all of our
|
// If the type is currently thought to be abstract, rescan all of our
|
||||||
// subtypes to see if the type has just become concrete!
|
// subtypes to see if the type has just become concrete!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user