diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-08-24 21:02:09 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-08-24 21:02:09 +0000 |
commit | 872c7f9a9ec620819835a7de66fceea7a5b3622f (patch) | |
tree | 6f3b5b285614bd3b9b0af062c733ec931f1c4b24 /llvm/lib/CodeGen | |
parent | 8c1e3f73106fdcddeded097c828f5b1f7dca43f2 (diff) | |
download | bcm5719-llvm-872c7f9a9ec620819835a7de66fceea7a5b3622f.tar.gz bcm5719-llvm-872c7f9a9ec620819835a7de66fceea7a5b3622f.zip |
Use newly-added type inspection support in InstTreeNode subclasses.
llvm-svn: 3501
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/InstrSelection/InstrForest.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp b/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp index e27b25ce25d..c33faec9a04 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp +++ b/llvm/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 } |