|
30 | 30 | #include "clang/AST/ExprOpenMP.h"
|
31 | 31 | #include "clang/AST/LambdaCapture.h"
|
32 | 32 | #include "clang/AST/NestedNameSpecifier.h"
|
| 33 | +#include "clang/AST/OpenACCClause.h" |
33 | 34 | #include "clang/AST/OpenMPClause.h"
|
34 | 35 | #include "clang/AST/Stmt.h"
|
35 | 36 | #include "clang/AST/StmtCXX.h"
|
@@ -510,6 +511,7 @@ template <typename Derived> class RecursiveASTVisitor {
|
510 | 511 | bool
|
511 | 512 | TraverseOpenACCAssociatedStmtConstruct(OpenACCAssociatedStmtConstruct *S);
|
512 | 513 | bool VisitOpenACCClauseList(ArrayRef<const OpenACCClause *>);
|
| 514 | + bool VisitOpenACCClause(const OpenACCClause *); |
513 | 515 | };
|
514 | 516 |
|
515 | 517 | template <typename Derived>
|
@@ -3967,9 +3969,26 @@ bool RecursiveASTVisitor<Derived>::TraverseOpenACCAssociatedStmtConstruct(
|
3967 | 3969 | return true;
|
3968 | 3970 | }
|
3969 | 3971 |
|
| 3972 | +template <typename Derived> |
| 3973 | +bool RecursiveASTVisitor<Derived>::VisitOpenACCClause(const OpenACCClause *C) { |
| 3974 | + for (const Stmt *Child : C->children()) |
| 3975 | + TRY_TO(TraverseStmt(const_cast<Stmt *>(Child))); |
| 3976 | + return true; |
| 3977 | +} |
| 3978 | + |
3970 | 3979 | template <typename Derived>
|
3971 | 3980 | bool RecursiveASTVisitor<Derived>::VisitOpenACCClauseList(
|
3972 |
| - ArrayRef<const OpenACCClause *>) { |
| 3981 | + ArrayRef<const OpenACCClause *> Clauses) { |
| 3982 | + |
| 3983 | + for (const auto *C : Clauses) |
| 3984 | + TRY_TO(VisitOpenACCClause(C)); |
| 3985 | +// if (const auto *WithCond = dyn_cast<OopenACCClauseWithCondition>(C); |
| 3986 | +// WithCond && WIthCond->hasConditionExpr()) { |
| 3987 | +// TRY_TO(TraverseStmt(WithCond->getConditionExpr()); |
| 3988 | +// } else if (const auto * |
| 3989 | +// } |
| 3990 | +// OpenACCClauseWithCondition::getConditionExpr/hasConditionExpr |
| 3991 | +//OpenACCClauseWithExprs::children (might be null?) |
3973 | 3992 | // TODO OpenACC: When we have Clauses with expressions, we should visit them
|
3974 | 3993 | // here.
|
3975 | 3994 | return true;
|
|
0 commit comments