================
@@ -6824,6 +6824,26 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
         Address(Handle, Handle->getType(), CGM.getPointerAlign()));
     Callee.setFunctionPointer(Stub);
   }
+
+  // Insert function pointer lookup if this is a target call
+  //
+  // This is used for the indirect function case, virtual function case is
+  // handled in ItaniumCXXABI.cpp
+  if (getLangOpts().OpenMPIsTargetDevice &&
+      getContext().OMPTargetCalls.contains(E)) {
+    auto *PtrTy = CGM.VoidPtrTy;
+    llvm::Type *RtlFnArgs[] = {PtrTy};
+    llvm::FunctionCallee DeviceRtlFn = CGM.CreateRuntimeFunction(
+        llvm::FunctionType::get(PtrTy, RtlFnArgs, false),
+        "__llvm_omp_indirect_call_lookup");
----------------
Jason-Van-Beusekom wrote:

This was originally `__kmpc_omp_indirect_call_lookup` but was changed to 
`__llvm_omp_indirect_call_lookup` after feedback from @jhuber6.

The main argument was to be more inline with other API functions, looking back 
at the comment it looks like unfortunately with the rebase to be include the 
changes in https://github.com/llvm/llvm-project/pull/167011
and https://github.com/llvm/llvm-project/pull/159856 the history of this change 
was lost. 

https://github.com/llvm/llvm-project/pull/159857
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to