[llvm] r237728 - [opaque pointer type] Provide the ability to pass an explicit type when creating a CallInst through IRBuilder
David Blaikie
dblaikie at gmail.com
Tue May 19 14:31:18 PDT 2015
Author: dblaikie
Date: Tue May 19 16:31:18 2015
New Revision: 237728
URL: http://llvm.org/viewvc/llvm-project?rev=237728&view=rev
Log:
[opaque pointer type] Provide the ability to pass an explicit type when creating a CallInst through IRBuilder
A use for this will be added to Clang shortly. I haven't hit the
specific cases I want to cleanup in LLVM just yet.
A utility that avoids the need for this in direct calls to
llvm::Functions will be added too - since in that case the type can be
retrieved from the llvm::Function directly.
Modified:
llvm/trunk/include/llvm/IR/IRBuilder.h
Modified: llvm/trunk/include/llvm/IR/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IRBuilder.h?rev=237728&r1=237727&r2=237728&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/IRBuilder.h Tue May 19 16:31:18 2015
@@ -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,11 @@ public:
return Insert(CallInst::Create(Callee, Args), Name);
}
+ CallInst *CreateCall(llvm::FunctionType *FTy, Value *Callee,
+ ArrayRef<Value *> Args, const Twine &Name = "") {
+ return Insert(CallInst::Create(FTy, Callee, Args), Name);
+ }
+
Value *CreateSelect(Value *C, Value *True, Value *False,
const Twine &Name = "") {
if (Constant *CC = dyn_cast<Constant>(C))
More information about the llvm-commits
mailing list