Cosmetic changes only.
[oota-llvm.git] / lib / CodeGen / InstrSelection / InstrForest.cpp
index 9f4df08d3842fead1af7eaa4fc26440f0a6d9062..199ed6569be2e51af9ac6d46bda2f72978886d15 100644 (file)
@@ -26,6 +26,7 @@
 #include "llvm/Method.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iMemory.h"
+#include "llvm/iOther.h"
 #include "llvm/ConstPoolVals.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/CodeGen/MachineInstr.h"
@@ -57,11 +58,11 @@ InstructionNode::InstructionNode(Instruction* I)
 
   // Distinguish special cases of some instructions such as Ret and Br
   // 
-  if (opLabel == Instruction::Ret && ((ReturnInst*)I)->getReturnValue())
+  if (opLabel == Instruction::Ret && cast<ReturnInst>(I)->getReturnValue())
     {
       opLabel = RetValueOp;                     // ret(value) operation
     }
-  else if (opLabel == Instruction::Br && ! ((BranchInst*)I)->isUnconditional())
+  else if (opLabel ==Instruction::Br && !cast<BranchInst>(I)->isUnconditional())
     {
       opLabel = BrCondOp;              // br(cond) operation
     }
@@ -275,12 +276,12 @@ InstrForest::buildTreeForInstruction(Instruction *instr)
     
       // Check latter condition here just to simplify the next IF.
       bool includeAddressOperand =
-       (operand->isBasicBlock() || operand->isMethod())
+       (isa<BasicBlock>(operand) || isa<Method>(operand))
        && !instr->isTerminator();
     
-      if (includeAddressOperand || operand->isInstruction() ||
-         operand->isConstant() || operand->isMethodArgument() ||
-         operand->isGlobal()) 
+      if (includeAddressOperand || isa<Instruction>(operand) ||
+         isa<ConstPoolVal>(operand) || isa<MethodArgument>(operand) ||
+         isa<GlobalVariable>(operand))
        {
          // This operand is a data value
        
@@ -300,15 +301,15 @@ InstrForest::buildTreeForInstruction(Instruction *instr)
          // is used directly, i.e., made a child of the instruction node.
          // 
          InstrTreeNode* opTreeNode;
-         if (operand->isInstruction() && operand->use_size() == 1 &&
-             ((Instruction*)operand)->getParent() == instr->getParent() &&
-             ! instr->isPHINode() &&
+         if (isa<Instruction>(operand) && operand->use_size() == 1 &&
+             cast<Instruction>(operand)->getParent() == instr->getParent() &&
+             !isa<PHINode>(instr) &&
              instr->getOpcode() != Instruction::Call)
            {
              // Recursively create a treeNode for it.
              opTreeNode = buildTreeForInstruction((Instruction*)operand);
            }
-         else if (ConstPoolVal *CPV = operand->castConstant())
+         else if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(operand))
            {
              // Create a leaf node for a constant
              opTreeNode = new ConstantNode(CPV);