X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FInstrTypes.h;h=1ee2a4b33180ab63001cb34d46c4d935e2f7417c;hb=ab9238e876dcf6da101d8ae626925bcd9e537a7e;hp=0a018de5e9baf4d374b124caf6db403c3b3be2f0;hpb=7f6aa2b162e5daaf7b9ccf05d749597d3d7cf460;p=oota-llvm.git diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 0a018de5e9b..1ee2a4b3318 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -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(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(V) && classof(cast(V)); } - /// @brief Create a result type for fcmp/icmp - static const Type* makeCmpResultType(const Type* opnd_type) { - if (const VectorType* vt = dyn_cast(opnd_type)) { - return VectorType::get(Type::Int1Ty, vt->getNumElements()); - } - return Type::Int1Ty; - } };