diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-05-18 22:25:14 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-05-18 22:25:14 +0000 |
commit | 09808a991c121bdce1a7ee1cf16b4c59a7c02192 (patch) | |
tree | 438346a62471761ae0dfadc737950a5f77e33e07 | |
parent | 43f9bb7371777e7812a6352e372752bc9f20c0a5 (diff) | |
download | bcm5719-llvm-09808a991c121bdce1a7ee1cf16b4c59a7c02192.tar.gz bcm5719-llvm-09808a991c121bdce1a7ee1cf16b4c59a7c02192.zip |
[opaque pointer type] Provide a convenience for IRBuilder::CreateCall that accepts a Function without needing to take an explicit callee Type
The common case is a direct call, so don't make all those users have to
explicitly pass the result of llvm::Function::getFunctionType.
llvm-svn: 237627
-rw-r--r-- | llvm/include/llvm/IR/IRBuilder.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h index 730cb697100..c5481fb54a1 100644 --- a/llvm/include/llvm/IR/IRBuilder.h +++ b/llvm/include/llvm/IR/IRBuilder.h @@ -21,6 +21,7 @@ #include "llvm/IR/BasicBlock.h" #include "llvm/IR/ConstantFolder.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/Function.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h" @@ -1466,6 +1467,12 @@ public: return Insert(CallInst::Create(Callee, Args), Name); } + CallInst *CreateCall(Function *Callee, ArrayRef<Value *> Args, + const Twine &Name = "") { + return Insert(CallInst::Create(Callee->getFunctionType(), Callee, Args), + Name); + } + Value *CreateSelect(Value *C, Value *True, Value *False, const Twine &Name = "") { if (Constant *CC = dyn_cast<Constant>(C)) |