diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-03-09 17:34:27 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-03-09 17:34:27 +0000 |
| commit | b1d901427a13fde2b1efbb25d89f402c26dfb8b6 (patch) | |
| tree | 6e2564f0e41e0e962f558ff85c35d2dd257d2dfb /llvm/lib | |
| parent | 562c1808791dcea9ce7f625ee28a21cc63bc8bc6 (diff) | |
| download | bcm5719-llvm-b1d901427a13fde2b1efbb25d89f402c26dfb8b6.tar.gz bcm5719-llvm-b1d901427a13fde2b1efbb25d89f402c26dfb8b6.zip | |
correct the computation of the isAbstract bit for types.
llvm-svn: 20533
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Type.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 875de4b6357..2bcda461617 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -481,8 +481,6 @@ namespace llvm { // PromoteAbstractToConcrete - This is a recursive function that walks a type // graph calculating whether or not a type is abstract. // -// This method returns true if the type is found to still be abstract. -// void Type::PromoteAbstractToConcrete() { if (!isAbstract()) return; @@ -505,7 +503,10 @@ void Type::PromoteAbstractToConcrete() { for (Type::subtype_iterator CI = SCC[i]->subtype_begin(), E = SCC[i]->subtype_end(); CI != E; ++CI) if ((*CI)->isAbstract()) - return; // Not going to be concrete, sorry. + // If the child type is in our SCC, it doesn't make the entire SCC + // abstract unless there is a non-SCC abstract type. + if (std::find(SCC.begin(), SCC.end(), *CI) == SCC.end()) + return; // Not going to be concrete, sorry. // Okay, we just discovered this whole SCC is now concrete, mark it as // such! @@ -513,6 +514,10 @@ void Type::PromoteAbstractToConcrete() { assert(SCC[i]->isAbstract() && "Why are we processing concrete types?"); SCC[i]->setAbstract(false); + } + + for (unsigned i = 0, e = SCC.size(); i != e; ++i) { + assert(!SCC[i]->isAbstract() && "Concrete type became abstract?"); // The type just became concrete, notify all users! cast<DerivedType>(SCC[i])->notifyUsesThatTypeBecameConcrete(); } |

