]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.h (statement_code_p): Don't declare.
authorIan Lance Taylor <ian@airs.com>
Thu, 12 May 2005 13:06:15 +0000 (13:06 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 12 May 2005 13:06:15 +0000 (13:06 +0000)
./: * c-common.h (statement_code_p): Don't declare.
(STATEMENT_CODE_P): Don't define.
(INIT_STATEMENT_CODES): Don't define.
* c-common.c (statement_code_p): Don't define.
cp/:
* cp-tree.h (cp_stmt_codes): Don't define.
(statement_code_p): Declare.
(STATEMENT_CODE_P): Define.
* lex.c (statement_code_p): Define.
(cxx_init): Use actual codes in stmt_codes initializer, not
cp_stmt_codes macro.  Initialize statement_code_p directly, rather
than using INIT_STATEMENT_CODES.

From-SVN: r99615

gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/lex.c

index 11b87280666e49a101ccd161a19ed3893c1a60c8..0822e0cb3003e7af999903c7e00c25db5724494b 100644 (file)
@@ -1,3 +1,10 @@
+2005-05-12  Ian Lance Taylor  <ian@airs.com>
+
+       * c-common.h (statement_code_p): Don't declare.
+       (STATEMENT_CODE_P): Don't define.
+       (INIT_STATEMENT_CODES): Don't define.
+       * c-common.c (statement_code_p): Don't define.
+
 2005-05-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * config/sparc/sparc.h: Remove dead code.
index 0e373775485e1ecbcd2b4b4613b6f123beefb78b..b2ba01e7e9181d63b754301bad77be4acfd7f9b2 100644 (file)
@@ -191,11 +191,6 @@ cpp_reader *parse_in;              /* Declared in c-pragma.h.  */
 */
 
 tree c_global_trees[CTI_MAX];
-
-/* TRUE if a code represents a statement.  The front end init
-   langhook should take care of initialization of this array.  */
-
-bool statement_code_p[MAX_TREE_CODES];
 \f
 /* Switches common to the C front ends.  */
 
index c43531bc88a2b7e2c90164e6beab611129ca081f..94532cc1e6e80c4c37c3b687b1d9849ee79a91c5 100644 (file)
@@ -735,20 +735,6 @@ enum c_tree_code {
 
 #undef DEFTREECODE
 
-/* TRUE if a code represents a statement.  The front end init
-   langhook should take care of initialization of this array.  */
-extern bool statement_code_p[MAX_TREE_CODES];
-
-#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)]
-
-#define INIT_STATEMENT_CODES(STMT_CODES)                       \
-  do {                                                         \
-    unsigned int i;                                            \
-    memset (&statement_code_p, 0, sizeof (statement_code_p));  \
-    for (i = 0; i < ARRAY_SIZE (STMT_CODES); i++)              \
-      statement_code_p[STMT_CODES[i]] = true;                  \
-  } while (0)
-
 extern int stmts_are_full_exprs_p (void);
 extern int anon_aggr_type_p (tree);
 
index 82415340a9e55479a426b2173bceb306a7522f3b..e3e43b72a4bdadcbf4a3ded526ae756a2f6b559c 100644 (file)
@@ -1,3 +1,13 @@
+2005-05-12  Ian Lance Taylor  <ian@airs.com>
+
+       * cp-tree.h (cp_stmt_codes): Don't define.
+       (statement_code_p): Declare.
+       (STATEMENT_CODE_P): Define.
+       * lex.c (statement_code_p): Define.
+       (cxx_init): Use actual codes in stmt_codes initializer, not
+       cp_stmt_codes macro.  Initialize statement_code_p directly, rather
+       than using INIT_STATEMENT_CODES.
+
 2005-05-09  Mark Mitchell  <mark@codesourcery.com>
 
        * typeck.c (build_unary_op): Do not resort to address arithmetic
index b5eab932f2068b7459935a89995b5f8e187f72ae..39d472bdc082408b1717a97015d6f69180b8d07b 100644 (file)
@@ -843,12 +843,11 @@ enum cplus_tree_code {
 };
 #undef DEFTREECODE
 
-#define cp_stmt_codes                                  \
-   CTOR_INITIALIZER,   TRY_BLOCK,      HANDLER,        \
-   EH_SPEC_BLOCK,      USING_STMT,     TAG_DEFN,       \
-   IF_STMT,            CLEANUP_STMT,   FOR_STMT,       \
-   WHILE_STMT,         DO_STMT,        BREAK_STMT,     \
-   CONTINUE_STMT,      SWITCH_STMT,    EXPR_STMT
+/* TRUE if a tree code represents a statement.  */
+extern bool statement_code_p[MAX_TREE_CODES];
+
+#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)]
+
 enum languages { lang_c, lang_cplusplus, lang_java };
 
 /* Macros to make error reporting functions' lives easier.  */
index 0af33813c7cae31793fca205644fcb9380fc0a44..dacac18286f6d2c8c94918af96d2f1d329530e66 100644 (file)
@@ -312,6 +312,10 @@ init_cp_pragma (void)
   c_register_pragma ("GCC", "java_exceptions", handle_pragma_java_exceptions);
 }
 \f
+/* TRUE if a code represents a statement.  */
+
+bool statement_code_p[MAX_TREE_CODES];
+
 /* Initialize the C++ front end.  This function is very sensitive to
    the exact order that things are done here.  It would be nice if the
    initialization done by this routine were moved to its subroutines,
@@ -319,11 +323,18 @@ init_cp_pragma (void)
 bool
 cxx_init (void)
 {
+  unsigned int i;
   static const enum tree_code stmt_codes[] = {
-    cp_stmt_codes
+   CTOR_INITIALIZER,   TRY_BLOCK,      HANDLER,
+   EH_SPEC_BLOCK,      USING_STMT,     TAG_DEFN,
+   IF_STMT,            CLEANUP_STMT,   FOR_STMT,
+   WHILE_STMT,         DO_STMT,        BREAK_STMT,
+   CONTINUE_STMT,      SWITCH_STMT,    EXPR_STMT
   };
 
-  INIT_STATEMENT_CODES (stmt_codes);
+  memset (&statement_code_p, 0, sizeof (statement_code_p));
+  for (i = 0; i < ARRAY_SIZE (stmt_codes); i++)
+    statement_code_p[stmt_codes[i]] = true;
 
   /* We cannot just assign to input_filename because it has already
      been initialized and will be used later as an N_BINCL for stabs+