@@ -38,7 +38,9 @@ bool OpenACCClauseWithVarList::classof(const OpenACCClause *C) {
3838 OpenACCNoCreateClause::classof (C) ||
3939 OpenACCPresentClause::classof (C) || OpenACCCopyClause::classof (C) ||
4040 OpenACCCopyInClause::classof (C) || OpenACCCopyOutClause::classof (C) ||
41- OpenACCReductionClause::classof (C) || OpenACCCreateClause::classof (C);
41+ OpenACCReductionClause::classof (C) ||
42+ OpenACCCreateClause::classof (C) || OpenACCDeviceClause::classof (C) ||
43+ OpenACCHostClause::classof (C);
4244}
4345bool OpenACCClauseWithCondition::classof (const OpenACCClause *C) {
4446 return OpenACCIfClause::classof (C);
@@ -406,6 +408,26 @@ OpenACCPresentClause *OpenACCPresentClause::Create(const ASTContext &C,
406408 return new (Mem) OpenACCPresentClause (BeginLoc, LParenLoc, VarList, EndLoc);
407409}
408410
411+ OpenACCHostClause *OpenACCHostClause::Create (const ASTContext &C,
412+ SourceLocation BeginLoc,
413+ SourceLocation LParenLoc,
414+ ArrayRef<Expr *> VarList,
415+ SourceLocation EndLoc) {
416+ void *Mem =
417+ C.Allocate (OpenACCHostClause::totalSizeToAlloc<Expr *>(VarList.size ()));
418+ return new (Mem) OpenACCHostClause (BeginLoc, LParenLoc, VarList, EndLoc);
419+ }
420+
421+ OpenACCDeviceClause *OpenACCDeviceClause::Create (const ASTContext &C,
422+ SourceLocation BeginLoc,
423+ SourceLocation LParenLoc,
424+ ArrayRef<Expr *> VarList,
425+ SourceLocation EndLoc) {
426+ void *Mem =
427+ C.Allocate (OpenACCDeviceClause::totalSizeToAlloc<Expr *>(VarList.size ()));
428+ return new (Mem) OpenACCDeviceClause (BeginLoc, LParenLoc, VarList, EndLoc);
429+ }
430+
409431OpenACCCopyClause *
410432OpenACCCopyClause::Create (const ASTContext &C, OpenACCClauseKind Spelling,
411433 SourceLocation BeginLoc, SourceLocation LParenLoc,
@@ -711,6 +733,20 @@ void OpenACCClausePrinter::VisitPresentClause(const OpenACCPresentClause &C) {
711733 OS << " )" ;
712734}
713735
736+ void OpenACCClausePrinter::VisitHostClause (const OpenACCHostClause &C) {
737+ OS << " host(" ;
738+ llvm::interleaveComma (C.getVarList (), OS,
739+ [&](const Expr *E) { printExpr (E); });
740+ OS << " )" ;
741+ }
742+
743+ void OpenACCClausePrinter::VisitDeviceClause (const OpenACCDeviceClause &C) {
744+ OS << " device(" ;
745+ llvm::interleaveComma (C.getVarList (), OS,
746+ [&](const Expr *E) { printExpr (E); });
747+ OS << " )" ;
748+ }
749+
714750void OpenACCClausePrinter::VisitCopyClause (const OpenACCCopyClause &C) {
715751 OS << C.getClauseKind () << ' (' ;
716752 llvm::interleaveComma (C.getVarList (), OS,
0 commit comments