Skip to content

Commit a472e64

Browse files
committed
[NFC][OpenACC] Rename visitor functions to omit redundant OpenACC
While working on a followup patch, it became clear that this extra bit of 'OpenACC' before each clause name was redundant with the visitors, so remove it to make this a little less verbose.
1 parent eaa3947 commit a472e64

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

clang/include/clang/AST/OpenACCClause.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ template <class Impl> class OpenACCClauseVisitor {
160160

161161
switch (C->getClauseKind()) {
162162
case OpenACCClauseKind::Default:
163-
VisitOpenACCDefaultClause(*cast<OpenACCDefaultClause>(C));
163+
VisitDefaultClause(*cast<OpenACCDefaultClause>(C));
164164
return;
165165
case OpenACCClauseKind::If:
166-
VisitOpenACCIfClause(*cast<OpenACCIfClause>(C));
166+
VisitIfClause(*cast<OpenACCIfClause>(C));
167167
return;
168168
case OpenACCClauseKind::Finalize:
169169
case OpenACCClauseKind::IfPresent:
@@ -212,9 +212,9 @@ template <class Impl> class OpenACCClauseVisitor {
212212
}
213213

214214
#define VISIT_CLAUSE(CLAUSE_NAME) \
215-
void VisitOpenACC##CLAUSE_NAME##Clause( \
215+
void Visit##CLAUSE_NAME##Clause( \
216216
const OpenACC##CLAUSE_NAME##Clause &Clause) { \
217-
return getDerived().VisitOpenACC##CLAUSE_NAME##Clause(Clause); \
217+
return getDerived().Visit##CLAUSE_NAME##Clause(Clause); \
218218
}
219219

220220
#include "clang/Basic/OpenACCClauses.def"
@@ -236,8 +236,7 @@ class OpenACCClausePrinter final
236236
OpenACCClausePrinter(raw_ostream &OS) : OS(OS) {}
237237

238238
#define VISIT_CLAUSE(CLAUSE_NAME) \
239-
void VisitOpenACC##CLAUSE_NAME##Clause( \
240-
const OpenACC##CLAUSE_NAME##Clause &Clause);
239+
void Visit##CLAUSE_NAME##Clause(const OpenACC##CLAUSE_NAME##Clause &Clause);
241240
#include "clang/Basic/OpenACCClauses.def"
242241
};
243242

clang/lib/AST/OpenACCClause.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ OpenACCClause::child_range OpenACCClause::children() {
6565
//===----------------------------------------------------------------------===//
6666
// OpenACC clauses printing methods
6767
//===----------------------------------------------------------------------===//
68-
void OpenACCClausePrinter::VisitOpenACCDefaultClause(
68+
void OpenACCClausePrinter::VisitDefaultClause(
6969
const OpenACCDefaultClause &C) {
7070
OS << "default(" << C.getDefaultClauseKind() << ")";
7171
}
7272

73-
void OpenACCClausePrinter::VisitOpenACCIfClause(const OpenACCIfClause &C) {
73+
void OpenACCClausePrinter::VisitIfClause(const OpenACCIfClause &C) {
7474
OS << "if(" << C.getConditionExpr() << ")";
7575
}

clang/lib/AST/StmtProfile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,17 +2459,17 @@ class OpenACCClauseProfiler
24592459
}
24602460

24612461
#define VISIT_CLAUSE(CLAUSE_NAME) \
2462-
void VisitOpenACC##CLAUSE_NAME##Clause( \
2462+
void Visit##CLAUSE_NAME##Clause( \
24632463
const OpenACC##CLAUSE_NAME##Clause &Clause);
24642464

24652465
#include "clang/Basic/OpenACCClauses.def"
24662466
};
24672467

24682468
/// Nothing to do here, there are no sub-statements.
2469-
void OpenACCClauseProfiler::VisitOpenACCDefaultClause(
2469+
void OpenACCClauseProfiler::VisitDefaultClause(
24702470
const OpenACCDefaultClause &Clause) {}
24712471

2472-
void OpenACCClauseProfiler::VisitOpenACCIfClause(
2472+
void OpenACCClauseProfiler::VisitIfClause(
24732473
const OpenACCIfClause &Clause) {
24742474
assert(Clause.hasConditionExpr() &&
24752475
"if clause requires a valid condition expr");

clang/tools/libclang/CIndex.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,9 +2787,8 @@ class OpenACCClauseEnqueue : public OpenACCClauseVisitor<OpenACCClauseEnqueue> {
27872787
#include "clang/Basic/OpenACCClauses.def"
27882788
};
27892789

2790-
void OpenACCClauseEnqueue::VisitOpenACCDefaultClause(
2791-
const OpenACCDefaultClause &C) {}
2792-
void OpenACCClauseEnqueue::VisitOpenACCIfClause(const OpenACCIfClause &C) {
2790+
void OpenACCClauseEnqueue::VisitDefaultClause(const OpenACCDefaultClause &C) {}
2791+
void OpenACCClauseEnqueue::VisitIfClause(const OpenACCIfClause &C) {
27932792
Visitor.AddStmt(C.getConditionExpr());
27942793
}
27952794
} // namespace

0 commit comments

Comments
 (0)