diff options
author | Alexander Musman <alexander.musman@gmail.com> | 2014-06-03 10:16:47 +0000 |
---|---|---|
committer | Alexander Musman <alexander.musman@gmail.com> | 2014-06-03 10:16:47 +0000 |
commit | a8e9d2eccc6e6325cff41741de871c73cebf7f23 (patch) | |
tree | dde2e402f5f5c0df928cd89900c4b01ac5abf491 /clang/lib/Sema/Scope.cpp | |
parent | fd5b2346cce2a0dba21520217b7f8c13b7b0f6c9 (diff) | |
download | bcm5719-llvm-a8e9d2eccc6e6325cff41741de871c73cebf7f23.tar.gz bcm5719-llvm-a8e9d2eccc6e6325cff41741de871c73cebf7f23.zip |
[OPENMP] Loop canonical form analysis (Sema)
This patch implements semantic analysis to make sure that the loop is in OpenMP canonical form.
This is the form required for 'omp simd', 'omp for' and other loop pragmas.
Differential revision: http://reviews.llvm.org/D3778
llvm-svn: 210095
Diffstat (limited to 'clang/lib/Sema/Scope.cpp')
-rw-r--r-- | clang/lib/Sema/Scope.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp index 278b087fad2..860b7c66ec6 100644 --- a/clang/lib/Sema/Scope.cpp +++ b/clang/lib/Sema/Scope.cpp @@ -39,6 +39,10 @@ void Scope::Init(Scope *parent, unsigned flags) { BlockParent = parent->BlockParent; TemplateParamParent = parent->TemplateParamParent; MSLocalManglingParent = parent->MSLocalManglingParent; + if ((Flags & (FnScope | ClassScope | BlockScope | TemplateParamScope | + FunctionPrototypeScope | AtCatchScope | ObjCMethodScope)) == + 0) + Flags |= parent->getFlags() & OpenMPSimdDirectiveScope; } else { Depth = 0; PrototypeDepth = 0; @@ -178,6 +182,12 @@ void Scope::dumpImpl(raw_ostream &OS) const { } else if (Flags & OpenMPDirectiveScope) { OS << "OpenMPDirectiveScope"; Flags &= ~OpenMPDirectiveScope; + } else if (Flags & OpenMPLoopDirectiveScope) { + OS << "OpenMPLoopDirectiveScope"; + Flags &= ~OpenMPLoopDirectiveScope; + } else if (Flags & OpenMPSimdDirectiveScope) { + OS << "OpenMPSimdDirectiveScope"; + Flags &= ~OpenMPSimdDirectiveScope; } if (Flags) |