in / 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
authorDaniel Berlin <dberlin@dberlin.org>
Sat, 7 Apr 2007 00:19:46 +0000 (00:19 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Sat, 7 Apr 2007 00:19:46 +0000 (00:19 +0000)
in /
2007-04-06  Daniel Berlin  <dberlin@dberlin.org>

* tree.c (staticp): No longer use staticp langhook.
* langhooks.c (lhd_staticp): Removed.
* langhooks.h (struct lang_hooks): Remove staticp.
* c-common.c (c_staticp): Remove.
* c-common.h (c_staticp): Ditto.
* langhooks-defs.h (lhd_staticp): Ditto.
(LHD_HOOKS_STATICP): Ditto
* tree.h (gcc_assert_lowered): New macro.

in cp/

2007-04-06  Daniel Berlin  <dberlin@dberlin.org>

* cp-objcp-common.c (cxx_staticp): Remove.
* cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
* cp-tree.h (cxx_staticp):

From-SVN: r123636

13 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-objc-common.h
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.c
gcc/cp/cp-objcp-common.h
gcc/cp/cp-tree.h
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h
gcc/tree.c
gcc/tree.h

index 47a62ad29cf852b64ff14dfd3266599e940a553f..e6e5b7abe8a3e385a70cfb3b1cb67e7db5f1b0f6 100644 (file)
@@ -1,3 +1,14 @@
+2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
+
+       * tree.c (staticp): No longer use staticp langhook.
+       * langhooks.c (lhd_staticp): Removed.
+       * langhooks.h (struct lang_hooks): Remove staticp.
+       * c-common.c (c_staticp): Remove.
+       * c-common.h (c_staticp): Ditto.
+       * langhooks-defs.h (lhd_staticp): Ditto.
+       (LHD_HOOKS_STATICP): Ditto
+       * tree.h (gcc_assert_lowered): New macro.
+
 2007-04-06  Zdenek Dvorak  <dvorakz@suse.cz>
 
        * tree-ssa-loop-niter.c (idx_infer_loop_bounds): Add and use
index 8f71e6916ed7ce0c879bdd1979bb18523f04fd36..af8b8aa075ae247522b4bef8c1c4bdb160411a03 100644 (file)
@@ -4294,15 +4294,6 @@ c_expand_body (tree fndecl)
                                decl_fini_priority_lookup (fndecl));
 }
 
-/* Hook used by staticp to handle language-specific tree codes.  */
-
-tree
-c_staticp (tree exp)
-{
-  return (TREE_CODE (exp) == COMPOUND_LITERAL_EXPR
-         && TREE_STATIC (COMPOUND_LITERAL_EXPR_DECL (exp))
-         ? exp : NULL);
-}
 \f
 
 /* Given a boolean expression ARG, return a tree representing an increment
index b128e31a0085da7d0d57d4c9a43e313bbd58d209..40025c33c34e8f4e84a8add110c3156120beb5d4 100644 (file)
@@ -825,8 +825,6 @@ extern bool vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note);
 extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
 extern void c_expand_body (tree);
 
-extern tree c_staticp (tree);
-
 extern void init_c_lex (void);
 
 extern void c_cpp_builtins (cpp_reader *);
index f3f0867e958b23ca61214895449c50b27d802902..00519c7c0eeeb1ceb021250f42361305b8e7dbb1 100644 (file)
@@ -56,8 +56,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
 #define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
 #undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
 #define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
-#undef LANG_HOOKS_STATICP
-#define LANG_HOOKS_STATICP c_staticp
 #undef LANG_HOOKS_NO_BODY_BLOCKS
 #define LANG_HOOKS_NO_BODY_BLOCKS true
 #undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
index f5b7aceca61e2e2b37c1bf3a945184f16cb5a08e..5d3491f3f10b7e5f92a114a1eb28f01204710071 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
+
+       * cp-objcp-common.c (cxx_staticp): Remove.
+       * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
+       * cp-tree.h (cxx_staticp):      
+
 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
 
        * class.c (check_for_override): Don't remove dllmport attribute
index af8eb94cf4945e61d90ecbd410cc0c633aea4e22..f74c60ae52753cb1bf8d024a30a52b5c73281bb7 100644 (file)
@@ -200,21 +200,6 @@ cxx_types_compatible_p (tree x, tree y)
   return 0;
 }
 
-tree
-cxx_staticp (tree arg)
-{
-  switch (TREE_CODE (arg))
-    {
-    case BASELINK:
-      return staticp (BASELINK_FUNCTIONS (arg));
-
-    default:
-      break;
-    }
-  
-  return NULL_TREE;
-}
-
 /* Stubs to keep c-opts.c happy.  */
 void
 push_file_scope (void)
