diff options
author | Jan Hubicka <jh@suse.cz> | 2007-05-11 14:18:17 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-05-11 12:18:17 +0000 |
commit | 7be82279042841a50c9a3464fce35c471fa07f1c (patch) | |
tree | 49ba9f2d2dd225ffee2443da3491e4fa57aa17a0 /gcc/c-common.c | |
parent | 2a5fce6d487573f7f330d721da83fd9881fdb06a (diff) | |
download | gcc-7be82279042841a50c9a3464fce35c471fa07f1c.tar.gz |
semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* decl2.c (start_objects): ctors and dtors are no longer public.
(cp_write_global_declarations): Do not call c_build_cdtor_fns.
* cgraphunit.c: Include gt-cgraphunit.h
(static_ctors, static_dtors): New static vars.
(record_cdtor_fn, build_cdtor, cgraph_build_cdtor_fns): New functions,
based on implementation in c-common.c
(cgraph_finalize_function): Call record_cdtor_fn.
(cgraph_optimize): Call cgraph_build_cdtor_fns.
* decl.c (finish_function): Do not call c_record_cdtor_fn.
(c_write_global_declarations): Do not call c_build_cdtor_fns.
* c-common.c (static_ctors, static_dtors, c_record_cdtor_fn,
build_cdtor, c_build_cdtor_fns): Remove.
* c-common.h (static_ctors, static_dtors, c_record_cdtor_fn,
c_build_cdtor_fns): Remove prototype.
From-SVN: r124618
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 4e92ae6073d..f93cac5f696 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -670,11 +670,6 @@ const struct attribute_spec c_common_format_attribute_table[] = { NULL, 0, 0, false, false, false, NULL } }; -/* Functions called automatically at the beginning and end of execution. */ - -tree static_ctors; -tree static_dtors; - /* Push current bindings for the function name VAR_DECLS. */ void @@ -6994,61 +6989,6 @@ warn_for_unused_label (tree label) } } -/* If FNDECL is a static constructor or destructor, add it to the list - of functions to be called by the file scope initialization - function. */ - -void -c_record_cdtor_fn (tree fndecl) -{ - if (targetm.have_ctors_dtors) - return; - - if (DECL_STATIC_CONSTRUCTOR (fndecl)) - static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); - if (DECL_STATIC_DESTRUCTOR (fndecl)) - static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); -} - -/* Synthesize a function which calls all the global ctors or global - dtors in this file. This is only used for targets which do not - support .ctors/.dtors sections. FIXME: Migrate into cgraph. */ -static void -build_cdtor (int method_type, tree cdtors) -{ - tree body = 0; - - if (!cdtors) - return; - - for (; cdtors; cdtors = TREE_CHAIN (cdtors)) - append_to_statement_list (build_function_call (TREE_VALUE (cdtors), 0), - &body); - - cgraph_build_static_cdtor (method_type, body, DEFAULT_INIT_PRIORITY); -} - -/* Generate functions to call static constructors and destructors - for targets that do not support .ctors/.dtors sections. These - functions have magic names which are detected by collect2. */ - -void -c_build_cdtor_fns (void) -{ - if (!targetm.have_ctors_dtors) - { - build_cdtor ('I', static_ctors); - static_ctors = NULL_TREE; - build_cdtor ('D', static_dtors); - static_dtors = NULL_TREE; - } - else - { - gcc_assert (!static_ctors); - gcc_assert (!static_dtors); - } -} - #ifndef TARGET_HAS_TARGETCM struct gcc_targetcm targetcm = TARGETCM_INITIALIZER; #endif |