Skip to content

Commit b528492

Browse files
committed
Use enumerators rather than hardcoded values
1 parent 2988099 commit b528492

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/include/clang/AST/OpenMPClause.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,14 +1168,14 @@ class OMPLoopRangeClause final : public OMPClause {
11681168
SourceLocation FirstLoc, CountLoc;
11691169

11701170
/// Number of looprange arguments (always 2: first, count)
1171-
static constexpr unsigned NumArgs = 2;
1171+
enum { FirstExpr, CountExpr, NumArgs };
11721172
Stmt *Args[NumArgs] = {nullptr, nullptr};
11731173

11741174
/// Set looprange 'first' expression
1175-
void setFirst(Expr *E) { Args[0] = E; }
1175+
void setFirst(Expr *E) { Args[FirstExpr] = E; }
11761176

11771177
/// Set looprange 'count' expression
1178-
void setCount(Expr *E) { Args[1] = E; }
1178+
void setCount(Expr *E) { Args[CountExpr] = E; }
11791179

11801180
/// Build an empty clause for deserialization.
11811181
explicit OMPLoopRangeClause()
@@ -1201,10 +1201,10 @@ class OMPLoopRangeClause final : public OMPClause {
12011201
void setCountLoc(SourceLocation Loc) { CountLoc = Loc; }
12021202

12031203
/// Get looprange 'first' expression
1204-
Expr *getFirst() const { return cast_or_null<Expr>(Args[0]); }
1204+
Expr *getFirst() const { return cast_or_null<Expr>(Args[FirstExpr]); }
12051205

12061206
/// Get looprange 'count' expression
1207-
Expr *getCount() const { return cast_or_null<Expr>(Args[1]); }
1207+
Expr *getCount() const { return cast_or_null<Expr>(Args[CountExpr]); }
12081208

12091209
child_range children() { return child_range(Args, Args + NumArgs); }
12101210
const_child_range children() const {

0 commit comments

Comments
 (0)