summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorLuke Drummond <luke.drummond@codeplay.com>2021-03-16 13:28:06 +0000
committerLuke Drummond <luke.drummond@codeplay.com>2021-03-16 16:22:19 +0000
commit440f6bdf34f4ce3ac3435d650f5296dcc0102488 (patch)
tree973470eb9d101b59dd1eda6e4e635b7b0ff4fda5 /clang/lib/CodeGen/CodeGenModule.cpp
parentd2eae990a1bd0efcd2838187627d6e02ea23d998 (diff)
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 1 insertions, 2 deletions
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;
}