<div dir="ltr">This looks good. The update clause is the same as when atomic is alone without any clause. This is similar to:<br><div><span style="font-family:arial,sans-serif;font-size:18px">r213639 - [OPENMP] </span><span style="font-family:arial,sans-serif;font-size:18px">Initial parsing and sema analysis for 'atomic' directive</span><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 23, 2014 at 6:25 AM, Alexey Bataev <span dir="ltr"><<a href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: abataev<br>
Date: Wed Jul 23 05:25:33 2014<br>
New Revision: 213735<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=213735&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=213735&view=rev</a><br>
Log:<br>
[OPENMP] Initial parsing and sema analysis for 'update' clause of 'atomic' directive.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h<br>
    cfe/trunk/include/clang/AST/OpenMPClause.h<br>
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
    cfe/trunk/include/clang/Basic/OpenMPKinds.def<br>
    cfe/trunk/include/clang/Sema/Sema.h<br>
    cfe/trunk/lib/AST/StmtPrinter.cpp<br>
    cfe/trunk/lib/AST/StmtProfile.cpp<br>
    cfe/trunk/lib/Basic/OpenMPKinds.cpp<br>
    cfe/trunk/lib/Parse/ParseOpenMP.cpp<br>
    cfe/trunk/lib/Sema/SemaOpenMP.cpp<br>
    cfe/trunk/lib/Sema/TreeTransform.h<br>
    cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
    cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
    cfe/trunk/test/OpenMP/atomic_ast_print.cpp<br>
    cfe/trunk/test/OpenMP/atomic_messages.cpp<br>
    cfe/trunk/test/OpenMP/nesting_of_regions.cpp<br>
    cfe/trunk/tools/libclang/CIndex.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h (original)<br>
+++ cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h Wed Jul 23 05:25:33 2014<br>
@@ -2431,6 +2431,11 @@ bool RecursiveASTVisitor<Derived>::Visit<br>
 }<br>
<br>
 template <typename Derived><br>
+bool RecursiveASTVisitor<Derived>::VisitOMPUpdateClause(OMPUpdateClause *) {<br>
+  return true;<br>
+}<br>
+<br>
+template <typename Derived><br>
 template <typename T><br>
 bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *Node) {<br>
   for (auto *E : Node->varlists()) {<br>
<br>
Modified: cfe/trunk/include/clang/AST/OpenMPClause.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OpenMPClause.h?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OpenMPClause.h?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/AST/OpenMPClause.h (original)<br>
+++ cfe/trunk/include/clang/AST/OpenMPClause.h Wed Jul 23 05:25:33 2014<br>
@@ -827,6 +827,36 @@ public:<br>
   StmtRange children() { return StmtRange(); }<br>
 };<br>
<br>
+/// \brief This represents 'update' clause in the '#pragma omp atomic'<br>
+/// directive.<br>
+///<br>
+/// \code<br>
+/// #pragma omp atomic update<br>
+/// \endcode<br>
+/// In this example directive '#pragma omp atomic' has 'update' clause.<br>
+///<br>
+class OMPUpdateClause : public OMPClause {<br>
+public:<br>
+  /// \brief Build 'update' clause.<br>
+  ///<br>
+  /// \param StartLoc Starting location of the clause.<br>
+  /// \param EndLoc Ending location of the clause.<br>
+  ///<br>
+  OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)<br>
+      : OMPClause(OMPC_update, StartLoc, EndLoc) {}<br>
+<br>
+  /// \brief Build an empty clause.<br>
+  ///<br>
+  OMPUpdateClause()<br>
+      : OMPClause(OMPC_update, SourceLocation(), SourceLocation()) {}<br>
+<br>
+  static bool classof(const OMPClause *T) {<br>
+    return T->getClauseKind() == OMPC_update;<br>
+  }<br>
+<br>
+  StmtRange children() { return StmtRange(); }<br>
+};<br>
+<br>
 /// \brief This represents clause 'private' in the '#pragma omp ...' directives.<br>
 ///<br>
 /// \code<br>
