namespace llvm {
+class LLVMContext;
+
/// NoFolder - Create "constants" (actually, values) with no folding.
class NoFolder {
public:
+ explicit NoFolder(LLVMContext &) {}
//===--------------------------------------------------------------------===//
// Binary Operators
Value *CreateAdd(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateAdd(LHS, RHS);
}
+ Value *CreateNSWAdd(Constant *LHS, Constant *RHS) const {
+ return BinaryOperator::CreateNSWAdd(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 *CreateNSWSub(Constant *LHS, Constant *RHS) const {
+ return BinaryOperator::CreateNSWSub(LHS, RHS);
+ }
Value *CreateFSub(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateFSub(LHS, RHS);
}
Value *CreateSDiv(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateSDiv(LHS, RHS);
}
+ Value *CreateExactSDiv(Constant *LHS, Constant *RHS) const {
+ return BinaryOperator::CreateExactSDiv(LHS, RHS);
+ }
Value *CreateFDiv(Constant *LHS, Constant *RHS) const {
return BinaryOperator::CreateFDiv(LHS, RHS);
}
return GetElementPtrInst::Create(C, IdxList, IdxList+NumIdx);
}
+ Constant *CreateInBoundsGetElementPtr(Constant *C, Constant* const *IdxList,
+ unsigned NumIdx) const {
+ return ConstantExpr::getInBoundsGetElementPtr(C, IdxList, NumIdx);
+ }
+ Value *CreateInBoundsGetElementPtr(Constant *C, Value* const *IdxList,
+ unsigned NumIdx) const {
+ return GetElementPtrInst::CreateInBounds(C, IdxList, IdxList+NumIdx);
+ }
+
//===--------------------------------------------------------------------===//
// Cast/Conversion Operators
//===--------------------------------------------------------------------===//
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