mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-11 07:18:44 +00:00
Move functionality preserving changes.
Inline containsEquivalent Remove some //'s llvm-svn: 8358
This commit is contained in:
parent
6a4cb9b0e9
commit
71ed17fe2e
@ -504,32 +504,23 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// containsEquivalent - Return true if the typemap contains a type that is
|
void finishRefinement(TypeClass *Ty) {
|
||||||
// structurally equivalent to the specified type.
|
|
||||||
//
|
|
||||||
inline TypeClass *containsEquivalent(TypeClass *Ty) { //iterator TyIt) {
|
|
||||||
//const TypeClass *Ty = (const TypeClass*)TyIt->second.get();
|
//const TypeClass *Ty = (const TypeClass*)TyIt->second.get();
|
||||||
for (iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
for (iterator I = Map.begin(), E = Map.end(); I != E; ++I)
|
||||||
if (I->second.get() != Ty && TypesEqual(Ty, I->second.get())) {
|
if (I->second.get() != Ty && TypesEqual(Ty, I->second.get())) {
|
||||||
TypeClass *New = (TypeClass*)I->second.get();
|
TypeClass *NewTy = (TypeClass*)I->second.get();
|
||||||
#if 0
|
#if 0
|
||||||
Map.erase(TyIt); // The old entry is now dead!
|
//Map.erase(TyIt); // The old entry is now dead!
|
||||||
#endif
|
#endif
|
||||||
return New;
|
// Refined to a different type altogether?
|
||||||
|
Ty->refineAbstractTypeToInternal(NewTy, false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void finishRefinement(TypeClass *Ty) {
|
// If the type is currently thought to be abstract, rescan all of our
|
||||||
if (TypeClass *NewTy = containsEquivalent(Ty)) {
|
// subtypes to see if the type has just become concrete!
|
||||||
// Refined to a different type altogether?
|
if (Ty->isAbstract()) Ty->setAbstract(Ty->isTypeAbstract());
|
||||||
Ty->refineAbstractTypeToInternal(NewTy, false);
|
Ty->typeIsRefined(); // Same type, different contents...
|
||||||
} else {
|
|
||||||
// If the type is currently thought to be abstract, rescan all of our
|
|
||||||
// subtypes to see if the type has just become concrete!
|
|
||||||
if (Ty->isAbstract()) Ty->setAbstract(Ty->isTypeAbstract());
|
|
||||||
Ty->typeIsRefined(); // Same type, different contents...
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// refineAbstractType - This is called when one of the contained abstract
|
// refineAbstractType - This is called when one of the contained abstract
|
||||||
@ -710,8 +701,7 @@ FunctionType *FunctionType::get(const Type *ReturnType,
|
|||||||
|
|
||||||
void FunctionType::dropAllTypeUses(bool inMap) {
|
void FunctionType::dropAllTypeUses(bool inMap) {
|
||||||
#if 0
|
#if 0
|
||||||
//if (inMap) FunctionTypes.remove(FunctionTypes.getEntryForType(this));
|
if (inMap) FunctionTypes.remove(FunctionTypes.getEntryForType(this));
|
||||||
|
|
||||||
// Drop all uses of other types, which might be recursive.
|
// Drop all uses of other types, which might be recursive.
|
||||||
ResultType = Type::VoidTy;
|
ResultType = Type::VoidTy;
|
||||||
ParamTys.clear();
|
ParamTys.clear();
|
||||||
@ -782,7 +772,7 @@ ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) {
|
|||||||
|
|
||||||
void ArrayType::dropAllTypeUses(bool inMap) {
|
void ArrayType::dropAllTypeUses(bool inMap) {
|
||||||
#if 0
|
#if 0
|
||||||
//if (inMap) ArrayTypes.remove(ArrayTypes.getEntryForType(this));
|
if (inMap) ArrayTypes.remove(ArrayTypes.getEntryForType(this));
|
||||||
ElementType = Type::IntTy;
|
ElementType = Type::IntTy;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -865,7 +855,7 @@ StructType *StructType::get(const std::vector<const Type*> &ETypes) {
|
|||||||
|
|
||||||
void StructType::dropAllTypeUses(bool inMap) {
|
void StructType::dropAllTypeUses(bool inMap) {
|
||||||
#if 0
|
#if 0
|
||||||
//if (inMap) StructTypes.remove(StructTypes.getEntryForType(this));
|
if (inMap) StructTypes.remove(StructTypes.getEntryForType(this));
|
||||||
ETypes.clear();
|
ETypes.clear();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -934,7 +924,7 @@ PointerType *PointerType::get(const Type *ValueType) {
|
|||||||
|
|
||||||
void PointerType::dropAllTypeUses(bool inMap) {
|
void PointerType::dropAllTypeUses(bool inMap) {
|
||||||
#if 0
|
#if 0
|
||||||
//if (inMap) PointerTypes.remove(PointerTypes.getEntryForType(this));
|
if (inMap) PointerTypes.remove(PointerTypes.getEntryForType(this));
|
||||||
ElementType = Type::IntTy;
|
ElementType = Type::IntTy;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1033,13 +1023,11 @@ void DerivedType::refineAbstractTypeToInternal(const Type *NewType, bool inMap){
|
|||||||
//
|
//
|
||||||
addAbstractTypeUser(this);
|
addAbstractTypeUser(this);
|
||||||
|
|
||||||
#if 0
|
|
||||||
// To make the situation simpler, we ask the subclass to remove this type from
|
// 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.
|
// 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
|
// This dramatically limits the amount of recursive type trouble we can find
|
||||||
// ourselves in.
|
// ourselves in.
|
||||||
dropAllTypeUses(inMap);
|
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user