[PATCH] Tree structure marking
authorNathan Sidwell <nathan@acm.org>
Fri, 13 Oct 2017 12:18:25 +0000 (12:18 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 13 Oct 2017 12:18:25 +0000 (12:18 +0000)
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00846.html
* tree-core.h (tree_contains_struct): Make bool.
* tree.c (tree_contains_struct): Likewise.
* tree.h (MARK_TS_BASE): Remove do ... while (0) idiom.
(MARK_TS_TYPED, MARK_TS_COMMON, MARK_TS_TYPE_COMMON,
MARK_TS_TYPE_WITH_LANG_SPECIFIC, MARK_TS_DECL_MINIMAL,
MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL, MARK_TS_DECL_WITH_VIS,
MARK_TS_DECL_NON_COMMON): Likewise, use comma operator.

From-SVN: r253723

gcc/ChangeLog
gcc/tree-core.h
gcc/tree.c
gcc/tree.h

index 649e2e8a3032dc2771362fe02b3656c244e99482..78bd1f88c63785f293faf7d652eda16854d05c8d 100644 (file)
@@ -1,3 +1,13 @@
+2017-10-13  Nathan Sidwell  <nathan@acm.org>
+
+       * tree-core.h (tree_contains_struct): Make bool.
+       * tree.c (tree_contains_struct): Likewise.
+       * tree.h (MARK_TS_BASE): Remove do ... while (0) idiom.
+       (MARK_TS_TYPED, MARK_TS_COMMON, MARK_TS_TYPE_COMMON,
+       MARK_TS_TYPE_WITH_LANG_SPECIFIC, MARK_TS_DECL_MINIMAL,
+       MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL, MARK_TS_DECL_WITH_VIS,
+       MARK_TS_DECL_NON_COMMON): Likewise, use comma operator.
+
 2017-10-13  Richard Biener  <rguenther@suse.de>
 
        * graphite-isl-ast-to-gimple.c
index 09be62390751559eedbacdb94df5738df5ec2717..ed35847dc52d54eb07b7fde8d1acfb3a65b99c41 100644 (file)
@@ -2058,7 +2058,7 @@ struct floatn_type_info {
                                 Global variables
 ---------------------------------------------------------------------------*/
 /* Matrix describing the structures contained in a given tree code.  */
-extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
+extern bool tree_contains_struct[MAX_TREE_CODES][64];
 
 /* Class of tree given its code.  */
 extern const enum tree_code_class tree_code_type[];
index 8acbdf70f4e21caefd508d3ff7601b73b1da931a..5662f28c4692bf81d7e6c34713f2c3d92b4a9abe 100644 (file)
@@ -259,7 +259,7 @@ tree integer_types[itk_none];
 bool int_n_enabled_p[NUM_INT_N_ENTS];
 struct int_n_trees_t int_n_trees [NUM_INT_N_ENTS];
 
-unsigned char tree_contains_struct[MAX_TREE_CODES][64];
+bool tree_contains_struct[MAX_TREE_CODES][64];
 
 /* Number of operands for each OpenMP clause.  */
 unsigned const char omp_clause_num_ops[] =
index 0fd383c4736707077787c0d228f2167a1b56b326..b6dfa89a17ae327e1defac352023cbbcbf35cb95 100644 (file)
@@ -76,64 +76,43 @@ as_internal_fn (combined_fn code)
 
 /* Macros for initializing `tree_contains_struct'.  */
 #define MARK_TS_BASE(C)                                        \
-  do {                                                 \
-    tree_contains_struct[C][TS_BASE] = 1;              \
-  } while (0)
+  (tree_contains_struct[C][TS_BASE] = true)
 
 #define MARK_TS_TYPED(C)                               \
-  do {                                                 \
-    MARK_TS_BASE (C);                                  \
-    tree_contains_struct[C][TS_TYPED] = 1;             \
-  } while (0)
+  (MARK_TS_BASE (C),                                   \
+   tree_contains_struct[C][TS_TYPED] = true)
 
 #define MARK_TS_COMMON(C)                              \
-  do {                                                 \
-    MARK_TS_TYPED (C);                                 \
-    tree_contains_struct[C][TS_COMMON] = 1;            \
-  } while (0)
+  (MARK_TS_TYPED (C),                                  \
+   tree_contains_struct[C][TS_COMMON] = true)
 
 #define MARK_TS_TYPE_COMMON(C)                         \
-  do {                                                 \
-    MARK_TS_COMMON (C);                                        \
-    tree_contains_struct[C][TS_TYPE_COMMON] = 1;       \
-  } while (0)
+  (MARK_TS_COMMON (C),                                 \
+   tree_contains_struct[C][TS_TYPE_COMMON] = true)
 
 #define MARK_TS_TYPE_WITH_LANG_SPECIFIC(C)             \
-  do {                                                 \
-    MARK_TS_TYPE_COMMON (C);                           \
-    tree_contains_struct[C][TS_TYPE_WITH_LANG_SPECIFIC] = 1;   \
-  } while (0)
+  (MARK_TS_TYPE_COMMON (C),                            \
+   tree_contains_struct[C][TS_TYPE_WITH_LANG_SPECIFIC] = true)
 
 #define MARK_TS_DECL_MINIMAL(C)                                \
-  do {                                                 \
-    MARK_TS_COMMON (C);                                        \
-    tree_contains_struct[C][TS_DECL_MINIMAL] = 1;      \
-  } while (0)
+  (MARK_TS_COMMON (C),                                 \
+   tree_contains_struct[C][TS_DECL_MINIMAL] = true)
 
 #define MARK_TS_DECL_COMMON(C)                         \
-  do {                                                 \
-    MARK_TS_DECL_MINIMAL (C);                          \
-    tree_contains_struct[C][TS_DECL_COMMON] = 1;       \
-  } while (0)
+  (MARK_TS_DECL_MINIMAL (C),                           \
+   tree_contains_struct[C][TS_DECL_COMMON] = true)
 
 #define MARK_TS_DECL_WRTL(C)                           \
-  do {                                                 \
-    MARK_TS_DECL_COMMON (C);                           \
-    tree_contains_struct[C][TS_DECL_WRTL] = 1;         \
-  } while (0)
+  (MARK_TS_DECL_COMMON (C),                            \
+   tree_contains_struct[C][TS_DECL_WRTL] = true)
 
 #define MARK_TS_DECL_WITH_VIS(C)                       \
-  do {                                                 \
-    MARK_TS_DECL_WRTL (C);                             \
-    tree_contains_struct[C][TS_DECL_WITH_VIS] = 1;     \
-  } while (0)
+  (MARK_TS_DECL_WRTL (C),                              \
+   tree_contains_struct[C][TS_DECL_WITH_VIS] = true)
 
 #define MARK_TS_DECL_NON_COMMON(C)                     \
-  do {                                                 \
-    MARK_TS_DECL_WITH_VIS (C);                         \
-    tree_contains_struct[C][TS_DECL_NON_COMMON] = 1;   \
-  } while (0)
-
+  (MARK_TS_DECL_WITH_VIS (C),                          \
+   tree_contains_struct[C][TS_DECL_NON_COMMON] = true)
 
 /* Returns the string representing CLASS.  */