[opaque pointer type] Provide the ability to pass an explicit type when creating...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 19 May 2015 21:31:18 +0000 (21:31 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 19 May 2015 21:31:18 +0000 (21:31 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237728 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/IRBuilder.h

index 730cb697100846b5baab3864db432112d16df545..1c2f178b9f417968b8bd53fd153c40f875723275 100644 (file)
@@ -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))