improve comments.
[oota-llvm.git] / include / llvm / InstrTypes.h
index 0a018de5e9baf4d374b124caf6db403c3b3be2f0..1ee2a4b33180ab63001cb34d46c4d935e2f7417c 100644 (file)
@@ -22,6 +22,8 @@
 
 namespace llvm {
 
+class LLVMContext;
+
 //===----------------------------------------------------------------------===//
 //                            TerminatorInst Class
 //===----------------------------------------------------------------------===//
@@ -50,7 +52,7 @@ protected:
   virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0;
 public:
 
-  virtual Instruction *clone() const = 0;
+  virtual Instruction *clone(LLVMContext &Context) const = 0;
 
   /// getNumSuccessors - Return the number of successors that this terminator
   /// has.
@@ -200,17 +202,23 @@ public:
   /// CreateNeg, CreateNot - Create the NEG and NOT
   ///     instructions out of SUB and XOR instructions.
   ///
-  static BinaryOperator *CreateNeg(Value *Op, const std::string &Name = "",
+  static BinaryOperator *CreateNeg(LLVMContext &Context,
+                                   Value *Op, const std::string &Name = "",
                                    Instruction *InsertBefore = 0);
-  static BinaryOperator *CreateNeg(Value *Op, const std::string &Name,
+  static BinaryOperator *CreateNeg(LLVMContext &Context,
+                                   Value *Op, const std::string &Name,
                                    BasicBlock *InsertAtEnd);
-  static BinaryOperator *CreateFNeg(Value *Op, const std::string &Name = "",
+  static BinaryOperator *CreateFNeg(LLVMContext &Context, 
+                                    Value *Op, const std::string &Name = "",
                                     Instruction *InsertBefore = 0);
-  static BinaryOperator *CreateFNeg(Value *Op, const std::string &Name,
+  static BinaryOperator *CreateFNeg(LLVMContext &Context,
+                                    Value *Op, const std::string &Name,
                                     BasicBlock *InsertAtEnd);
-  static BinaryOperator *CreateNot(Value *Op, const std::string &Name = "",
+  static BinaryOperator *CreateNot(LLVMContext &Context,
+                                   Value *Op, const std::string &Name = "",
                                    Instruction *InsertBefore = 0);
-  static BinaryOperator *CreateNot(Value *Op, const std::string &Name,
+  static BinaryOperator *CreateNot(LLVMContext &Context,
+                                   Value *Op, const std::string &Name,
                                    BasicBlock *InsertAtEnd);
 
   /// isNeg, isFNeg, isNot - Check if the given Value is a
@@ -235,7 +243,7 @@ public:
     return static_cast<BinaryOps>(Instruction::getOpcode());
   }
 
-  virtual BinaryOperator *clone() const;
+  virtual BinaryOperator *clone(LLVMContext &Context) const;
 
   /// swapOperands - Exchange the two operands to this instruction.
   /// This instruction is safe to use on any binary instruction and
@@ -569,7 +577,8 @@ public:
   /// instruction into a BasicBlock right before the specified instruction.
   /// The specified Instruction is allowed to be a dereferenced end iterator.
   /// @brief Create a CmpInst
-  static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
+  static CmpInst *Create(LLVMContext &Context, OtherOps Op,
+                         unsigned short predicate, Value *S1,
                          Value *S2, const std::string &Name = "",
                          Instruction *InsertBefore = 0);
 
@@ -660,13 +669,6 @@ public:
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
   }
-  /// @brief Create a result type for fcmp/icmp
-  static const Type* makeCmpResultType(const Type* opnd_type) {
-    if (const VectorType* vt = dyn_cast<const VectorType>(opnd_type)) {
-      return VectorType::get(Type::Int1Ty, vt->getNumElements());
-    }
-    return Type::Int1Ty;
-  }
 };