[clang] [llvm] OpenMP offload 'simd' directive (PR #91261)

Johannes Doerfert via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 27 16:33:58 PDT 2024


================
@@ -336,13 +337,15 @@ class CheckVarsEscapingDeclContext final
       return;
     if (!D->hasAssociatedStmt())
       return;
+
     if (const auto *S =
             dyn_cast_or_null<CapturedStmt>(D->getAssociatedStmt())) {
       // Do not analyze directives that do not actually require capturing,
       // like `omp for` or `omp simd` directives.
       llvm::SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
       getOpenMPCaptureRegions(CaptureRegions, D->getDirectiveKind());
-      if (CaptureRegions.size() == 1 && CaptureRegions.back() == OMPD_unknown) {
+      if (CaptureRegions.size() == 1 && CaptureRegions.back() == OMPD_unknown &&
+          D->getDirectiveKind() != OMPD_simd) {
----------------
jdoerfert wrote:

Why is simd special here and needs to be checked?

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


More information about the cfe-commits mailing list