[llvm-commits] CVS: llvm/include/llvm/Analysis/InstForest.h
LLVM
llvm at cs.uiuc.edu
Sat Jul 17 16:37:08 PDT 2004
Changes in directory llvm/include/llvm/Analysis:
InstForest.h updated: 1.25 -> 1.26
---
Log message:
bug 122: http://llvm.cs.uiuc.edu/PR122 :
remove redundant isa<GlobalValue>
ensure isa<GlobalValue> case is processed before is<Constant>
---
Diffs of the changes: (+9 -7)
Index: llvm/include/llvm/Analysis/InstForest.h
diff -u llvm/include/llvm/Analysis/InstForest.h:1.25 llvm/include/llvm/Analysis/InstForest.h:1.26
--- llvm/include/llvm/Analysis/InstForest.h:1.25 Wed Jul 14 21:50:38 2004
+++ llvm/include/llvm/Analysis/InstForest.h Sat Jul 17 18:36:58 2004
@@ -163,8 +163,8 @@
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 @@
//
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
More information about the llvm-commits
mailing list