From 440f6bdf34f4ce3ac3435d650f5296dcc0102488 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Tue, 16 Mar 2021 13:28:06 +0000 Subject: [OpenCL][NFCI] Prefer CodeGenFunction::EmitRuntimeCall `CodeGenFunction::EmitRuntimeCall` automatically sets the right calling convention for the callee so we can avoid setting it ourselves. As requested in https://reviews.llvm.org/D98411 Reviewed by: anastasia Differential Revision: https://reviews.llvm.org/D98705 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 75854f69b110..f3a73f8783dc 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -6265,9 +6265,8 @@ CodeGenModule::createOpenCLIntToSamplerConversion(const Expr *E, llvm::Constant *C = ConstantEmitter(CGF).emitAbstract(E, E->getType()); auto *SamplerT = getOpenCLRuntime().getSamplerType(E->getType().getTypePtr()); auto *FTy = llvm::FunctionType::get(SamplerT, {C->getType()}, false); - auto *Call = CGF.Builder.CreateCall( + auto *Call = CGF.EmitRuntimeCall( CreateRuntimeFunction(FTy, "__translate_sampler_initializer"), {C}); - Call->setCallingConv(Call->getCalledFunction()->getCallingConv()); return Call; } -- cgit v1.2.3