diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h --- a/llvm/include/llvm/IR/IRBuilder.h +++ b/llvm/include/llvm/IR/IRBuilder.h @@ -2549,23 +2549,42 @@ OpBundles, Name, FPMathTag); } - // Deprecated [opaque pointer types] - CallInst *CreateCall(Value *Callee, ArrayRef Args = None, + // Ordinarily, the FunctionCallee overloads above should be sufficient. + // These Function * and InlineAsm * overloads are required to hide the + // deprecated Value * overloads below. + CallInst *CreateCall(Function *Fn, ArrayRef Args = None, const Twine &Name = "", MDNode *FPMathTag = nullptr) { - return CreateCall( - cast(Callee->getType()->getPointerElementType()), Callee, - Args, Name, FPMathTag); + return CreateCall(FunctionCallee{Fn}, Args, Name, FPMathTag); } - // Deprecated [opaque pointer types] - CallInst *CreateCall(Value *Callee, ArrayRef Args, + CallInst *CreateCall(Function *Fn, ArrayRef Args, ArrayRef OpBundles, const Twine &Name = "", MDNode *FPMathTag = nullptr) { - return CreateCall( - cast(Callee->getType()->getPointerElementType()), Callee, - Args, OpBundles, Name, FPMathTag); + return CreateCall(FunctionCallee{Fn}, Args, OpBundles, Name, FPMathTag); + } + + CallInst *CreateCall(InlineAsm *Fn, ArrayRef Args = None, + const Twine &Name = "", MDNode *FPMathTag = nullptr) { + return CreateCall(FunctionCallee{Fn}, Args, Name, FPMathTag); } + CallInst *CreateCall(InlineAsm *Fn, ArrayRef Args, + ArrayRef OpBundles, + const Twine &Name = "", MDNode *FPMathTag = nullptr) { + return CreateCall(FunctionCallee{Fn}, Args, OpBundles, Name, FPMathTag); + } + + // Deprecated [opaque pointer types] + LLVM_ATTRIBUTE_DEPRECATED( + CallInst *CreateCall(Value *Callee, ArrayRef Args = None, + const Twine &Name = "", MDNode *FPMathTag = nullptr), + "Pointer types are opaque"); + LLVM_ATTRIBUTE_DEPRECATED( + CallInst *CreateCall(Value *Callee, ArrayRef Args, + ArrayRef OpBundles, + const Twine &Name = "", MDNode *FPMathTag = nullptr), + "Pointer types are opaque"); + CallInst *CreateConstrainedFPCall( Function *Callee, ArrayRef Args, const Twine &Name = "", Optional Rounding = None, @@ -2976,6 +2995,28 @@ } }; +// Deprecated [opaque pointer types] +template +CallInst *IRBuilder::CreateCall(Value *Callee, + ArrayRef Args, + const Twine &Name, + MDNode *FPMathTag) { + return CreateCall( + cast(Callee->getType()->getPointerElementType()), + Callee, Args, Name, FPMathTag); +} + +// Deprecated [opaque pointer types] +template +CallInst * +IRBuilder::CreateCall(Value *Callee, ArrayRef Args, + ArrayRef OpBundles, + const Twine &Name, MDNode *FPMathTag) { + return CreateCall( + cast(Callee->getType()->getPointerElementType()), + Callee, Args, OpBundles, Name, FPMathTag); +} + // Create wrappers for C Binding types (see CBindingWrapping.h). DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef)