diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-18 04:14:57 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-18 04:14:57 +0000 |
commit | f29276edb7b9c85c9f521eb3e301259bee17aa33 (patch) | |
tree | 5173803cd839d4c3ab843cd43945471c7296784f /clang/lib/Parse/ParseOpenMP.cpp | |
parent | 0039f3f0607702f2d16d60addff74c67869e2144 (diff) | |
download | bcm5719-llvm-f29276edb7b9c85c9f521eb3e301259bee17aa33.tar.gz bcm5719-llvm-f29276edb7b9c85c9f521eb3e301259bee17aa33.zip |
[OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with MSVC).
llvm-svn: 211140
Diffstat (limited to 'clang/lib/Parse/ParseOpenMP.cpp')
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index 9c52d645cfd..9ea1e7f8380 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -62,6 +62,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirective() { case OMPD_parallel: case OMPD_simd: case OMPD_task: + case OMPD_for: Diag(Tok, diag::err_omp_unexpected_directive) << getOpenMPDirectiveName(DKind); break; @@ -114,9 +115,15 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective() { SkipUntil(tok::annot_pragma_openmp_end); break; case OMPD_parallel: - case OMPD_simd: { + case OMPD_simd: + case OMPD_for: { ConsumeToken(); + if (isOpenMPLoopDirective(DKind)) + ScopeFlags |= Scope::OpenMPLoopDirectiveScope; + if (isOpenMPSimdDirective(DKind)) + ScopeFlags |= Scope::OpenMPSimdDirectiveScope; + ParseScope OMPDirectiveScope(this, ScopeFlags); Actions.StartOpenMPDSABlock(DKind, DirName, Actions.getCurScope()); while (Tok.isNot(tok::annot_pragma_openmp_end)) { @@ -142,10 +149,6 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective() { StmtResult AssociatedStmt; bool CreateDirective = true; - if (DKind == OMPD_simd) - ScopeFlags |= - Scope::OpenMPLoopDirectiveScope | Scope::OpenMPSimdDirectiveScope; - ParseScope OMPDirectiveScope(this, ScopeFlags); { // The body is a block scope like in Lambdas and Blocks. Sema::CompoundScopeRAII CompoundScope(Actions); |