//
//===----------------------------------------------------------------------===//
-#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"
/// NoFolder - Create "constants" (actually, values) with no folding.
class NoFolder {
+ LLVMContext &Context;
public:
+
+ NoFolder(LLVMContext &C) : Context(C) { }
//===--------------------------------------------------------------------===//
// Binary Operators
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);
}
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 {
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