@@ -2515,6 +2515,11 @@ class OpenACCClauseProfiler
25152515 }
25162516 }
25172517
2518+ void VisitClauseWithVarList (const OpenACCClauseWithVarList &Clause) {
2519+ for (auto *E : Clause.getVarList ())
2520+ Profiler.VisitStmt (E);
2521+ }
2522+
25182523#define VISIT_CLAUSE (CLAUSE_NAME ) \
25192524 void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
25202525
@@ -2532,25 +2537,21 @@ void OpenACCClauseProfiler::VisitIfClause(const OpenACCIfClause &Clause) {
25322537}
25332538
25342539void OpenACCClauseProfiler::VisitCopyClause (const OpenACCCopyClause &Clause) {
2535- for (auto *E : Clause.getVarList ())
2536- Profiler.VisitStmt (E);
2540+ VisitClauseWithVarList (Clause);
25372541}
25382542void OpenACCClauseProfiler::VisitCopyInClause (
25392543 const OpenACCCopyInClause &Clause) {
2540- for (auto *E : Clause.getVarList ())
2541- Profiler.VisitStmt (E);
2544+ VisitClauseWithVarList (Clause);
25422545}
25432546
25442547void OpenACCClauseProfiler::VisitCopyOutClause (
25452548 const OpenACCCopyOutClause &Clause) {
2546- for (auto *E : Clause.getVarList ())
2547- Profiler.VisitStmt (E);
2549+ VisitClauseWithVarList (Clause);
25482550}
25492551
25502552void OpenACCClauseProfiler::VisitCreateClause (
25512553 const OpenACCCreateClause &Clause) {
2552- for (auto *E : Clause.getVarList ())
2553- Profiler.VisitStmt (E);
2554+ VisitClauseWithVarList (Clause);
25542555}
25552556
25562557void OpenACCClauseProfiler::VisitSelfClause (const OpenACCSelfClause &Clause) {
@@ -2589,50 +2590,47 @@ void OpenACCClauseProfiler::VisitCollapseClause(
25892590
25902591void OpenACCClauseProfiler::VisitPrivateClause (
25912592 const OpenACCPrivateClause &Clause) {
2592- for (auto *E : Clause.getVarList ())
2593- Profiler.VisitStmt (E);
2593+ VisitClauseWithVarList (Clause);
25942594}
25952595
25962596void OpenACCClauseProfiler::VisitFirstPrivateClause (
25972597 const OpenACCFirstPrivateClause &Clause) {
2598- for (auto *E : Clause.getVarList ())
2599- Profiler.VisitStmt (E);
2598+ VisitClauseWithVarList (Clause);
26002599}
26012600
26022601void OpenACCClauseProfiler::VisitAttachClause (
26032602 const OpenACCAttachClause &Clause) {
2604- for (auto *E : Clause.getVarList ())
2605- Profiler.VisitStmt (E);
2603+ VisitClauseWithVarList (Clause);
26062604}
26072605
26082606void OpenACCClauseProfiler::VisitDetachClause (
26092607 const OpenACCDetachClause &Clause) {
2610- for (auto *E : Clause.getVarList ())
2611- Profiler.VisitStmt (E);
2608+ VisitClauseWithVarList (Clause);
26122609}
26132610
26142611void OpenACCClauseProfiler::VisitDeleteClause (
26152612 const OpenACCDeleteClause &Clause) {
2616- for (auto *E : Clause.getVarList ())
2617- Profiler.VisitStmt (E);
2613+ VisitClauseWithVarList (Clause);
26182614}
26192615
26202616void OpenACCClauseProfiler::VisitDevicePtrClause (
26212617 const OpenACCDevicePtrClause &Clause) {
2622- for (auto *E : Clause.getVarList ())
2623- Profiler.VisitStmt (E);
2618+ VisitClauseWithVarList (Clause);
26242619}
26252620
26262621void OpenACCClauseProfiler::VisitNoCreateClause (
26272622 const OpenACCNoCreateClause &Clause) {
2628- for (auto *E : Clause.getVarList ())
2629- Profiler.VisitStmt (E);
2623+ VisitClauseWithVarList (Clause);
26302624}
26312625
26322626void OpenACCClauseProfiler::VisitPresentClause (
26332627 const OpenACCPresentClause &Clause) {
2634- for (auto *E : Clause.getVarList ())
2635- Profiler.VisitStmt (E);
2628+ VisitClauseWithVarList (Clause);
2629+ }
2630+
2631+ void OpenACCClauseProfiler::VisitUseDeviceClause (
2632+ const OpenACCUseDeviceClause &Clause) {
2633+ VisitClauseWithVarList (Clause);
26362634}
26372635
26382636void OpenACCClauseProfiler::VisitVectorLengthClause (
@@ -2684,8 +2682,7 @@ void OpenACCClauseProfiler::VisitGangClause(const OpenACCGangClause &Clause) {
26842682
26852683void OpenACCClauseProfiler::VisitReductionClause (
26862684 const OpenACCReductionClause &Clause) {
2687- for (auto *E : Clause.getVarList ())
2688- Profiler.VisitStmt (E);
2685+ VisitClauseWithVarList (Clause);
26892686}
26902687} // namespace
26912688
0 commit comments