@@ -47,6 +47,7 @@ bool OpenACCClauseWithSingleIntExpr::classof(const OpenACCClause *C) {
4747 return OpenACCNumWorkersClause::classof (C) ||
4848 OpenACCVectorLengthClause::classof (C) ||
4949 OpenACCDeviceNumClause::classof (C) ||
50+ OpenACCDefaultAsyncClause::classof (C) ||
5051 OpenACCVectorClause::classof (C) || OpenACCWorkerClause::classof (C) ||
5152 OpenACCCollapseClause::classof (C) || OpenACCAsyncClause::classof (C);
5253}
@@ -239,6 +240,27 @@ OpenACCDeviceNumClause *OpenACCDeviceNumClause::Create(const ASTContext &C,
239240 return new (Mem) OpenACCDeviceNumClause (BeginLoc, LParenLoc, IntExpr, EndLoc);
240241}
241242
243+ OpenACCDefaultAsyncClause::OpenACCDefaultAsyncClause (SourceLocation BeginLoc,
244+ SourceLocation LParenLoc,
245+ Expr *IntExpr,
246+ SourceLocation EndLoc)
247+ : OpenACCClauseWithSingleIntExpr(OpenACCClauseKind::DefaultAsync, BeginLoc,
248+ LParenLoc, IntExpr, EndLoc) {
249+ assert ((IntExpr->isInstantiationDependent () ||
250+ IntExpr->getType ()->isIntegerType ()) &&
251+ " default_async expression type not scalar/dependent" );
252+ }
253+
254+ OpenACCDefaultAsyncClause *
255+ OpenACCDefaultAsyncClause::Create (const ASTContext &C, SourceLocation BeginLoc,
256+ SourceLocation LParenLoc, Expr *IntExpr,
257+ SourceLocation EndLoc) {
258+ void *Mem = C.Allocate (sizeof (OpenACCDefaultAsyncClause),
259+ alignof (OpenACCDefaultAsyncClause));
260+ return new (Mem)
261+ OpenACCDefaultAsyncClause (BeginLoc, LParenLoc, IntExpr, EndLoc);
262+ }
263+
242264OpenACCWaitClause *OpenACCWaitClause::Create (
243265 const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
244266 Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef<Expr *> QueueIdExprs,
@@ -575,6 +597,13 @@ void OpenACCClausePrinter::VisitDeviceNumClause(
575597 OS << " )" ;
576598}
577599
600+ void OpenACCClausePrinter::VisitDefaultAsyncClause (
601+ const OpenACCDefaultAsyncClause &C) {
602+ OS << " default_async(" ;
603+ printExpr (C.getIntExpr ());
604+ OS << " )" ;
605+ }
606+
578607void OpenACCClausePrinter::VisitAsyncClause (const OpenACCAsyncClause &C) {
579608 OS << " async" ;
580609 if (C.hasIntExpr ()) {
0 commit comments