@@ -33,7 +33,8 @@ bool OpenACCClauseWithVarList::classof(const OpenACCClause *C) {
3333 OpenACCFirstPrivateClause::classof (C) ||
3434 OpenACCDevicePtrClause::classof (C) ||
3535 OpenACCDevicePtrClause::classof (C) ||
36- OpenACCAttachClause::classof (C) || OpenACCNoCreateClause::classof (C) ||
36+ OpenACCDetachClause::classof (C) || OpenACCAttachClause::classof (C) ||
37+ OpenACCNoCreateClause::classof (C) ||
3738 OpenACCPresentClause::classof (C) || OpenACCCopyClause::classof (C) ||
3839 OpenACCCopyInClause::classof (C) || OpenACCCopyOutClause::classof (C) ||
3940 OpenACCReductionClause::classof (C) || OpenACCCreateClause::classof (C);
@@ -277,6 +278,16 @@ OpenACCAttachClause *OpenACCAttachClause::Create(const ASTContext &C,
277278 return new (Mem) OpenACCAttachClause (BeginLoc, LParenLoc, VarList, EndLoc);
278279}
279280
281+ OpenACCDetachClause *OpenACCDetachClause::Create (const ASTContext &C,
282+ SourceLocation BeginLoc,
283+ SourceLocation LParenLoc,
284+ ArrayRef<Expr *> VarList,
285+ SourceLocation EndLoc) {
286+ void *Mem =
287+ C.Allocate (OpenACCDetachClause::totalSizeToAlloc<Expr *>(VarList.size ()));
288+ return new (Mem) OpenACCDetachClause (BeginLoc, LParenLoc, VarList, EndLoc);
289+ }
290+
280291OpenACCDevicePtrClause *OpenACCDevicePtrClause::Create (const ASTContext &C,
281292 SourceLocation BeginLoc,
282293 SourceLocation LParenLoc,
@@ -546,6 +557,13 @@ void OpenACCClausePrinter::VisitAttachClause(const OpenACCAttachClause &C) {
546557 OS << " )" ;
547558}
548559
560+ void OpenACCClausePrinter::VisitDetachClause (const OpenACCDetachClause &C) {
561+ OS << " detach(" ;
562+ llvm::interleaveComma (C.getVarList (), OS,
563+ [&](const Expr *E) { printExpr (E); });
564+ OS << " )" ;
565+ }
566+
549567void OpenACCClausePrinter::VisitDevicePtrClause (
550568 const OpenACCDevicePtrClause &C) {
551569 OS << " deviceptr(" ;
0 commit comments