Don't bother doing an exhaustive recursive walk if we are at the limit of what

we need to know anyway.  This reduces the 2002-07-08-HugePerformanceProblem.llx
down to 3.210u:0.010s, which is back in the acceptable range again

llvm-svn: 8323
This commit is contained in:
Chris Lattner 2003-09-02 20:06:29 +00:00
parent 99b9ddead7
commit ce35f14050
1 changed files with 4 additions and 2 deletions

View File

@ -372,7 +372,7 @@ PointerType::PointerType(const Type *E) : SequentialType(PointerTyID, E) {
} }
OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) { OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) {
Recursive = false; setRecursive(false);
setAbstract(true); setAbstract(true);
#ifdef DEBUG_MERGE_TYPES #ifdef DEBUG_MERGE_TYPES
std::cerr << "Derived new type: " << getDescription() << "\n"; std::cerr << "Derived new type: " << getDescription() << "\n";
@ -413,8 +413,10 @@ static void getTypeProps(const Type *Ty, std::vector<const Type *> &TypeStack,
TypeStack.push_back(Ty); // Add us to the stack.. TypeStack.push_back(Ty); // Add us to the stack..
for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
I != E; ++I) I != E; ++I) {
getTypeProps(*I, TypeStack, isAbstract, isRecursive); getTypeProps(*I, TypeStack, isAbstract, isRecursive);
if (isAbstract && isRecursive) break;
}
TypeStack.pop_back(); // Remove self from stack... TypeStack.pop_back(); // Remove self from stack...
} }