Remove using declarations
[oota-llvm.git] / lib / CodeGen / InstrSelection / InstrForest.cpp
index 91956f53a4d5c44a435a670ae35922a9a84a280d..c33faec9a04a6774f09bb2977f14aff52748a544 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Type.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "Support/STLExtras.h"
+#include <alloca.h>
 using std::cerr;
 using std::vector;
 
@@ -200,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
 }
@@ -211,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
@@ -220,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
 }