[clang] bae17a2 - [OpenACC] Make all AST enums have an underlying type.

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 07:21:24 PDT 2024


Author: erichkeane
Date: 2024-10-11T07:21:17-07:00
New Revision: bae17a2682c8fcc58c1b7248427b153dba7cb39b

URL: https://github.com/llvm/llvm-project/commit/bae17a2682c8fcc58c1b7248427b153dba7cb39b
DIFF: https://github.com/llvm/llvm-project/commit/bae17a2682c8fcc58c1b7248427b153dba7cb39b.diff

LOG: [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.

Added: 
    

Modified: 
    clang/include/clang/Basic/OpenACCKinds.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/OpenACCKinds.h b/clang/include/clang/Basic/OpenACCKinds.h
index 7b9d619a8aec6d..c4dfe3bedc13a7 100644
--- a/clang/include/clang/Basic/OpenACCKinds.h
+++ b/clang/include/clang/Basic/OpenACCKinds.h
@@ -22,7 +22,7 @@ namespace clang {
 // Represents the Construct/Directive kind of a pragma directive. Note the
 // OpenACC standard is inconsistent between calling these Construct vs
 // Directive, but we're calling it a Directive to be consistent with OpenMP.
-enum class OpenACCDirectiveKind {
+enum class OpenACCDirectiveKind : uint8_t {
   // Compute Constructs.
   Parallel,
   Serial,
@@ -152,7 +152,7 @@ inline bool isOpenACCComputeDirectiveKind(OpenACCDirectiveKind K) {
          K == OpenACCDirectiveKind::Kernels;
 }
 
-enum class OpenACCAtomicKind {
+enum class OpenACCAtomicKind : uint8_t {
   Read,
   Write,
   Update,
@@ -161,7 +161,7 @@ enum class OpenACCAtomicKind {
 };
 
 /// Represents the kind of an OpenACC clause.
-enum class OpenACCClauseKind {
+enum class OpenACCClauseKind : uint8_t {
   /// 'finalize' clause, allowed on 'exit data' directive.
   Finalize,
   /// 'if_present' clause, allowed on 'host_data' and 'update' directives.
@@ -459,7 +459,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &Out,
   return printOpenACCClauseKind(Out, K);
 }
 
-enum class OpenACCDefaultClauseKind {
+enum class OpenACCDefaultClauseKind : uint8_t {
   /// 'none' option.
   None,
   /// 'present' option.
@@ -492,7 +492,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &Out,
   return printOpenACCDefaultClauseKind(Out, K);
 }
 
-enum class OpenACCReductionOperator {
+enum class OpenACCReductionOperator : uint8_t {
   /// '+'.
   Addition,
   /// '*'.


        


More information about the cfe-commits mailing list