From: Chris Lattner Date: Tue, 2 Sep 2003 20:06:29 +0000 (+0000) Subject: Don't bother doing an exhaustive recursive walk if we are at the limit of what X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=de73193f3e42d7aa80429588b69b8d447beb0c9f;p=oota-llvm.git 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8323 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index be5c66698b1..a776e0f6fcf 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -372,7 +372,7 @@ PointerType::PointerType(const Type *E) : SequentialType(PointerTyID, E) { } OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) { - Recursive = false; + setRecursive(false); setAbstract(true); #ifdef DEBUG_MERGE_TYPES std::cerr << "Derived new type: " << getDescription() << "\n"; @@ -413,8 +413,10 @@ static void getTypeProps(const Type *Ty, std::vector &TypeStack, TypeStack.push_back(Ty); // Add us to the stack.. for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); - I != E; ++I) + I != E; ++I) { getTypeProps(*I, TypeStack, isAbstract, isRecursive); + if (isAbstract && isRecursive) break; + } TypeStack.pop_back(); // Remove self from stack... }