From 7143b9d605ba68058774ffe1d45fa510287a5f66 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 13 Oct 2017 12:18:25 +0000 Subject: [PATCH] [PATCH] Tree structure marking 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 | 10 +++++++++ gcc/tree-core.h | 2 +- gcc/tree.c | 2 +- gcc/tree.h | 59 ++++++++++++++++--------------------------------- 4 files changed, 31 insertions(+), 42 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 649e2e8a303..78bd1f88c63 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2017-10-13 Nathan Sidwell + + * 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 * graphite-isl-ast-to-gimple.c diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 09be6239075..ed35847dc52 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -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[]; diff --git a/gcc/tree.c b/gcc/tree.c index 8acbdf70f4e..5662f28c469 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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[] = diff --git a/gcc/tree.h b/gcc/tree.h index 0fd383c4736..b6dfa89a17a 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -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. */ -- 2.30.2