X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FInstrTypes.h;h=1ee2a4b33180ab63001cb34d46c4d935e2f7417c;hb=ab9238e876dcf6da101d8ae626925bcd9e537a7e;hp=1eab983da68ad5dfc836a01f9fb79a88dd4e3e71;hpb=ae3a0be92e33bc716722aa600983fc1535acb122;p=oota-llvm.git diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 1eab983da68..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); @@ -655,20 +664,11 @@ public: static inline bool classof(const CmpInst *) { return true; } static inline bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ICmp || - I->getOpcode() == Instruction::FCmp || - I->getOpcode() == Instruction::VICmp || - I->getOpcode() == Instruction::VFCmp; + I->getOpcode() == Instruction::FCmp; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); } - /// @brief Create a result type for fcmp/icmp (but not vicmp/vfcmp) - 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; - } };