diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-17 23:36:58 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-17 23:36:58 +0000 |
commit | 31c0da448336754be34fcb7fe4ce4c08208bb03c (patch) | |
tree | 1bbe7db07d63e24627b766b0889c816bae205906 | |
parent | 1488b34be5f30c056513cdfd4576053af92b68a0 (diff) |
bug 122:
remove redundant isa<GlobalValue>
ensure isa<GlobalValue> case is processed before is<Constant>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14926 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/InstForest.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/llvm/Analysis/InstForest.h b/include/llvm/Analysis/InstForest.h index dbeb32a6cb..8d5451da4e 100644 --- a/include/llvm/Analysis/InstForest.h +++ b/include/llvm/Analysis/InstForest.h @@ -163,8 +163,8 @@ class InstForest : public std::vector<InstTreeNode<Payload> *> { 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<Payload>::CanMergeInstIntoTree(Instruction *I) { // template <class Payload> InstTreeNode<Payload>::InstTreeNode(InstForest<Payload> &IF, Value *V, - InstTreeNode *Parent) : super(Parent) { + InstTreeNode *Parent) : super(Parent) { this->getTreeData().first.first = V; // Save tree node if (!isa<Instruction>(V)) { - assert((isa<Constant>(V) || isa<BasicBlock>(V) || - isa<Argument>(V) || isa<GlobalValue>(V)) && - "Unrecognized value type for InstForest Partition!"); + assert(isa<Constant>(V) || isa<BasicBlock>(V) || isa<Argument>(V) && + "Unrecognized value type for InstForest Partition!"); if (isa<Constant>(V)) - this->getTreeData().first.second = ConstNode; + if (isa<GlobalValue>(V)) + this->getTreeData().first.second = TemporaryNode; + else + this->getTreeData().first.second = ConstNode; else if (isa<BasicBlock>(V)) this->getTreeData().first.second = BasicBlockNode; else |