@@ -38,7 +38,9 @@ bool OpenACCClauseWithVarList::classof(const OpenACCClause *C) {
38
38
OpenACCNoCreateClause::classof (C) ||
39
39
OpenACCPresentClause::classof (C) || OpenACCCopyClause::classof (C) ||
40
40
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);
42
44
}
43
45
bool OpenACCClauseWithCondition::classof (const OpenACCClause *C) {
44
46
return OpenACCIfClause::classof (C);
@@ -406,6 +408,26 @@ OpenACCPresentClause *OpenACCPresentClause::Create(const ASTContext &C,
406
408
return new (Mem) OpenACCPresentClause (BeginLoc, LParenLoc, VarList, EndLoc);
407
409
}
408
410
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
+
409
431
OpenACCCopyClause *
410
432
OpenACCCopyClause::Create (const ASTContext &C, OpenACCClauseKind Spelling,
411
433
SourceLocation BeginLoc, SourceLocation LParenLoc,
@@ -711,6 +733,20 @@ void OpenACCClausePrinter::VisitPresentClause(const OpenACCPresentClause &C) {
711
733
OS << " )" ;
712
734
}
713
735
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
+
714
750
void OpenACCClausePrinter::VisitCopyClause (const OpenACCCopyClause &C) {
715
751
OS << C.getClauseKind () << ' (' ;
716
752
llvm::interleaveComma (C.getVarList (), OS,
0 commit comments