summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-06-26 12:05:45 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-06-26 12:05:45 +0000
commitd1e40fbfe1c38f5778c739d1fc1b3bcf156ccb58 (patch)
tree30b273a3b64072c964ed33986d2de6362af8c7d8 /clang/lib/Sema/SemaOpenMP.cpp
parentaee45418287cdcc1387c56e0c0d08990c322b45b (diff)
downloadbcm5719-llvm-d1e40fbfe1c38f5778c739d1fc1b3bcf156ccb58.tar.gz
bcm5719-llvm-d1e40fbfe1c38f5778c739d1fc1b3bcf156ccb58.zip
[OPENMP] Initial parsing and sema analysis for 'single' directive.
llvm-svn: 211774
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index ba441a2b14e..7f3560fc018 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -924,6 +924,13 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, SourceLocation Loc,
ActOnCapturedRegionStart(Loc, CurScope, CR_OpenMP, Params);
break;
}
+ case OMPD_single: {
+ Sema::CapturedParamNameType Params[] = {
+ std::make_pair(StringRef(), QualType()) // __context with shared vars
+ };
+ ActOnCapturedRegionStart(Loc, CurScope, CR_OpenMP, Params);
+ break;
+ }
case OMPD_threadprivate:
case OMPD_task:
llvm_unreachable("OpenMP Directive is not allowed");
@@ -1033,6 +1040,10 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind,
"No clauses is allowed for 'omp section' directive");
Res = ActOnOpenMPSectionDirective(AStmt, StartLoc, EndLoc);
break;
+ case OMPD_single:
+ Res = ActOnOpenMPSingleDirective(ClausesWithImplicit, AStmt, StartLoc,
+ EndLoc);
+ break;
case OMPD_threadprivate:
case OMPD_task:
llvm_unreachable("OpenMP Directive is not allowed");
@@ -1647,6 +1658,14 @@ StmtResult Sema::ActOnOpenMPSectionDirective(Stmt *AStmt,
return OMPSectionDirective::Create(Context, StartLoc, EndLoc, AStmt);
}
+StmtResult Sema::ActOnOpenMPSingleDirective(ArrayRef<OMPClause *> Clauses,
+ Stmt *AStmt,
+ SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ getCurFunction()->setHasBranchProtectedScope();
+ return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
+}
+
OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr,
SourceLocation StartLoc,
SourceLocation LParenLoc,
OpenPOWER on IntegriCloud