diff options
author | Michael Wong <fraggamuffin@gmail.com> | 2015-07-21 13:44:28 +0000 |
---|---|---|
committer | Michael Wong <fraggamuffin@gmail.com> | 2015-07-21 13:44:28 +0000 |
commit | 65f367fcbbf38e599b2f747ca101c97d40c6420d (patch) | |
tree | fb0045186e3262cb10d2e591043d47cbba1c2b18 /clang/lib/Sema/SemaOpenMP.cpp | |
parent | fbb86b2350e58876c243c882b3315c45888453dc (diff) | |
download | bcm5719-llvm-65f367fcbbf38e599b2f747ca101c97d40c6420d.tar.gz bcm5719-llvm-65f367fcbbf38e599b2f747ca101c97d40c6420d.zip |
Commit for http://reviews.llvm.org/D10765
for OpenMP 4 target data directive parsing and sema.
This commit is on behalf of Kelvin Li.
llvm-svn: 242785
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 90b8f712af7..d1ce30712e2 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -1300,6 +1300,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) { Params); break; } + case OMPD_target_data: case OMPD_target: { Sema::CapturedParamNameType Params[] = { std::make_pair(StringRef(), QualType()) // __context with shared vars @@ -2124,6 +2125,10 @@ StmtResult Sema::ActOnOpenMPExecutableDirective( "No associated statement allowed for 'omp cancel' directive"); Res = ActOnOpenMPCancelDirective(StartLoc, EndLoc, CancelRegion); break; + case OMPD_target_data: + Res = ActOnOpenMPTargetDataDirective(ClausesWithImplicit, AStmt, StartLoc, + EndLoc); + break; case OMPD_threadprivate: llvm_unreachable("OpenMP Directive is not allowed"); case OMPD_unknown: @@ -4320,6 +4325,16 @@ StmtResult Sema::ActOnOpenMPTargetDirective(ArrayRef<OMPClause *> Clauses, return OMPTargetDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt); } +StmtResult Sema::ActOnOpenMPTargetDataDirective(ArrayRef<OMPClause *> Clauses, + Stmt *AStmt, + SourceLocation StartLoc, + SourceLocation EndLoc) { + getCurFunction()->setHasBranchProtectedScope(); + + return OMPTargetDataDirective::Create(Context, StartLoc, EndLoc, Clauses, + AStmt); +} + StmtResult Sema::ActOnOpenMPTeamsDirective(ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc) { @@ -6593,4 +6608,3 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, return OMPDependClause::Create(Context, StartLoc, LParenLoc, EndLoc, DepKind, DepLoc, ColonLoc, Vars); } - |