From: Alexey Bataev Date: Mon, 30 Jun 2014 10:22:46 +0000 (+0000) Subject: [OPENMP] Added table with allowed nesting info for OpenMP regions (per request from... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92b1476ea6c20682a5dc59bec72da06512bcd405;p=clang [OPENMP] Added table with allowed nesting info for OpenMP regions (per request from Samuel F Antao). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212034 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 6ff617fc17..c7e377e218 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -971,6 +971,52 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) { bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, OpenMPDirectiveKind CurrentRegion, SourceLocation StartLoc) { + // Allowed nesting of constructs + // +------------------+-----------------+------------------------------------+ + // | Parent directive | Child directive | Closely (!), No-Closely(+), Both(*)| + // +------------------+-----------------+------------------------------------+ + // | parallel | parallel | * | + // | parallel | for | * | + // | parallel | simd | * | + // | parallel | sections | * | + // | parallel | section | + | + // | parallel | single | * | + // +------------------+-----------------+------------------------------------+ + // | for | parallel | * | + // | for | for | + | + // | for | simd | * | + // | for | sections | + | + // | for | section | + | + // | for | single | + | + // +------------------+-----------------+------------------------------------+ + // | simd | parallel | | + // | simd | for | | + // | simd | simd | | + // | simd | sections | | + // | simd | section | | + // | simd | single | | + // +------------------+-----------------+------------------------------------+ + // | sections | parallel | * | + // | sections | for | + | + // | sections | simd | * | + // | sections | sections | + | + // | sections | section | * | + // | sections | single | + | + // +------------------+-----------------+------------------------------------+ + // | section | parallel | * | + // | section | for | + | + // | section | simd | * | + // | section | sections | + | + // | section | section | + | + // | section | single | + | + // +------------------+-----------------+------------------------------------+ + // | single | parallel | * | + // | single | for | + | + // | single | simd | * | + // | single | sections | + | + // | single | section | + | + // | single | single | + | + // +------------------+-----------------+------------------------------------+ if (Stack->getCurScope()) { auto ParentRegion = Stack->getParentDirective(); bool NestingProhibited = false;