`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
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;
}