* Make contained ostream not public.
[oota-llvm.git] / include / llvm / InstrTypes.h
index 7938b483c7cc60c0d4d80910c019bc93ef3f613d..30ba130b892f68490fa820a263c2fe12c52509d0 100644 (file)
@@ -34,6 +34,7 @@ protected:
                  const std::string &Name = "", Instruction *InsertBefore = 0)
     : Instruction(Ty, iType, Name, InsertBefore) {
   }
+  TerminatorInst(Instruction::TermOps iType, BasicBlock *InsertAtEnd);
 public:
 
   /// Terminators must implement the methods required by Instruction...
@@ -50,7 +51,8 @@ public:
   virtual void setSuccessor(unsigned idx, BasicBlock *B) = 0;
 
   inline BasicBlock *getSuccessor(unsigned idx) {
-    return (BasicBlock*)((const TerminatorInst *)this)->getSuccessor(idx);
+    const TerminatorInst *TI = this;
+    return const_cast<BasicBlock*>(TI->getSuccessor(idx));
   }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -110,7 +112,7 @@ public:
   static       Value*    getNotArgument(      BinaryOperator* Bop);
 
   BinaryOps getOpcode() const { 
-    return (BinaryOps)Instruction::getOpcode();
+    return static_cast<BinaryOps>(Instruction::getOpcode());
   }
 
   virtual Instruction *clone() const {