From 4d632b44e218f13d86d0f45c6b94f0a37fe8097e Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 18 May 2015 22:25:14 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237627 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/IRBuilder.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/llvm/IR/IRBuilder.h b/include/llvm/IR/IRBuilder.h index 730cb697100..c5481fb54a1 100644 --- a/include/llvm/IR/IRBuilder.h +++ b/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 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(C)) -- 2.34.1