aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/InstrSelection/InstrForest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/InstrSelection/InstrForest.cpp')
-rw-r--r--lib/CodeGen/InstrSelection/InstrForest.cpp9
1 files changed, 4 insertions, 5 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
}