[clang] [llvm] [OpenMP][clang] Register Vtables on device for indirect calls (PR #159856)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 06:34:59 PDT 2025


================
@@ -9955,6 +10062,19 @@ void CGOpenMPRuntime::scanForTargetRegionsFunctions(const Stmt *S,
   if (!S)
     return;
 
+  // Register vtable from device for target data and target directives.
+  // Add this block here since scanForTargetRegionsFunctions ignores
+  // target data by checking if S is a executable directive (target).
+  if (isa<OMPExecutableDirective>(S) &&
+      isOpenMPTargetDataManagementDirective(
+          dyn_cast<OMPExecutableDirective>(S)->getDirectiveKind())) {
----------------
alexey-bataev wrote:

```suggestion
  if (auto *E = dyn_cast<OMPExecutableDirective>(S);E &&
      isOpenMPTargetDataManagementDirective(
          E->getDirectiveKind())) {
```

https://github.com/llvm/llvm-project/pull/159856


More information about the llvm-commits mailing list