================
@@ -6350,6 +6367,16 @@ void CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(
       [&CGF, &D, &CodeGen](StringRef EntryFnName) {
         const CapturedStmt &CS = *D.getCapturedStmt(OMPD_target);
 
+        // Search Clang AST within "omp target" region for CallExprs.
+        // Store them in the set OMPTargetCalls (kept by CodeGenModule).
+        // This is used for the translation of indirect function calls.
+        const auto &LangOpts = CGF.getLangOpts();
+        if (LangOpts.OpenMPIsTargetDevice) {
+          // Search AST for target "CallExpr"s of "OMPTargetAutoLookup".
+          OMPTargetCallCollector Visitor(CGF.CGM.OMPTargetCalls);
+          Visitor.TraverseStmt(const_cast<Stmt *>(CS.getCapturedStmt()));
----------------
Jason-VanBeusekom wrote:

Updated in 
[7abe486](https://github.com/llvm/llvm-project/pull/159857/commits/7abe4866545d063d6478351c837d9e76f4684c1f),
 indirect calls in OMP Target regions are now marked in `SemaOpenMP.cpp` in the 
ASTcontext.

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