diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-05-09 11:17:45 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-05-09 11:17:45 +0000 |
commit | 641da50a0c73f734e672f8e6b9e7d2c86bde840d (patch) | |
tree | 50f0386875fa98e4952321dcf3a16862b140cb74 /gcc/cp/cp-lang.c | |
parent | 40abbbea6659b07309e39355d06792dd7db13884 (diff) | |
download | gcc-641da50a0c73f734e672f8e6b9e7d2c86bde840d.zip gcc-641da50a0c73f734e672f8e6b9e7d2c86bde840d.tar.gz gcc-641da50a0c73f734e672f8e6b9e7d2c86bde840d.tar.bz2 |
c-tree.h (pushdecl): Declare.
gcc/c/
* c-tree.h (pushdecl): Declare.
gcc/cp/
* cp-lang.c (get_global_decls, cxx_pushdecl): New.
(LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
* name-lookup.h (pushdecl_top_level): Declare.
gcc/c-family/
* c-common.c (c_register_builtin_type): Use pushdecl lang_hook.
* c-common.h (pushdecl_top_level, pushdecl): Don't declare here.
gcc/objc/
* objc-gnu-runtime-abi-01.c (objc_add_static_instance): Use
pushdecl lang_hook.
From-SVN: r247785
Diffstat (limited to 'gcc/cp/cp-lang.c')
-rw-r--r-- | gcc/cp/cp-lang.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index d4776a2..b5f11e3 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -35,6 +35,8 @@ static tree cp_eh_personality (void); static tree get_template_innermost_arguments_folded (const_tree); static tree get_template_argument_pack_elems_folded (const_tree); static tree cxx_enum_underlying_base_type (const_tree); +static tree get_global_decls (); +static tree cxx_pushdecl (tree); /* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h; consequently, there should be very few hooks below. */ @@ -78,6 +80,10 @@ static tree cxx_enum_underlying_base_type (const_tree); #define LANG_HOOKS_EH_RUNTIME_TYPE build_eh_type_type #undef LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE #define LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE cxx_enum_underlying_base_type +#undef LANG_HOOKS_GETDECLS +#define LANG_HOOKS_GETDECLS get_global_decls +#undef LANG_HOOKS_PUSHDECL +#define LANG_HOOKS_PUSHDECL cxx_pushdecl /* Each front end provides its own lang hook initializer. */ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -229,5 +235,21 @@ tree cxx_enum_underlying_base_type (const_tree type) return underlying_type; } +/* Return the list of decls in the global namespace. */ + +static tree +get_global_decls () +{ + return NAMESPACE_LEVEL (global_namespace)->names; +} + +/* Push DECL into the current scope. */ + +static tree +cxx_pushdecl (tree decl) +{ + return pushdecl (decl); +} + #include "gt-cp-cp-lang.h" #include "gtype-cp.h" |