<br>
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)<br>
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Jul 23 05:25:33 2014<br>
@@ -2453,6 +2453,11 @@ bool RecursiveASTVisitor<Derived>::Visit<br>
 }<br>
<br>
 template <typename Derived><br>
+bool RecursiveASTVisitor<Derived>::VisitOMPUpdateClause(OMPUpdateClause *) {<br>
+  return true;<br>
+}<br>
+<br>
+template <typename Derived><br>
 template <typename T><br>
 bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *Node) {<br>
   for (auto *E : Node->varlists()) {<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Jul 23 05:25:33 2014<br>
@@ -7154,6 +7154,9 @@ def err_omp_atomic_read_not_expression_s<br>
 def err_omp_atomic_write_not_expression_statement : Error<<br>
   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"<br>
   " where x is an l-value expression with scalar type">;<br>
+def err_omp_atomic_update_not_expression_statement : Error<<br>
+  "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',"<br>

+  " where x is an l-value expression with scalar type">;<br>
 def err_omp_atomic_several_clauses : Error<<br>
   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;<br>
 def note_omp_atomic_previous_clause : Note<<br>
<br>
Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Basic/OpenMPKinds.def (original)<br>
+++ cfe/trunk/include/clang/Basic/OpenMPKinds.def Wed Jul 23 05:25:33 2014<br>
@@ -103,6 +103,7 @@ OPENMP_CLAUSE(mergeable, OMPMergeableCla<br>
 OPENMP_CLAUSE(flush, OMPFlushClause)<br>
 OPENMP_CLAUSE(read, OMPReadClause)<br>
 OPENMP_CLAUSE(write, OMPWriteClause)<br>
+OPENMP_CLAUSE(update, OMPUpdateClause)<br>
<br>
 // Clauses allowed for OpenMP directive 'parallel'.<br>
 OPENMP_PARALLEL_CLAUSE(if)<br>
@@ -203,6 +204,7 @@ OPENMP_TASK_CLAUSE(mergeable)<br>
 // TODO More clauses allowed for OpenMP directive 'atomic'.<br>
 OPENMP_ATOMIC_CLAUSE(read)<br>
 OPENMP_ATOMIC_CLAUSE(write)<br>
+OPENMP_ATOMIC_CLAUSE(update)<br>
<br>
 #undef OPENMP_SCHEDULE_KIND<br>
 #undef OPENMP_PROC_BIND_KIND<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Jul 23 05:25:33 2014<br>
@@ -7488,6 +7488,9 @@ public:<br>
   /// \brief Called on well-formed 'write' clause.<br>
   OMPClause *ActOnOpenMPWriteClause(SourceLocation StartLoc,<br>
                                     SourceLocation EndLoc);<br>
+  /// \brief Called on well-formed 'update' clause.<br>
+  OMPClause *ActOnOpenMPUpdateClause(SourceLocation StartLoc,<br>
+                                     SourceLocation EndLoc);<br>
<br>
   OMPClause *<br>
   ActOnOpenMPVarListClause(OpenMPClauseKind Kind, ArrayRef<Expr *> Vars,<br>
<br>
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Wed Jul 23 05:25:33 2014<br>
@@ -669,6 +669,10 @@ void OMPClausePrinter::VisitOMPReadClaus<br>
<br>
 void OMPClausePrinter::VisitOMPWriteClause(OMPWriteClause *) { OS << "write"; }<br>
<br>
+void OMPClausePrinter::VisitOMPUpdateClause(OMPUpdateClause *) {<br>
+  OS << "update";<br>
+}<br>
+<br>
 template<typename T><br>
 void OMPClausePrinter::VisitOMPClauseList(T *Node, char StartSym) {<br>
   for (typename T::varlist_iterator I = Node->varlist_begin(),<br>
<br>
Modified: cfe/trunk/lib/AST/StmtProfile.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)<br>
+++ cfe/trunk/lib/AST/StmtProfile.cpp Wed Jul 23 05:25:33 2014<br>
@@ -314,6 +314,8 @@ void OMPClauseProfiler::VisitOMPReadClau<br>
<br>
 void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {}<br>
<br>
+void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {}<br>
+<br>
 template<typename T><br>
 void OMPClauseProfiler::VisitOMPClauseList(T *Node) {<br>
   for (auto *I : Node->varlists())<br>
<br>
Modified: cfe/trunk/lib/Basic/OpenMPKinds.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Basic/OpenMPKinds.cpp (original)<br>
+++ cfe/trunk/lib/Basic/OpenMPKinds.cpp Wed Jul 23 05:25:33 2014<br>
@@ -110,6 +110,7 @@ unsigned clang::getOpenMPSimpleClauseTyp<br>
   case OMPC_flush:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
     break;<br>
   }<br>
   llvm_unreachable("Invalid OpenMP simple clause kind");<br>
@@ -171,6 +172,7 @@ const char *clang::getOpenMPSimpleClause<br>
   case OMPC_flush:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
     break;<br>
   }<br>
   llvm_unreachable("Invalid OpenMP simple clause kind");<br>
<br>
Modified: cfe/trunk/lib/Parse/ParseOpenMP.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Parse/ParseOpenMP.cpp (original)<br>
+++ cfe/trunk/lib/Parse/ParseOpenMP.cpp Wed Jul 23 05:25:33 2014<br>
@@ -342,7 +342,8 @@ bool Parser::ParseOpenMPSimpleVarList(Op<br>
 ///       | linear-clause | aligned-clause | collapse-clause |<br>
 ///       lastprivate-clause | reduction-clause | proc_bind-clause |<br>
 ///       schedule-clause | copyin-clause | copyprivate-clause | untied-clause |<br>
-///       mergeable-clause | flush-clause | read-clause | write-clause<br>
+///       mergeable-clause | flush-clause | read-clause | write-clause |<br>
+///       update-clause<br>
 ///<br>
 OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,<br>
                                      OpenMPClauseKind CKind, bool FirstClause) {<br>
@@ -410,6 +411,7 @@ OMPClause *Parser::ParseOpenMPClause(Ope<br>
   case OMPC_mergeable:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
     // OpenMP [2.7.1, Restrictions, p. 9]<br>
     //  Only one ordered clause can appear on a loop directive.<br>
     // OpenMP [2.7.1, Restrictions, C/C++, p. 4]<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Wed Jul 23 05:25:33 2014<br>
@@ -2389,7 +2389,8 @@ StmtResult Sema::ActOnOpenMPAtomicDirect<br>
   OpenMPClauseKind AtomicKind = OMPC_unknown;<br>
   SourceLocation AtomicKindLoc;<br>
   for (auto *C : Clauses) {<br>
-    if (C->getClauseKind() == OMPC_read || C->getClauseKind() == OMPC_write) {<br>
+    if (C->getClauseKind() == OMPC_read || C->getClauseKind() == OMPC_write ||<br>
+        C->getClauseKind() == OMPC_update) {<br>
       if (AtomicKind != OMPC_unknown) {<br>
         Diag(C->getLocStart(), diag::err_omp_atomic_several_clauses)<br>
             << SourceRange(C->getLocStart(), C->getLocEnd());<br>
@@ -2413,6 +2414,13 @@ StmtResult Sema::ActOnOpenMPAtomicDirect<br>
            diag::err_omp_atomic_write_not_expression_statement);<br>
       return StmtError();<br>
     }<br>
+  } else if (AtomicKind == OMPC_update || AtomicKind == OMPC_unknown) {<br>
+    if (!isa<Expr>(CS->getCapturedStmt())) {<br>
+      Diag(CS->getCapturedStmt()->getLocStart(),<br>
+           diag::err_omp_atomic_update_not_expression_statement)<br>
+          << (AtomicKind == OMPC_update);<br>
+      return StmtError();<br>
+    }<br>
   }<br>
<br>
   getCurFunction()->setHasBranchProtectedScope();<br>
@@ -2461,6 +2469,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprCl<br>
   case OMPC_flush:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
   case OMPC_unknown:<br>
     llvm_unreachable("Clause is not allowed.");<br>
   }<br>
@@ -2665,6 +2674,7 @@ OMPClause *Sema::ActOnOpenMPSimpleClause<br>
   case OMPC_flush:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
   case OMPC_unknown:<br>
     llvm_unreachable("Clause is not allowed.");<br>
   }<br>
@@ -2782,6 +2792,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprWi<br>
   case OMPC_flush:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
   case OMPC_unknown:<br>
     llvm_unreachable("Clause is not allowed.");<br>
   }<br>
@@ -2867,6 +2878,9 @@ OMPClause *Sema::ActOnOpenMPClause(OpenM<br>
   case OMPC_write:<br>
     Res = ActOnOpenMPWriteClause(StartLoc, EndLoc);<br>
     break;<br>
+  case OMPC_update:<br>
+    Res = ActOnOpenMPUpdateClause(StartLoc, EndLoc);<br>
+    break;<br>
   case OMPC_if:<br>
   case OMPC_final:<br>
   case OMPC_num_threads:<br>
@@ -2923,6 +2937,11 @@ OMPClause *Sema::ActOnOpenMPWriteClause(<br>
   return new (Context) OMPWriteClause(StartLoc, EndLoc);<br>
 }<br>
<br>
+OMPClause *Sema::ActOnOpenMPUpdateClause(SourceLocation StartLoc,<br>
+                                         SourceLocation EndLoc) {<br>
+  return new (Context) OMPUpdateClause(StartLoc, EndLoc);<br>
+}<br>
+<br>
 OMPClause *Sema::ActOnOpenMPVarListClause(<br>
     OpenMPClauseKind Kind, ArrayRef<Expr *> VarList, Expr *TailExpr,<br>
     SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc,<br>
@@ -2978,6 +2997,7 @@ OMPClause *Sema::ActOnOpenMPVarListClaus<br>
   case OMPC_threadprivate:<br>
   case OMPC_read:<br>
   case OMPC_write:<br>
+  case OMPC_update:<br>
   case OMPC_unknown:<br>
     llvm_unreachable("Clause is not allowed.");<br>
   }<br>
<br>
Modified: cfe/trunk/lib/Sema/TreeTransform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Sema/TreeTransform.h (original)<br>
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed Jul 23 05:25:33 2014<br>
@@ -6775,6 +6775,13 @@ OMPClause *TreeTransform<Derived>::Trans<br>
<br>
 template <typename Derived><br>
 OMPClause *<br>
+TreeTransform<Derived>::TransformOMPUpdateClause(OMPUpdateClause *C) {<br>
+  // No need to rebuild this clause, no template-dependent parameters.<br>
+  return C;<br>
+}<br>
+<br>
+template <typename Derived><br>
+OMPClause *<br>
 TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *C) {<br>
   llvm::SmallVector<Expr *, 16> Vars;<br>
   Vars.reserve(C->varlist_size());<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Wed Jul 23 05:25:33 2014<br>
@@ -1721,6 +1721,9 @@ OMPClause *OMPClauseReader::readClause()<br>
   case OMPC_write:<br>
     C = new (Context) OMPWriteClause();<br>
     break;<br>
+  case OMPC_update:<br>
+    C = new (Context) OMPUpdateClause();<br>
+    break;<br>
   case OMPC_private:<br>
     C = OMPPrivateClause::CreateEmpty(Context, Record[Idx++]);<br>
     break;<br>
@@ -1819,6 +1822,8 @@ void OMPClauseReader::VisitOMPReadClause<br>
<br>
 void OMPClauseReader::VisitOMPWriteClause(OMPWriteClause *) {}<br>
<br>
+void OMPClauseReader::VisitOMPUpdateClause(OMPUpdateClause *) {}<br>
+<br>
 void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) {<br>
   C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));<br>
   unsigned NumVars = C->varlist_size();<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Wed Jul 23 05:25:33 2014<br>
@@ -1739,6 +1739,8 @@ void OMPClauseWriter::VisitOMPReadClause<br>
<br>
 void OMPClauseWriter::VisitOMPWriteClause(OMPWriteClause *) {}<br>
<br>
+void OMPClauseWriter::VisitOMPUpdateClause(OMPUpdateClause *) {}<br>
+<br>
 void OMPClauseWriter::VisitOMPPrivateClause(OMPPrivateClause *C) {<br>
   Record.push_back(C->varlist_size());<br>
   Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);<br>
<br>
Modified: cfe/trunk/test/OpenMP/atomic_ast_print.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_ast_print.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_ast_print.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/OpenMP/atomic_ast_print.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/atomic_ast_print.cpp Wed Jul 23 05:25:33 2014<br>
@@ -15,6 +15,8 @@ T foo(T argc) {<br>
   a = argc;<br>
 #pragma omp atomic write<br>
   a = argc + argc;<br>
+#pragma omp atomic update<br>
+  a = a + argc;<br>
   return T();<br>
 }<br>
<br>
@@ -25,6 +27,8 @@ T foo(T argc) {<br>
 // CHECK-NEXT: a = argc;<br>
 // CHECK-NEXT: #pragma omp atomic write<br>
 // CHECK-NEXT: a = argc + argc;<br>
+// CHECK-NEXT: #pragma omp atomic update<br>
+// CHECK-NEXT: a = a + argc;<br>
 // CHECK: T a = T();<br>
 // CHECK-NEXT: #pragma omp atomic<br>
 // CHECK-NEXT: a++;<br>
@@ -32,6 +36,8 @@ T foo(T argc) {<br>
 // CHECK-NEXT: a = argc;<br>
 // CHECK-NEXT: #pragma omp atomic write<br>
 // CHECK-NEXT: a = argc + argc;<br>
+// CHECK-NEXT: #pragma omp atomic update<br>
+// CHECK-NEXT: a = a + argc;<br>
<br>
 int main(int argc, char **argv) {<br>
   int a = 0;<br>
@@ -42,12 +48,16 @@ int main(int argc, char **argv) {<br>
   a = argc;<br>
 #pragma omp atomic write<br>
   a = argc + argc;<br>
+#pragma omp atomic update<br>
+  a = a + argc;<br>
   // CHECK-NEXT: #pragma omp atomic<br>
   // CHECK-NEXT: a++;<br>
   // CHECK-NEXT: #pragma omp atomic read<br>
   // CHECK-NEXT: a = argc;<br>
   // CHECK-NEXT: #pragma omp atomic write<br>
   // CHECK-NEXT: a = argc + argc;<br>
+  // CHECK-NEXT: #pragma omp atomic update<br>
+  // CHECK-NEXT: a = a + argc;<br>
   return foo(a);<br>
 }<br>
<br>
<br>
Modified: cfe/trunk/test/OpenMP/atomic_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_messages.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_messages.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/OpenMP/atomic_messages.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/atomic_messages.cpp Wed Jul 23 05:25:33 2014<br>
@@ -4,12 +4,14 @@ int foo() {<br>
 L1:<br>
   foo();<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
     foo();<br>
     goto L1; // expected-error {{use of undeclared label 'L1'}}<br>
   }<br>
   goto L2; // expected-error {{use of undeclared label 'L2'}}<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
     foo();<br>
   L2:<br>
@@ -74,6 +76,41 @@ int write() {<br>
 }<br>
<br>
 template <class T><br>
+T update() {<br>
+  T a, b = 0;<br>
+// Test for atomic update<br>
+#pragma omp atomic update<br>
+// 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}}<br>

+  ;<br>
+// expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'update' clause}}<br>
+#pragma omp atomic update update<br>
+  a += b;<br>
+<br>
+#pragma omp atomic<br>
+// 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}}<br>

+  ;<br>
+<br>
+  return T();<br>
+}<br>
+<br>
+int update() {<br>
+  int a, b = 0;<br>
+// Test for atomic update<br>
+#pragma omp atomic update<br>
+// 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}}<br>

+  ;<br>
+// expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'update' clause}}<br>
+#pragma omp atomic update update<br>
+  a += b;<br>
+<br>
+#pragma omp atomic<br>
+// 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}}<br>

+  ;<br>
+<br>
+  return update<int>();<br>
+}<br>
+<br>
+template <class T><br>
 T mixed() {<br>
   T a, b = T();<br>
 // expected-error@+2 2 {{directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause}}<br>
@@ -84,6 +121,10 @@ T mixed() {<br>
 // expected-note@+1 2 {{'write' clause used here}}<br>
 #pragma omp atomic write read<br>
   a = b;<br>
+// expected-error@+2 2 {{directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause}}<br>
+// expected-note@+1 2 {{'update' clause used here}}<br>
+#pragma omp atomic update read<br>
+  a += b;<br>
   return T();<br>
 }<br>
<br>
@@ -97,6 +138,10 @@ int mixed() {<br>
 // expected-note@+1 {{'write' clause used here}}<br>
 #pragma omp atomic write read<br>
   a = b;<br>
+// expected-error@+2 {{directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause}}<br>
+// expected-note@+1 {{'write' clause used here}}<br>
+#pragma omp atomic write update<br>
+  a = b;<br>
 // expected-note@+1 {{in instantiation of function template specialization 'mixed<int>' requested here}}<br>
   return mixed<int>();<br>
 }<br>
<br>
Modified: cfe/trunk/test/OpenMP/nesting_of_regions.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nesting_of_regions.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nesting_of_regions.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/OpenMP/nesting_of_regions.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/nesting_of_regions.cpp Wed Jul 23 05:25:33 2014<br>
@@ -1405,24 +1405,28 @@ void foo() {<br>
<br>
 // ATOMIC DIRECTIVE<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1430,6 +1434,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp section // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1437,6 +1442,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp single // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1444,6 +1450,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp master // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1451,6 +1458,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp critical // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1458,12 +1466,14 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1471,6 +1481,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp task // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -1478,31 +1489,37 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp flush // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     ++a;<br>
@@ -2746,24 +2763,28 @@ void foo() {<br>
<br>
 // ATOMIC DIRECTIVE<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2771,6 +2792,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp section // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2778,6 +2800,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp single // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2785,6 +2808,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp master // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2792,6 +2816,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp critical // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2799,12 +2824,14 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     for (int i = 0; i < 10; ++i)<br>
       ;<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2812,6 +2839,7 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp task // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     {<br>
@@ -2819,31 +2847,37 @@ void foo() {<br>
     }<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp flush // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     bar();<br>
   }<br>
 #pragma omp atomic<br>
+// 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}}<br>

   {<br>
 #pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside an atomic region}}<br>
     ++a;<br>
<br>
Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=213735&r1=213734&r2=213735&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=213735&r1=213734&r2=213735&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Jul 23 05:25:33 2014<br>
@@ -1985,6 +1985,8 @@ void OMPClauseEnqueue::VisitOMPReadClaus<br>
<br>
 void OMPClauseEnqueue::VisitOMPWriteClause(const OMPWriteClause *) {}<br>
<br>
+void OMPClauseEnqueue::VisitOMPUpdateClause(const OMPUpdateClause *) {}<br>
+<br>
 template<typename T><br>
 void OMPClauseEnqueue::VisitOMPClauseList(T *Node) {<br>
   for (const auto *I : Node->varlists())<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>