Fix failing test cases with joined live intervals. It turns out that
[oota-llvm.git] / include / llvm / iPHINode.h
index 1f6e5582d220c1a2992807a21b657e97f0d22dd8..399c761670b2125386a06c6397627e62dab676ba 100644 (file)
@@ -1,4 +1,11 @@
-//===-- llvm/iPHINode.h - PHI instruction definition -------------*- C++ -*--=//
+//===-- llvm/iPHINode.h - PHI instruction definition ------------*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file defines the PHINode class.
 //
@@ -7,9 +14,10 @@
 #ifndef LLVM_IPHINODE_H
 #define LLVM_IPHINODE_H
 
-#include <assert.h>
-
 #include "llvm/Instruction.h"
+
+namespace llvm {
+
 class BasicBlock;
 
 //===----------------------------------------------------------------------===//
@@ -25,7 +33,7 @@ class PHINode : public Instruction {
 public:
   PHINode(const Type *Ty, const std::string &Name = "",
           Instruction *InsertBefore = 0)
-    : Instruction(Ty, Instruction::PHINode, Name, InsertBefore) {
+    : Instruction(Ty, Instruction::PHI, Name, InsertBefore) {
   }
 
   virtual Instruction *clone() const { return new PHINode(*this); }
@@ -50,11 +58,11 @@ public:
   /// getIncomingBlock - Return incoming basic block #x
   BasicBlock *getIncomingBlock(unsigned i) const { 
     assert(i*2+1 < Operands.size() && "Invalid value number!");
-    return (BasicBlock*)Operands[i*2+1].get();
+    return reinterpret_cast<BasicBlock*>(Operands[i*2+1].get());
   }
   void setIncomingBlock(unsigned i, BasicBlock *BB) {
     assert(i*2+1 < Operands.size() && "Invalid value number!");
-    Operands[i*2+1] = (Value*)BB;
+    Operands[i*2+1] = reinterpret_cast<Value*>(BB);
   }
   unsigned getOperandNumForIncomingBlock(unsigned i) {
     return i*2+1;
@@ -65,7 +73,7 @@ public:
     assert(getType() == D->getType() &&
            "All operands to PHI node must be the same type as the PHI node!");
     Operands.push_back(Use(D, this));
-    Operands.push_back(Use((Value*)BB, this));
+    Operands.push_back(Use(reinterpret_cast<Value*>(BB), this));
   }
   
   /// removeIncomingValue - Remove an incoming value.  This is useful if a
@@ -100,11 +108,13 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const PHINode *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() == Instruction::PHINode
+    return I->getOpcode() == Instruction::PHI; 
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
   }
 };
 
+} // End llvm namespace
+
 #endif