summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-06-20 09:44:06 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-06-20 09:44:06 +0000
commit98a11d0048dc90a55b17398421988ee8be3480da (patch)
treeb9ed61705a72dd80d194cfa5ee5148561581e1df /lib/Sema/SemaOpenMP.cpp
parent912088d40a7b0a0b2bddb641a7a583116126c68f (diff)
downloadclang-98a11d0048dc90a55b17398421988ee8be3480da.tar.gz
clang-98a11d0048dc90a55b17398421988ee8be3480da.tar.bz2
clang-98a11d0048dc90a55b17398421988ee8be3480da.tar.xz
[OPENMP] Initial support for 'ordered' clause.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOpenMP.cpp')
-rw-r--r--lib/Sema/SemaOpenMP.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp
index 515bd5f8c4..23c003815a 100644
--- a/lib/Sema/SemaOpenMP.cpp
+++ b/lib/Sema/SemaOpenMP.cpp
@@ -1522,6 +1522,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr,
case OMPC_linear:
case OMPC_aligned:
case OMPC_copyin:
+ case OMPC_ordered:
case OMPC_threadprivate:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
@@ -1699,6 +1700,7 @@ OMPClause *Sema::ActOnOpenMPSimpleClause(
case OMPC_linear:
case OMPC_aligned:
case OMPC_copyin:
+ case OMPC_ordered:
case OMPC_threadprivate:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
@@ -1807,6 +1809,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprWithArgClause(
case OMPC_linear:
case OMPC_aligned:
case OMPC_copyin:
+ case OMPC_ordered:
case OMPC_threadprivate:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
@@ -1870,6 +1873,41 @@ OMPClause *Sema::ActOnOpenMPScheduleClause(
EndLoc, Kind, ValExpr);
}
+OMPClause *Sema::ActOnOpenMPClause(OpenMPClauseKind Kind,
+ SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ OMPClause *Res = nullptr;
+ switch (Kind) {
+ case OMPC_ordered:
+ Res = ActOnOpenMPOrderedClause(StartLoc, EndLoc);
+ break;
+ case OMPC_if:
+ case OMPC_num_threads:
+ case OMPC_safelen:
+ case OMPC_collapse:
+ case OMPC_schedule:
+ case OMPC_private:
+ case OMPC_firstprivate:
+ case OMPC_lastprivate:
+ case OMPC_shared:
+ case OMPC_reduction:
+ case OMPC_linear:
+ case OMPC_aligned:
+ case OMPC_copyin:
+ case OMPC_default:
+ case OMPC_proc_bind:
+ case OMPC_threadprivate:
+ case OMPC_unknown:
+ llvm_unreachable("Clause is not allowed.");
+ }
+ return Res;
+}
+
+OMPClause *Sema::ActOnOpenMPOrderedClause(SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ return new (Context) OMPOrderedClause(StartLoc, EndLoc);
+}
+
OMPClause *Sema::ActOnOpenMPVarListClause(
OpenMPClauseKind Kind, ArrayRef<Expr *> VarList, Expr *TailExpr,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc,
@@ -1911,6 +1949,7 @@ OMPClause *Sema::ActOnOpenMPVarListClause(
case OMPC_default:
case OMPC_proc_bind:
case OMPC_schedule:
+ case OMPC_ordered:
case OMPC_threadprivate:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");