return true;
}
+template <typename Derived>
+bool RecursiveASTVisitor<Derived>::VisitOMPUpdateClause(OMPUpdateClause *) {
+ return true;
+}
+
template <typename Derived>
template <typename T>
bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *Node) {
StmtRange children() { return StmtRange(); }
};
+/// \brief This represents 'update' clause in the '#pragma omp atomic'
+/// directive.
+///
+/// \code
+/// #pragma omp atomic update
+/// \endcode
+/// In this example directive '#pragma omp atomic' has 'update' clause.
+///
+class OMPUpdateClause : public OMPClause {
+public:
+ /// \brief Build 'update' clause.
+ ///
+ /// \param StartLoc Starting location of the clause.
+ /// \param EndLoc Ending location of the clause.
+ ///
+ OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
+ : OMPClause(OMPC_update, StartLoc, EndLoc) {}
+
+ /// \brief Build an empty clause.
+ ///
+ OMPUpdateClause()
+ : OMPClause(OMPC_update, SourceLocation(), SourceLocation()) {}
+
+ static bool classof(const OMPClause *T) {
+ return T->getClauseKind() == OMPC_update;
+ }
+
+ StmtRange children() { return StmtRange(); }
+};
+
/// \brief This represents clause 'private' in the '#pragma omp ...' directives.
///
/// \code
return true;
}
+template <typename Derived>
+bool RecursiveASTVisitor<Derived>::VisitOMPUpdateClause(OMPUpdateClause *) {
+ return true;
+}
+
template <typename Derived>
template <typename T>
bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *Node) {
def err_omp_atomic_write_not_expression_statement : Error<
"the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
" where x is an l-value expression with scalar type">;
+def err_omp_atomic_update_not_expression_statement : Error<
+ "the statement for 'atomic%select{| update}0' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x',"
+ " where x is an l-value expression with scalar type">;
def err_omp_atomic_several_clauses : Error<
"directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
def note_omp_atomic_previous_clause : Note<
OPENMP_CLAUSE(flush, OMPFlushClause)
OPENMP_CLAUSE(read, OMPReadClause)
OPENMP_CLAUSE(write, OMPWriteClause)
+OPENMP_CLAUSE(update, OMPUpdateClause)
// Clauses allowed for OpenMP directive 'parallel'.
OPENMP_PARALLEL_CLAUSE(if)
// TODO More clauses allowed for OpenMP directive 'atomic'.
OPENMP_ATOMIC_CLAUSE(read)
OPENMP_ATOMIC_CLAUSE(write)
+OPENMP_ATOMIC_CLAUSE(update)
#undef OPENMP_SCHEDULE_KIND
#undef OPENMP_PROC_BIND_KIND
/// \brief Called on well-formed 'write' clause.
OMPClause *ActOnOpenMPWriteClause(SourceLocation StartLoc,
SourceLocation EndLoc);
+ /// \brief Called on well-formed 'update' clause.
+ OMPClause *ActOnOpenMPUpdateClause(SourceLocation StartLoc,
+ SourceLocation EndLoc);
OMPClause *
ActOnOpenMPVarListClause(OpenMPClauseKind Kind, ArrayRef<Expr *> Vars,
void OMPClausePrinter::VisitOMPWriteClause(OMPWriteClause *) { OS << "write"; }
+void OMPClausePrinter::VisitOMPUpdateClause(OMPUpdateClause *) {
+ OS << "update";
+}
+
template<typename T>
void OMPClausePrinter::VisitOMPClauseList(T *Node, char StartSym) {
for (typename T::varlist_iterator I = Node->varlist_begin(),
void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {}
+void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {}
+
template<typename T>
void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
for (auto *I : Node->varlists())
case OMPC_flush:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
break;
}
llvm_unreachable("Invalid OpenMP simple clause kind");
case OMPC_flush:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
break;
}
llvm_unreachable("Invalid OpenMP simple clause kind");
/// | linear-clause | aligned-clause | collapse-clause |
/// lastprivate-clause | reduction-clause | proc_bind-clause |
/// schedule-clause | copyin-clause | copyprivate-clause | untied-clause |
-/// mergeable-clause | flush-clause | read-clause | write-clause
+/// mergeable-clause | flush-clause | read-clause | write-clause |
+/// update-clause
///
OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
OpenMPClauseKind CKind, bool FirstClause) {
case OMPC_mergeable:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
// OpenMP [2.7.1, Restrictions, p. 9]
// Only one ordered clause can appear on a loop directive.
// OpenMP [2.7.1, Restrictions, C/C++, p. 4]
OpenMPClauseKind AtomicKind = OMPC_unknown;
SourceLocation AtomicKindLoc;
for (auto *C : Clauses) {
- if (C->getClauseKind() == OMPC_read || C->getClauseKind() == OMPC_write) {
+ if (C->getClauseKind() == OMPC_read || C->getClauseKind() == OMPC_write ||
+ C->getClauseKind() == OMPC_update) {
if (AtomicKind != OMPC_unknown) {
Diag(C->getLocStart(), diag::err_omp_atomic_several_clauses)
<< SourceRange(C->getLocStart(), C->getLocEnd());
diag::err_omp_atomic_write_not_expression_statement);
return StmtError();
}
+ } else if (AtomicKind == OMPC_update || AtomicKind == OMPC_unknown) {
+ if (!isa<Expr>(CS->getCapturedStmt())) {
+ Diag(CS->getCapturedStmt()->getLocStart(),
+ diag::err_omp_atomic_update_not_expression_statement)
+ << (AtomicKind == OMPC_update);
+ return StmtError();
+ }
}
getCurFunction()->setHasBranchProtectedScope();
case OMPC_flush:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
case OMPC_flush:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
case OMPC_flush:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
case OMPC_write:
Res = ActOnOpenMPWriteClause(StartLoc, EndLoc);
break;
+ case OMPC_update:
+ Res = ActOnOpenMPUpdateClause(StartLoc, EndLoc);
+ break;
case OMPC_if:
case OMPC_final:
case OMPC_num_threads:
return new (Context) OMPWriteClause(StartLoc, EndLoc);
}
+OMPClause *Sema::ActOnOpenMPUpdateClause(SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ return new (Context) OMPUpdateClause(StartLoc, EndLoc);
+}
+
OMPClause *Sema::ActOnOpenMPVarListClause(
OpenMPClauseKind Kind, ArrayRef<Expr *> VarList, Expr *TailExpr,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc,
case OMPC_threadprivate:
case OMPC_read:
case OMPC_write:
+ case OMPC_update:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
return C;
}
+template <typename Derived>
+OMPClause *
+TreeTransform<Derived>::TransformOMPUpdateClause(OMPUpdateClause *C) {
+ // No need to rebuild this clause, no template-dependent parameters.
+ return C;
+}
+
template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *C) {
case OMPC_write:
C = new (Context) OMPWriteClause();
break;
+ case OMPC_update:
+ C = new (Context) OMPUpdateClause();
+ break;
case OMPC_private:
C = OMPPrivateClause::CreateEmpty(Context, Record[Idx++]);
break;
void OMPClauseReader::VisitOMPWriteClause(OMPWriteClause *) {}
+void OMPClauseReader::VisitOMPUpdateClause(OMPUpdateClause *) {}
+
void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) {
C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
unsigned NumVars = C->varlist_size();
void OMPClauseWriter::VisitOMPWriteClause(OMPWriteClause *) {}
+void OMPClauseWriter::VisitOMPUpdateClause(OMPUpdateClause *) {}
+
void OMPClauseWriter::VisitOMPPrivateClause(OMPPrivateClause *C) {
Record.push_back(C->varlist_size());
Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
a = argc;
#pragma omp atomic write
a = argc + argc;
+#pragma omp atomic update
+ a = a + argc;
return T();
}
// CHECK-NEXT: a = argc;
// CHECK-NEXT: #pragma omp atomic write
// CHECK-NEXT: a = argc + argc;
+// CHECK-NEXT: #pragma omp atomic update
+// CHECK-NEXT: a = a + argc;
// CHECK: T a = T();
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: a = argc;
// CHECK-NEXT: #pragma omp atomic write
// CHECK-NEXT: a = argc + argc;
+// CHECK-NEXT: #pragma omp atomic update
+// CHECK-NEXT: a = a + argc;
int main(int argc, char **argv) {
int a = 0;
a = argc;
#pragma omp atomic write
a = argc + argc;
+#pragma omp atomic update
+ a = a + argc;
// CHECK-NEXT: #pragma omp atomic
// CHECK-NEXT: a++;
// CHECK-NEXT: #pragma omp atomic read
// CHECK-NEXT: a = argc;
// CHECK-NEXT: #pragma omp atomic write
// CHECK-NEXT: a = argc + argc;
+ // CHECK-NEXT: #pragma omp atomic update
+ // CHECK-NEXT: a = a + argc;
return foo(a);
}
L1:
foo();
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
foo();
goto L1; // expected-error {{use of undeclared label 'L1'}}
}
goto L2; // expected-error {{use of undeclared label 'L2'}}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
foo();
L2:
return write<int>();
}
+template <class T>
+T update() {
+ T a, b = 0;
+// Test for atomic update
+#pragma omp atomic update
+// expected-error@+1 {{the statement for 'atomic update' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
+ ;
+// expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'update' clause}}
+#pragma omp atomic update update
+ a += b;
+
+#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
+ ;
+
+ return T();
+}
+
+int update() {
+ int a, b = 0;
+// Test for atomic update
+#pragma omp atomic update
+// expected-error@+1 {{the statement for 'atomic update' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
+ ;
+// expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'update' clause}}
+#pragma omp atomic update update
+ a += b;
+
+#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
+ ;
+
+ return update<int>();
+}
+
template <class T>
T mixed() {
T a, b = T();
// expected-note@+1 2 {{'write' clause used here}}
#pragma omp atomic write read
a = b;
+// expected-error@+2 2 {{directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause}}
+// expected-note@+1 2 {{'update' clause used here}}
+#pragma omp atomic update read
+ a += b;
return T();
}
// expected-note@+1 {{'write' clause used here}}
#pragma omp atomic write read
a = b;
+// expected-error@+2 {{directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause}}
+// expected-note@+1 {{'write' clause used here}}
+#pragma omp atomic write update
+ a = b;
// expected-note@+1 {{in instantiation of function template specialization 'mixed<int>' requested here}}
return mixed<int>();
}
// ATOMIC DIRECTIVE
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp section // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp single // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp master // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp task // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp flush // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
++a;
// ATOMIC DIRECTIVE
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp section // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp single // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp master // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp task // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
}
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp flush // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
bar();
}
#pragma omp atomic
+// expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
{
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
++a;
void OMPClauseEnqueue::VisitOMPWriteClause(const OMPWriteClause *) {}
+void OMPClauseEnqueue::VisitOMPUpdateClause(const OMPUpdateClause *) {}
+
template<typename T>
void OMPClauseEnqueue::VisitOMPClauseList(T *Node) {
for (const auto *I : Node->varlists())