[OPENMP50]Initial support for inclusive clause.
Added parsing/sema/serialization support for inclusive clause in scan
directive.
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index a957890..de8fd67 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -146,6 +146,7 @@
case OMPC_order:
case OMPC_destroy:
case OMPC_detach:
+ case OMPC_inclusive:
break;
}
@@ -233,6 +234,7 @@
case OMPC_order:
case OMPC_destroy:
case OMPC_detach:
+ case OMPC_inclusive:
break;
}
@@ -1248,6 +1250,24 @@
std::copy(VL.begin(), VL.end(), varlist_end());
}
+OMPInclusiveClause *OMPInclusiveClause::Create(const ASTContext &C,
+ SourceLocation StartLoc,
+ SourceLocation LParenLoc,
+ SourceLocation EndLoc,
+ ArrayRef<Expr *> VL) {
+ void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
+ auto *Clause =
+ new (Mem) OMPInclusiveClause(StartLoc, LParenLoc, EndLoc, VL.size());
+ Clause->setVarRefs(VL);
+ return Clause;
+}
+
+OMPInclusiveClause *OMPInclusiveClause::CreateEmpty(const ASTContext &C,
+ unsigned N) {
+ void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N));
+ return new (Mem) OMPInclusiveClause(N);
+}
+
//===----------------------------------------------------------------------===//
// OpenMP clauses printing methods
//===----------------------------------------------------------------------===//
@@ -1805,6 +1825,14 @@
<< ")";
}
+void OMPClausePrinter::VisitOMPInclusiveClause(OMPInclusiveClause *Node) {
+ if (!Node->varlist_empty()) {
+ OS << "inclusive";
+ VisitOMPClauseList(Node, '(');
+ OS << ")";
+ }
+}
+
void OMPTraitInfo::getAsVariantMatchInfo(
ASTContext &ASTCtx, llvm::omp::VariantMatchInfo &VMI) const {
for (const OMPTraitSet &Set : Sets) {