summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-02 20:06:29 +0000
committerChris Lattner <sabre@nondot.org>2003-09-02 20:06:29 +0000
commitce35f14050a9e2cfdc5a9d04ed49c73c9fb883ba (patch)
tree84bdec38417650e10ab8cef519c5a2d72e2557a4 /llvm/lib
parent99b9ddead7b77d7cd9f803472ec0c030ac2d4f15 (diff)
downloadbcm5719-llvm-ce35f14050a9e2cfdc5a9d04ed49c73c9fb883ba.tar.gz
bcm5719-llvm-ce35f14050a9e2cfdc5a9d04ed49c73c9fb883ba.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Type.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index be5c66698b1..a776e0f6fcf 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/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<const Type *> &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...
}
OpenPOWER on IntegriCloud