From 31c0da448336754be34fcb7fe4ce4c08208bb03c Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 17 Jul 2004 23:36:58 +0000 Subject: [PATCH] bug 122: remove redundant isa ensure isa case is processed before is git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14926 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/InstForest.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/llvm/Analysis/InstForest.h b/include/llvm/Analysis/InstForest.h index dbeb32a6cbf..8d5451da4e1 100644 --- a/include/llvm/Analysis/InstForest.h +++ b/include/llvm/Analysis/InstForest.h @@ -163,8 +163,8 @@ class InstForest : public std::vector *> { void removeInstFromRootList(Instruction *I) { for (unsigned i = this->size(); i > 0; --i) if ((*this)[i-1]->getValue() == I) { - this->erase(this->begin()+i-1); - return; + this->erase(this->begin()+i-1); + return; } } @@ -238,15 +238,17 @@ bool InstTreeNode::CanMergeInstIntoTree(Instruction *I) { // template InstTreeNode::InstTreeNode(InstForest &IF, Value *V, - InstTreeNode *Parent) : super(Parent) { + InstTreeNode *Parent) : super(Parent) { this->getTreeData().first.first = V; // Save tree node if (!isa(V)) { - assert((isa(V) || isa(V) || - isa(V) || isa(V)) && - "Unrecognized value type for InstForest Partition!"); + assert(isa(V) || isa(V) || isa(V) && + "Unrecognized value type for InstForest Partition!"); if (isa(V)) - this->getTreeData().first.second = ConstNode; + if (isa(V)) + this->getTreeData().first.second = TemporaryNode; + else + this->getTreeData().first.second = ConstNode; else if (isa(V)) this->getTreeData().first.second = BasicBlockNode; else