X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FNoFolder.h;h=c110270f3229e845b01954ce2ba50bc0e935a4ee;hb=9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe;hp=f4bec629617188a2db65a1d898994c7ef1c75f3b;hpb=9d8658a1292c1674f4968700b91e5a3b5ee3bf4e;p=oota-llvm.git diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h index f4bec629617..c110270f322 100644 --- a/include/llvm/Support/NoFolder.h +++ b/include/llvm/Support/NoFolder.h @@ -20,8 +20,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_NULLFOLDER_H -#define LLVM_SUPPORT_NULLFOLDER_H +#ifndef LLVM_SUPPORT_NOFOLDER_H +#define LLVM_SUPPORT_NOFOLDER_H #include "llvm/Constants.h" #include "llvm/Instructions.h" @@ -30,7 +30,10 @@ namespace llvm { /// NoFolder - Create "constants" (actually, values) with no folding. class NoFolder { + LLVMContext &Context; public: + + NoFolder(LLVMContext &C) : Context(C) { } //===--------------------------------------------------------------------===// // Binary Operators @@ -39,12 +42,21 @@ public: Value *CreateAdd(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateAdd(LHS, RHS); } + Value *CreateFAdd(Constant *LHS, Constant *RHS) const { + return BinaryOperator::CreateFAdd(LHS, RHS); + } Value *CreateSub(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateSub(LHS, RHS); } + Value *CreateFSub(Constant *LHS, Constant *RHS) const { + return BinaryOperator::CreateFSub(LHS, RHS); + } Value *CreateMul(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateMul(LHS, RHS); } + Value *CreateFMul(Constant *LHS, Constant *RHS) const { + return BinaryOperator::CreateFMul(LHS, RHS); + } Value *CreateUDiv(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateUDiv(LHS, RHS); } @@ -104,7 +116,7 @@ public: Constant *CreateGetElementPtr(Constant *C, Constant* const *IdxList, unsigned NumIdx) const { - return ConstantExpr::getGetElementPtr(C, IdxList, NumIdx); + return Context.getConstantExprGetElementPtr(C, IdxList, NumIdx); } Value *CreateGetElementPtr(Constant *C, Value* const *IdxList, unsigned NumIdx) const { @@ -134,12 +146,6 @@ public: Value *CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { return new FCmpInst(P, LHS, RHS); } - Value *CreateVICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return new VICmpInst(P, LHS, RHS); - } - Value *CreateVFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return new VFCmpInst(P, LHS, RHS); - } //===--------------------------------------------------------------------===// // Other Instructions