[OPENMP50]Support 'update' clause for 'depobj' directive.
Added basic support (parsing/sema/serialization) for 'update' clause in
'depobj' directive.
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index 2bd02a0..00d4342 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -330,6 +330,39 @@
return getTrailingObjects<Expr *>()[NumberOfLoops + NumLoop];
}
+OMPUpdateClause *OMPUpdateClause::Create(const ASTContext &C,
+ SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ return new (C) OMPUpdateClause(StartLoc, EndLoc, /*IsExtended=*/false);
+}
+
+OMPUpdateClause *
+OMPUpdateClause::Create(const ASTContext &C, SourceLocation StartLoc,
+ SourceLocation LParenLoc, SourceLocation ArgumentLoc,
+ OpenMPDependClauseKind DK, SourceLocation EndLoc) {
+ void *Mem =
+ C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
+ alignof(OMPUpdateClause));
+ auto *Clause =
+ new (Mem) OMPUpdateClause(StartLoc, EndLoc, /*IsExtended=*/true);
+ Clause->setLParenLoc(LParenLoc);
+ Clause->setArgumentLoc(ArgumentLoc);
+ Clause->setDependencyKind(DK);
+ return Clause;
+}
+
+OMPUpdateClause *OMPUpdateClause::CreateEmpty(const ASTContext &C,
+ bool IsExtended) {
+ if (!IsExtended)
+ return new (C) OMPUpdateClause(/*IsExtended=*/false);
+ void *Mem =
+ C.Allocate(totalSizeToAlloc<SourceLocation, OpenMPDependClauseKind>(2, 1),
+ alignof(OMPUpdateClause));
+ auto *Clause = new (Mem) OMPUpdateClause(/*IsExtended=*/true);
+ Clause->IsExtended = true;
+ return Clause;
+}
+
void OMPPrivateClause::setPrivateCopies(ArrayRef<Expr *> VL) {
assert(VL.size() == varlist_size() &&
"Number of private copies is not the same as the preallocated buffer");
@@ -1349,8 +1382,14 @@
void OMPClausePrinter::VisitOMPWriteClause(OMPWriteClause *) { OS << "write"; }
-void OMPClausePrinter::VisitOMPUpdateClause(OMPUpdateClause *) {
+void OMPClausePrinter::VisitOMPUpdateClause(OMPUpdateClause *Node) {
OS << "update";
+ if (Node->isExtended()) {
+ OS << "(";
+ OS << getOpenMPSimpleClauseTypeName(Node->getClauseKind(),
+ Node->getDependencyKind());
+ OS << ")";
+ }
}
void OMPClausePrinter::VisitOMPCaptureClause(OMPCaptureClause *) {