cp-tree.h (pushdecl, [...]): Move declarations to ...
authorNathan Sidwell <nathan@acm.org>
Thu, 11 May 2017 11:57:01 +0000 (11:57 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 11 May 2017 11:57:01 +0000 (11:57 +0000)
* cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag)
pushtag_top_level_maybe_friend,
pushdecl_top_level_and_finish): Move declarations to ...
* name-lookup.h: ... here.  Group pushdecl variants.
(pushdecl_top_level_and_finish): Rename to ...
(pushdecl_top_level_with_init): ... here.
* decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
* decl2.c (get_guard, handle_tls_init): Likewise.
* rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
* lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
* method.c (implicitly_declare_fn): Likewise.
* searchc (node_debug_info_needed): Likewise.
* name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
(pushdecl_top_level_with_init): ... here.
(pop_everything): Use namespace_bindings_p.
(--This line, and those below, will be ignored--

M    cp/ChangeLog
M    cp/method.c
M    cp/cp-tree.h
M    cp/decl.c
M    cp/lambda.c
M    cp/rtti.c
M    cp/name-lookup.c
M    cp/decl2.c
M    cp/name-lookup.h
M    cp/search.c

From-SVN: r247902

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/lambda.c
gcc/cp/method.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/rtti.c
gcc/cp/search.c

index 78695f7..c4afd41 100644 (file)
@@ -1,5 +1,21 @@
 2017-05-11  Nathan Sidwell  <nathan@acm.org>
 
+       * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
+       pushtag_top_level_maybe_friend,
+       pushdecl_top_level_and_finish): Move declarations to ...
+       * name-lookup.h: ... here.  Group pushdecl variants.
+       (pushdecl_top_level_and_finish): Rename to ...
+       (pushdecl_top_level_with_init): ... here.
+       * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
+       * decl2.c (get_guard, handle_tls_init): Likewise.
+       * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
+       * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
+       * method.c (implicitly_declare_fn): Likewise.
+       * searchc (node_debug_info_needed): Likewise.
+       * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
+       (pushdecl_top_level_with_init): ... here.
+       (pop_everything): Use namespace_bindings_p.
+
        * name-lookup.h (pop_binding): Rename to pop_local_binding.
        (getdecls): Rename to get_local_decls.
        * name-lookup.c (pop_binding): Rename to ...
index 09b1364..9596886 100644 (file)
@@ -5820,13 +5820,8 @@ extern bool fnptr_conv_p                 (tree, tree);
 extern tree strip_fnptr_conv                   (tree);
 
 /* in name-lookup.c */
-extern tree pushdecl                           (tree);
-extern tree pushdecl_maybe_friend              (tree, bool);
 extern void maybe_push_cleanup_level           (tree);
-extern tree pushtag                            (tree, tree, tag_scope);
 extern tree make_anon_name                     (void);
-extern tree pushdecl_top_level_maybe_friend    (tree, bool);
-extern tree pushdecl_top_level_and_finish      (tree, tree);
 extern tree check_for_out_of_scope_variable    (tree);
 extern void dump                               (cp_binding_level &ref);
 extern void dump                               (cp_binding_level *ptr);
index 9e913f3..9291b96 100644 (file)
@@ -4342,7 +4342,7 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep)
   else
     {
       DECL_THIS_STATIC (decl) = true;
-      pushdecl_top_level_and_finish (decl, init);
+      pushdecl_top_level_with_init (decl, init);
     }
 
   return decl;
index 46959ec..758c698 100644 (file)
@@ -3021,7 +3021,7 @@ get_guard (tree decl)
       DECL_ARTIFICIAL (guard) = 1;
       DECL_IGNORED_P (guard) = 1;
       TREE_USED (guard) = 1;
-      pushdecl_top_level_and_finish (guard, NULL_TREE);
+      pushdecl_top_level_with_init (guard, NULL_TREE);
     }
   return guard;
 }
@@ -4261,7 +4261,7 @@ handle_tls_init (void)
   TREE_USED (guard) = true;
   CP_DECL_THREAD_LOCAL_P (guard) = true;
   set_decl_tls_model (guard, decl_default_tls_model (guard));
-  pushdecl_top_level_and_finish (guard, NULL_TREE);
+  pushdecl_top_level_with_init (guard, NULL_TREE);
 
   tree fn = get_local_tls_init_fn ();
   start_preparsed_function (fn, NULL_TREE, SF_PRE_PARSED);
index 66b5312..80643ea 100644 (file)
@@ -1098,7 +1098,7 @@ maybe_add_lambda_conv_op (tree type)
   SET_OVERLOADED_OPERATOR_CODE (fn, TYPE_EXPR);
   grokclassfn (type, fn, NO_SPECIAL);
   set_linkage_according_to_type (type, fn);
-  rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
+  rest_of_decl_compilation (fn, namespace_bindings_p (), at_eof);
   DECL_IN_AGGR_P (fn) = 1;
   DECL_ARTIFICIAL (fn) = 1;
   DECL_NOT_REALLY_EXTERN (fn) = 1;
@@ -1128,7 +1128,7 @@ maybe_add_lambda_conv_op (tree type)
   DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop);
   grokclassfn (type, fn, NO_SPECIAL);
   set_linkage_according_to_type (type, fn);
