]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-core.h (omp_clause_code): Comments regarding range checks for OMP_CLAUSE_...
authorTobias Burnus <tburnus@baylibre.com>
Mon, 28 Oct 2024 09:00:08 +0000 (10:00 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Mon, 28 Oct 2024 09:00:08 +0000 (10:00 +0100)
gcc/ChangeLog:

* tree-core.h (enum omp_clause_code): Add comments to cross ref to
OMP_CLAUSE_DECL etc. and mark the ranges used in the range checks.

gcc/tree-core.h

index e82f3a5f4f5be3d4ddb087285ba61b72e5ca47b3..2a91e7935ca1989fd9b0e0a923c1b69e48a659be 100644 (file)
@@ -241,12 +241,19 @@ enum tree_code_class {
 };
 
 /* OMP_CLAUSE codes.  Do not reorder, as this is used to index into
-   the tables omp_clause_num_ops and omp_clause_code_name.  */
+   the tables omp_clause_num_ops and omp_clause_code_name.
+
+   Note additionally that there are various range checks such as
+   for OMP_CLAUSE_SIZE or OMP_CLAUSE_DECL; clauses having those shall
+   be inside that range, those that have not shall be outside.  */
+
 enum omp_clause_code {
   /* Clause zero is special-cased inside the parser
      (c_parser_omp_variable_list).  */
   OMP_CLAUSE_ERROR = 0,
 
+  /* Range START below for: OMP_CLAUSE_DECL  */
+
   /* OpenACC/OpenMP clause: private (variable_list).  */
   OMP_CLAUSE_PRIVATE,
 
@@ -259,6 +266,9 @@ enum omp_clause_code {
   /* OpenMP clause: lastprivate (variable_list).  */
   OMP_CLAUSE_LASTPRIVATE,
 
+  /* Range START below for: OMP_CLAUSE_REDUCTION_CODE and
+     OMP_CLAUSE_REDUCTION_{INIT,MERGE,{DECL_,}PLACEHOLDER,OMP_ORIG_REF}  */
+
   /* OpenACC/OpenMP clause: reduction (operator:variable_list).
      OMP_CLAUSE_REDUCTION_CODE: The tree_code of the operator.
      Operand 1: OMP_CLAUSE_REDUCTION_INIT: Stmt-list to initialize the var.
@@ -277,6 +287,9 @@ enum omp_clause_code {
   /* OpenMP clause: in_reduction (operator:variable_list).  */
   OMP_CLAUSE_IN_REDUCTION,
 
+  /* Range END above for: OMP_CLAUSE_REDUCTION_CODE  and
+     OMP_CLAUSE_REDUCTION_{INIT,MERGE,{DECL_,}PLACEHOLDER,OMP_ORIG_REF}  */
+
   /* OpenMP clause: copyin (variable_list).  */
   OMP_CLAUSE_COPYIN,
 
@@ -330,12 +343,17 @@ enum omp_clause_code {
   /* OpenMP clause: exclusive (variable-list).  */
   OMP_CLAUSE_EXCLUSIVE,
 
+  /* Range START below for: OMP_CLAUSE_SIZE  */
+  /* Range START below for: OMP_CLAUSE_MOTION_PRESENT  */
+
   /* OpenMP clause: from (variable-list).  */
   OMP_CLAUSE_FROM,
 
   /* OpenMP clause: to (variable-list).  */
   OMP_CLAUSE_TO,
 
+  /* Range END above for: OMP_CLAUSE_MOTION_PRESENT  */
+
   /* OpenACC clauses: {copy, copyin, copyout, create, delete, deviceptr,
      device, host (self), present, present_or_copy (pcopy), present_or_copyin
      (pcopyin), present_or_copyout (pcopyout), present_or_create (pcreate)}
@@ -354,6 +372,8 @@ enum omp_clause_code {
      #pragma acc cache (variable-list).  */
   OMP_CLAUSE__CACHE_,
 
+  /* Range END above for: OMP_CLAUSE_SIZE */
+
   /* OpenACC clause: gang [(gang-argument-list)].
      Where
       gang-argument-list: [gang-argument-list, ] gang-argument
@@ -386,6 +406,8 @@ enum omp_clause_code {
   /* Internal clause: temporary for inscan reductions.  */
   OMP_CLAUSE__SCANTEMP_,
 
+  /* Range END above for: OMP_CLAUSE_DECL  */
+
   /* OpenACC/OpenMP clause: if (scalar-expression).  */
   OMP_CLAUSE_IF,