aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-08-24 21:02:09 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-08-24 21:02:09 +0000
commit74c83e44fa1f6ef545be4b0ccbfc903818ef6ae9 (patch)
tree9f7811d1831c29b8ccc0526d641d0ca45a4da5bd
parent685133382d214b0ea7a2cf40e4cd2d2c5cff8dd4 (diff)
Use newly-added type inspection support in InstTreeNode subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3501 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/InstrSelection/InstrForest.cpp9
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrForest.cpp9
2 files changed, 8 insertions, 10 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrForest.cpp b/lib/CodeGen/InstrSelection/InstrForest.cpp
index e27b25ce25..c33faec9a0 100644
--- a/lib/CodeGen/InstrSelection/InstrForest.cpp
+++ b/lib/CodeGen/InstrSelection/InstrForest.cpp
@@ -201,7 +201,6 @@ inline void
InstrForest::noteTreeNodeForInstr(Instruction *instr,
InstructionNode *treeNode)
{
- assert(treeNode->getNodeType() == InstrTreeNode::NTInstructionNode);
(*this)[instr] = treeNode;
treeRoots.push_back(treeNode); // mark node as root of a new tree
}
@@ -212,8 +211,8 @@ InstrForest::setLeftChild(InstrTreeNode *parent, InstrTreeNode *child)
{
parent->LeftChild = child;
child->Parent = parent;
- if (child->getNodeType() == InstrTreeNode::NTInstructionNode)
- eraseRoot((InstructionNode*) child); // no longer a tree root
+ if (InstructionNode* instrNode = dyn_cast<InstructionNode>(child))
+ eraseRoot(instrNode); // no longer a tree root
}
inline void
@@ -221,8 +220,8 @@ InstrForest::setRightChild(InstrTreeNode *parent, InstrTreeNode *child)
{
parent->RightChild = child;
child->Parent = parent;
- if (child->getNodeType() == InstrTreeNode::NTInstructionNode)
- eraseRoot((InstructionNode*) child); // no longer a tree root
+ if (InstructionNode* instrNode = dyn_cast<InstructionNode>(child))
+ eraseRoot(instrNode); // no longer a tree root
}
diff --git a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
index e27b25ce25..c33faec9a0 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
@@ -201,7 +201,6 @@ inline void
InstrForest::noteTreeNodeForInstr(Instruction *instr,
InstructionNode *treeNode)
{
- assert(treeNode->getNodeType() == InstrTreeNode::NTInstructionNode);
(*this)[instr] = treeNode;
treeRoots.push_back(treeNode); // mark node as root of a new tree
}
@@ -212,8 +211,8 @@ InstrForest::setLeftChild(InstrTreeNode *parent, InstrTreeNode *child)
{
parent->LeftChild = child;
child->Parent = parent;
- if (child->getNodeType() == InstrTreeNode::NTInstructionNode)
- eraseRoot((InstructionNode*) child); // no longer a tree root
+ if (InstructionNode* instrNode = dyn_cast<InstructionNode>(child))
+ eraseRoot(instrNode); // no longer a tree root
}
inline void
@@ -221,8 +220,8 @@ InstrForest::setRightChild(InstrTreeNode *parent, InstrTreeNode *child)
{
parent->RightChild = child;
child->Parent = parent;
- if (child->getNodeType() == InstrTreeNode::NTInstructionNode)
- eraseRoot((InstructionNode*) child); // no longer a tree root
+ if (InstructionNode* instrNode = dyn_cast<InstructionNode>(child))
+ eraseRoot(instrNode); // no longer a tree root
}