-  rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
+  rest_of_decl_compilation (fn, namespace_bindings_p (), at_eof);
   DECL_IN_AGGR_P (fn) = 1;
   DECL_ARTIFICIAL (fn) = 1;
   DECL_NOT_REALLY_EXTERN (fn) = 1;
index 99e98cc..6a2f18c 100644 (file)
@@ -2096,7 +2096,7 @@ implicitly_declare_fn (special_function_kind kind, tree type,
   set_linkage_according_to_type (type, fn);
   if (TREE_PUBLIC (fn))
     DECL_COMDAT (fn) = 1;
-  rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
+  rest_of_decl_compilation (fn, namespace_bindings_p (), at_eof);
   gcc_assert (!TREE_USED (fn));
 
   /* Propagate constraints from the inherited constructor. */
index 041a5f6..0392651 100644 (file)
@@ -4588,7 +4588,7 @@ pushdecl_top_level_maybe_friend (tree x, bool is_friend)
    initializing it with INIT.  */
 
 tree
-pushdecl_top_level_and_finish (tree x, tree init)
+pushdecl_top_level_with_init (tree x, tree init)
 {
   return pushdecl_top_level_1 (x, &init, false);
 }
@@ -6618,7 +6618,7 @@ pop_everything (void)
 {
   if (ENABLE_SCOPE_CHECKING)
     verbatim ("XXX entering pop_everything ()\n");
-  while (!toplevel_bindings_p ())
+  while (!namespace_bindings_p ())
     {
       if (current_binding_level->kind == sk_class)
        pop_nested_class ();
index 9750196..f24461c 100644 (file)
@@ -282,29 +282,22 @@ struct GTY(()) cp_binding_level {
 extern cp_binding_level *leave_scope (void);
 extern bool kept_level_p (void);
 extern bool global_bindings_p (void);
-extern bool toplevel_bindings_p        (void);
+extern bool toplevel_bindings_p (void);
 extern bool namespace_bindings_p (void);
 extern bool local_bindings_p (void);
 extern bool template_parm_scope_p (void);
 extern scope_kind innermost_scope_kind (void);
 extern cp_binding_level *begin_scope (scope_kind, tree);
 extern void print_binding_stack        (void);
-extern void push_to_top_level (void);
-extern void pop_from_top_level (void);
 extern void pop_everything (void);
 extern void keep_next_level (bool);
-extern bool is_ancestor (tree, tree);
+extern bool is_ancestor (tree ancestor, tree descendant);
 extern tree push_scope (tree);
 extern void pop_scope (tree);
 extern tree push_inner_scope (tree);
 extern void pop_inner_scope (tree, tree);
 extern void push_binding_level (cp_binding_level *);
 \f
-extern tree pushdecl_outermost_localscope (tree);
-extern bool push_namespace (tree);
-extern void pop_namespace (void);
-extern void push_nested_namespace (tree);
-extern void pop_nested_namespace (tree);
 extern bool handle_namespace_attrs (tree, tree);
 extern void pushlevel_class (void);
 extern void poplevel_class (void);
@@ -342,6 +335,18 @@ extern tree innermost_non_namespace_value (tree);
 extern cxx_binding *outer_binding (tree, cxx_binding *, bool);
 extern void cp_emit_debug_info_for_using (tree, tree);
 
-extern tree pushdecl_top_level                 (tree);
+extern tree pushdecl_maybe_friend (tree, bool is_friend);
+extern tree pushdecl (tree);
+extern tree pushdecl_outermost_localscope (tree);
+extern tree pushdecl_top_level_maybe_friend (tree, bool is_friend);
+extern tree pushdecl_top_level (tree);
+extern tree pushdecl_top_level_with_init (tree, tree);
+extern tree pushtag (tree, tree, tag_scope);
+extern bool push_namespace (tree);
+extern void pop_namespace (void);
+extern void push_nested_namespace (tree);
+extern void pop_nested_namespace (tree);
+extern void push_to_top_level (void);
+extern void pop_from_top_level (void);
 
 #endif /* GCC_CP_NAME_LOOKUP_H */
index 89d1891..c5a110c 100644 (file)
@@ -445,7 +445,7 @@ get_tinfo_decl (tree type)
       DECL_NOT_REALLY_EXTERN (d) = 1;
       set_linkage_according_to_type (type, d);
 
-      d = pushdecl_top_level_and_finish (d, NULL_TREE);
+      d = pushdecl_top_level_with_init (d, NULL_TREE);
       if (CLASS_TYPE_P (type))
        CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
 
@@ -911,7 +911,7 @@ tinfo_base_init (tinfo_s *ti, tree target)
     name_string = tinfo_name (target, !TREE_PUBLIC (name_decl));
     DECL_INITIAL (name_decl) = name_string;
     mark_used (name_decl);
-    pushdecl_top_level_and_finish (name_decl, name_string);
+    pushdecl_top_level_with_init (name_decl, name_string);
   }
 
   vtable_ptr = ti->vtable;
index 09c1b4e..fa72c47 100644 (file)
@@ -2365,7 +2365,7 @@ note_debug_info_needed (tree type)
   if (TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type)))
     {
       TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (type)) = 0;
-      rest_of_type_compilation (type, toplevel_bindings_p ());
+      rest_of_type_compilation (type, namespace_bindings_p ());
     }
 
   dfs_walk_all (TYPE_BINFO (type), dfs_debug_mark, NULL, 0);