[OPENMP50]Add support for 'release' clause.
Added full support for 'release' clause in flush|atomic directives.
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index ed2320c..2e3c75f 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -4989,6 +4989,7 @@
case OMPC_seq_cst:
case OMPC_acq_rel:
case OMPC_acquire:
+ case OMPC_release:
case OMPC_depend:
case OMPC_threads:
case OMPC_simd:
@@ -8575,9 +8576,9 @@
OpenMPClauseKind MemOrderKind = OMPC_unknown;
SourceLocation MemOrderLoc;
for (const OMPClause *C : Clauses) {
- if (C->getClauseKind() == OMPC_seq_cst ||
- C->getClauseKind() == OMPC_acq_rel ||
- C->getClauseKind() == OMPC_acquire) {
+ if (C->getClauseKind() == OMPC_acq_rel ||
+ C->getClauseKind() == OMPC_acquire ||
+ C->getClauseKind() == OMPC_release) {
if (MemOrderKind != OMPC_unknown) {
Diag(C->getBeginLoc(), diag::err_omp_several_mem_order_clauses)
<< getOpenMPDirectiveName(OMPD_flush) << 1
@@ -8953,7 +8954,8 @@
}
if (C->getClauseKind() == OMPC_seq_cst ||
C->getClauseKind() == OMPC_acq_rel ||
- C->getClauseKind() == OMPC_acquire) {
+ C->getClauseKind() == OMPC_acquire ||
+ C->getClauseKind() == OMPC_release) {
if (MemOrderKind != OMPC_unknown) {
Diag(C->getBeginLoc(), diag::err_omp_several_mem_order_clauses)
<< getOpenMPDirectiveName(OMPD_atomic) << 0
@@ -10893,6 +10895,7 @@
case OMPC_seq_cst:
case OMPC_acq_rel:
case OMPC_acquire:
+ case OMPC_release:
case OMPC_depend:
case OMPC_threads:
case OMPC_simd:
@@ -11607,6 +11610,7 @@
case OMPC_seq_cst:
case OMPC_acq_rel:
case OMPC_acquire:
+ case OMPC_release:
case OMPC_depend:
case OMPC_threads:
case OMPC_simd:
@@ -12031,6 +12035,7 @@
case OMPC_seq_cst:
case OMPC_acq_rel:
case OMPC_acquire:
+ case OMPC_release:
case OMPC_depend:
case OMPC_device:
case OMPC_threads:
@@ -12233,6 +12238,7 @@
case OMPC_seq_cst:
case OMPC_acq_rel:
case OMPC_acquire:
+ case OMPC_release:
case OMPC_depend:
case OMPC_device:
case OMPC_threads:
@@ -12412,6 +12418,9 @@
case OMPC_acquire:
Res = ActOnOpenMPAcquireClause(StartLoc, EndLoc);
break;
+ case OMPC_release:
+ Res = ActOnOpenMPReleaseClause(StartLoc, EndLoc);
+ break;
case OMPC_threads:
Res = ActOnOpenMPThreadsClause(StartLoc, EndLoc);
break;
@@ -12535,6 +12544,11 @@
return new (Context) OMPAcquireClause(StartLoc, EndLoc);
}
+OMPClause *Sema::ActOnOpenMPReleaseClause(SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ return new (Context) OMPReleaseClause(StartLoc, EndLoc);
+}
+
OMPClause *Sema::ActOnOpenMPThreadsClause(SourceLocation StartLoc,
SourceLocation EndLoc) {
return new (Context) OMPThreadsClause(StartLoc, EndLoc);
@@ -12693,6 +12707,7 @@
case OMPC_seq_cst:
case OMPC_acq_rel:
case OMPC_acquire:
+ case OMPC_release:
case OMPC_device:
case OMPC_threads:
case OMPC_simd: