summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/IRBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/IRBuilder.cpp')
-rw-r--r--llvm/lib/IR/IRBuilder.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp
index 91c950da71b..a9818995677 100644
--- a/llvm/lib/IR/IRBuilder.cpp
+++ b/llvm/lib/IR/IRBuilder.cpp
@@ -731,28 +731,29 @@ CallInst *IRBuilderBase::CreateGCRelocate(Instruction *Statepoint,
return createCallHelper(FnGCRelocate, Args, this, Name);
}
-CallInst *IRBuilderBase::CreateBinaryIntrinsic(Intrinsic::ID ID,
- Value *LHS, Value *RHS,
- const Twine &Name) {
+CallInst *IRBuilderBase::CreateUnaryIntrinsic(Intrinsic::ID ID, Value *V,
+ Instruction *FMFSource,
+ const Twine &Name) {
Module *M = BB->getModule();
- Function *Fn = Intrinsic::getDeclaration(M, ID, { LHS->getType() });
- return createCallHelper(Fn, { LHS, RHS }, this, Name);
+ Function *Fn = Intrinsic::getDeclaration(M, ID, {V->getType()});
+ return createCallHelper(Fn, {V}, this, Name, FMFSource);
}
-CallInst *IRBuilderBase::CreateIntrinsic(Intrinsic::ID ID,
- Instruction *FMFSource,
- const Twine &Name) {
+CallInst *IRBuilderBase::CreateBinaryIntrinsic(Intrinsic::ID ID, Value *LHS,
+ Value *RHS,
+ Instruction *FMFSource,
+ const Twine &Name) {
Module *M = BB->getModule();
- Function *Fn = Intrinsic::getDeclaration(M, ID);
- return createCallHelper(Fn, {}, this, Name);
+ Function *Fn = Intrinsic::getDeclaration(M, ID, { LHS->getType() });
+ return createCallHelper(Fn, {LHS, RHS}, this, Name, FMFSource);
}
CallInst *IRBuilderBase::CreateIntrinsic(Intrinsic::ID ID,
+ ArrayRef<Type *> Types,
ArrayRef<Value *> Args,
Instruction *FMFSource,
const Twine &Name) {
- assert(!Args.empty() && "Expected at least one argument to intrinsic");
Module *M = BB->getModule();
- Function *Fn = Intrinsic::getDeclaration(M, ID, { Args.front()->getType() });
+ Function *Fn = Intrinsic::getDeclaration(M, ID, Types);
return createCallHelper(Fn, Args, this, Name, FMFSource);
}
OpenPOWER on IntegriCloud