Skip to content

Commit bae17a2

Browse files
committed
[OpenACC] Make all AST enums have an underlying type.
We store these in a few places, so ensuring they are kept in a uint8_t will minimize the amount of storage on the stack.
1 parent 2d133aa commit bae17a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/include/clang/Basic/OpenACCKinds.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace clang {
2222
// Represents the Construct/Directive kind of a pragma directive. Note the
2323
// OpenACC standard is inconsistent between calling these Construct vs
2424
// Directive, but we're calling it a Directive to be consistent with OpenMP.
25-
enum class OpenACCDirectiveKind {
25+
enum class OpenACCDirectiveKind : uint8_t {
2626
// Compute Constructs.
2727
Parallel,
2828
Serial,
@@ -152,7 +152,7 @@ inline bool isOpenACCComputeDirectiveKind(OpenACCDirectiveKind K) {
152152
K == OpenACCDirectiveKind::Kernels;
153153
}
154154

155-
enum class OpenACCAtomicKind {
155+
enum class OpenACCAtomicKind : uint8_t {
156156
Read,
157157
Write,
158158
Update,
@@ -161,7 +161,7 @@ enum class OpenACCAtomicKind {
161161
};
162162

163163
/// Represents the kind of an OpenACC clause.
164-
enum class OpenACCClauseKind {
164+
enum class OpenACCClauseKind : uint8_t {
165165
/// 'finalize' clause, allowed on 'exit data' directive.
166166
Finalize,
167167
/// 'if_present' clause, allowed on 'host_data' and 'update' directives.
@@ -459,7 +459,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &Out,
459459
return printOpenACCClauseKind(Out, K);
460460
}
461461

462-
enum class OpenACCDefaultClauseKind {
462+
enum class OpenACCDefaultClauseKind : uint8_t {
463463
/// 'none' option.
464464
None,
465465
/// 'present' option.
@@ -492,7 +492,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &Out,
492492
return printOpenACCDefaultClauseKind(Out, K);
493493
}
494494

495-
enum class OpenACCReductionOperator {
495+
enum class OpenACCReductionOperator : uint8_t {
496496
/// '+'.
497497
Addition,
498498
/// '*'.

0 commit comments

Comments
 (0)