index 23e1f0ffff1f2d77586240edfffced7dcb16a354..2d40e2227bbe3b16a11f9cd897acf83117ffc1e4 100644 (file)
@@ -59,8 +59,6 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
 #define LANG_HOOKS_EXPAND_DECL c_expand_decl
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
-#undef LANG_HOOKS_STATICP
-#define LANG_HOOKS_STATICP cxx_staticp
 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl
 #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
index 3b3821ef2575368bdf9e045d1a69e60df20f5353..32eb08477d0e31530d397f910643c822fbac1fd3 100644 (file)
@@ -4816,7 +4816,6 @@ extern bool cp_var_mod_type_p                     (tree, tree);
 extern void cxx_initialize_diagnostics         (struct diagnostic_context *);
 extern int cxx_types_compatible_p              (tree, tree);
 extern void init_shadowed_var_for_decl         (void);
-extern tree cxx_staticp                         (tree);
 
 /* in cp-gimplify.c */
 extern int cp_gimplify_expr                    (tree *, tree *, tree *);
index 004b3c56f42f1eb018a8b4efd3f8629845894a3e..4416bb925a9803f621cd0678b21d2bddd94d222c 100644 (file)
@@ -49,7 +49,6 @@ extern tree lhd_return_tree (tree);
 extern tree lhd_return_null_tree_v (void);
 extern tree lhd_return_null_tree (tree);
 extern tree lhd_do_nothing_iii_return_null_tree (int, int, int);
-extern tree lhd_staticp (tree);
 extern void lhd_print_tree_nothing (FILE *, tree, int);
 extern const char *lhd_decl_printable_name (tree, int);
 extern const char *lhd_dwarf_name (tree, int);
@@ -110,7 +109,6 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
 #define LANG_HOOKS_EXPAND_EXPR         lhd_expand_expr
 #define LANG_HOOKS_EXPAND_DECL         lhd_expand_decl
 #define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
-#define LANG_HOOKS_STATICP             lhd_staticp
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
 #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
 #define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS false
@@ -296,7 +294,6 @@ extern tree lhd_make_node (enum tree_code);
   LANG_HOOKS_EXPAND_DECL, \
   LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
   LANG_HOOKS_MARK_ADDRESSABLE, \
-  LANG_HOOKS_STATICP, \
   LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
   LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
   LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \
index 919f05dea7d0c6a993539fd8808bea07d2cf14db..49a5a07c9b7928f80fd6eaee259d3b6e5b0be51c 100644 (file)
@@ -117,14 +117,6 @@ lhd_print_tree_nothing (FILE * ARG_UNUSED (file),
 {
 }
 
-/* Called from staticp.  */
-
-tree
-lhd_staticp (tree ARG_UNUSED (exp))
-{
-  return NULL;
-}
-
 /* Called from check_global_declarations.  */
 
 bool
index f0220fc91c3607d2e858bdecf405168f21fef35d..85dbec6bb4e4dd96fd8ba11b60dc6966f65eacea 100644 (file)
@@ -324,9 +324,6 @@ struct lang_hooks
      successful.  */
   bool (*mark_addressable) (tree);
 
-  /* Hook called by staticp for language-specific tree codes.  */
-  tree (*staticp) (tree);
-
   /* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the
      DECL_NODE with a newly GC-allocated copy.  */
   void (*dup_lang_specific_decl) (tree);
index 0ea18b2f700fed1375f8d0cd7e9a4f15ec78daee..816275c1f68dbfc8cb57b5b3fa3b9d71770119b9 100644 (file)
@@ -1986,10 +1986,7 @@ staticp (tree arg)
       return arg;
 
     case COMPONENT_REF:
-      /* If the thing being referenced is not a field, then it is
-        something language specific.  */
-      if (TREE_CODE (TREE_OPERAND (arg, 1)) != FIELD_DECL)
-       return (*lang_hooks.staticp) (arg);
+      gcc_assert (TREE_CODE (TREE_OPERAND (arg, 1)) == FIELD_DECL);
 
       /* If we are referencing a bitfield, we can't evaluate an
         ADDR_EXPR at compile time and so it isn't a constant.  */
@@ -2015,11 +2012,10 @@ staticp (tree arg)
        return false;
 
     default:
-      if ((unsigned int) TREE_CODE (arg)
-         >= (unsigned int) LAST_AND_UNUSED_TREE_CODE)
-       return lang_hooks.staticp (arg);
-      else
-       return NULL;
+      /* All language specific tree codes should have been lowered by
+        now. */
+      gcc_assert_lowered (arg);
+      return NULL;
     }
 }
 \f
index 64efe7c60fe1d855791cbddb4b13720cbf4646c4..e781e64dccf489bd5206bee6f76bea41d95c3675 100644 (file)
@@ -921,6 +921,7 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
 
 #endif
 
+#define gcc_assert_lowered(NODE) gcc_assert (TREE_CODE (NODE) <= LAST_AND_UNUSED_TREE_CODE)
 #define TREE_BLOCK(NODE)               *(tree_block (NODE))
 
 #include "tree-check.h"