Remove unneeded #include
[oota-llvm.git] / include / llvm / iOther.h
index e5c3e7d7a317a1546e9549b641813eab6cf3dfec..f9b60d03e9e8b70f17de86ca2d16d32cb6d1ebc4 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "llvm/InstrTypes.h"
 
+namespace llvm {
+
 //===----------------------------------------------------------------------===//
 //                                 CastInst Class
 //===----------------------------------------------------------------------===//
@@ -54,6 +56,9 @@ public:
 //                                 CallInst Class
 //===----------------------------------------------------------------------===//
 
+/// CallInst - This class represents a function call, abstracting a target
+/// machine's calling convention.
+///
 class CallInst : public Instruction {
   CallInst(const CallInst &CI);
 public:
@@ -61,20 +66,18 @@ public:
            const std::string &Name = "", Instruction *InsertBefore = 0);
 
   // Alternate CallInst ctors w/ no actuals & one actual, respectively.
-  CallInst(Value *F, const std::string &Name = "",
-           Instruction  *InsertBefore = 0);
+  CallInst(Value *F, const std::string &Name = "", 
+           Instruction *InsertBefore = 0);
   CallInst(Value *F, Value *Actual, const std::string& Name = "",
-           InstructionInsertBefore = 0);
+           Instruction *InsertBefore = 0);
 
   virtual Instruction *clone() const { return new CallInst(*this); }
   bool mayWriteToMemory() const { return true; }
 
-  const Function *getCalledFunction() const {
-    return dyn_cast<Function>(Operands[0].get());
-  }
-  Function *getCalledFunction() {
-    return dyn_cast<Function>(Operands[0].get());
-  }
+  // FIXME: These methods should be inline once we eliminate
+  // ConstantPointerRefs!
+  const Function *getCalledFunction() const;
+  Function *getCalledFunction();
 
   // getCalledValue - Get a pointer to a method that is invoked by this inst.
   inline const Value *getCalledValue() const { return Operands[0]; }
@@ -95,8 +98,8 @@ public:
 //                                 ShiftInst Class
 //===----------------------------------------------------------------------===//
 
-// ShiftInst - This class represents left and right shift instructions.
-//
+/// ShiftInst - This class represents left and right shift instructions.
+///
 class ShiftInst : public Instruction {
   ShiftInst(const ShiftInst &SI) : Instruction(SI.getType(), SI.getOpcode()) {
     Operands.reserve(2);
@@ -113,7 +116,9 @@ public:
     Operands.push_back(Use(SA, this));
   }
 
-  OtherOps getOpcode() const { return (OtherOps)Instruction::getOpcode(); }
+  OtherOps getOpcode() const {
+    return static_cast<OtherOps>(Instruction::getOpcode());
+  }
 
   virtual Instruction *clone() const { return new ShiftInst(*this); }
 
@@ -185,8 +190,6 @@ public:
 
   virtual Instruction *clone() const { return new VAArgInst(*this); }
 
-  bool mayWriteToMemory() const { return true; }
-
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const VAArgInst *) { return true; }
   static inline bool classof(const Instruction *I) {
@@ -197,4 +200,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif