================ @@ -709,10 +709,44 @@ bool clang::isOpenMPExecutableDirective(OpenMPDirectiveKind DKind) { return Cat == Category::Executable || Cat == Category::Subsidiary; } +bool clang::isOpenMPCapturingDirective(OpenMPDirectiveKind DKind) { + if (isOpenMPExecutableDirective(DKind)) { + switch (DKind) { + case OMPD_atomic: + case OMPD_barrier: + case OMPD_cancel: + case OMPD_cancellation_point: + case OMPD_critical: + case OMPD_depobj: + case OMPD_error: + case OMPD_flush: + case OMPD_masked: + case OMPD_master: + case OMPD_section: + case OMPD_taskwait: + case OMPD_taskyield: + return false; + default: + return !isOpenMPLoopTransformationDirective(DKind); + } + } + // Non-executable directives. + switch (DKind) { + case OMPD_metadirective: + case OMPD_nothing: + return true; + default: + break; + } + return false; +} + void clang::getOpenMPCaptureRegions( SmallVectorImpl<OpenMPDirectiveKind> &CaptureRegions, OpenMPDirectiveKind DKind) { assert(unsigned(DKind) < llvm::omp::Directive_enumSize); + assert(isOpenMPCapturingDirective(DKind)); ---------------- kparzysz wrote:
Done. https://github.com/llvm/llvm-project/pull/97090 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits