diff options
author | Zack Weinberg <zack@codesourcery.com> | 2004-07-08 19:50:17 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2004-07-08 19:50:17 +0000 |
commit | 36c1b0def4a4672a93e846c610e19a1a15f4e17d (patch) | |
tree | b5d1f5dae24cf0c3994f99d911989c25185e3b7d /gcc/objc/objc-act.c | |
parent | 5b02f0e0046d946792d7e05b569cb6d2c54442ee (diff) | |
download | gcc-36c1b0def4a4672a93e846c610e19a1a15f4e17d.zip gcc-36c1b0def4a4672a93e846c610e19a1a15f4e17d.tar.gz gcc-36c1b0def4a4672a93e846c610e19a1a15f4e17d.tar.bz2 |
c-decl.c (static_ctors, [...]): Make static.
* c-decl.c (static_ctors, static_dtors): Make static.
(pop_file_scope): Call c_common_write_pch and
cgraph_finalize_compilation_unit here.
(build_cdtor): Moved here from c-objc-common.c; simplify.
(c_write_global_declarations_1): Clarify comment.
(c_write_global_declarations): Close the external scope before
doing anything else. Call build_cdtor, cgraph_optimize, and
mudflap_finish_file here.
* c-lang.c (finish_file): Don't call c_objc_common_finish_file.
Clarify comment.
* c-objc-common.c: No need to include cgraph.h.
(build_cdtor): Moved to c-decl.c.
(c_objc_common_finish_file): Delete.
* c-tree.h: Update to match.
* objc/objc-act.c (finish_file): Don't call c_objc_common_finish_file.
(generate_static_references): Set TREE_USED before calling finish_decl.
Eliminate unnecessary dummy declaration. Call rest_of_decl_compilation
on the static_instances_decl.
From-SVN: r84307
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 308f2ac..3f17ba7 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -519,7 +519,6 @@ void finish_file (void) { mark_referenced_methods (); - c_objc_common_finish_file (); /* Finalize Objective-C runtime data. No need to generate tables and code if only checking syntax. */ @@ -1959,7 +1958,7 @@ generate_static_references (void) { tree decls = NULL_TREE, ident, decl_spec, expr_decl, expr = NULL_TREE; tree class_name, class, decl, initlist; - tree cl_chain, in_chain, type; + tree cl_chain, in_chain; int num_inst, num_class; char buf[256]; @@ -1982,6 +1981,7 @@ generate_static_references (void) decl = start_decl (expr_decl, decl_spec, 1, NULL_TREE); DECL_CONTEXT (decl) = 0; DECL_ARTIFICIAL (decl) = 1; + TREE_USED (decl) = 1; /* Output {class_name, ...}. */ class = TREE_VALUE (cl_chain); @@ -2002,12 +2002,6 @@ generate_static_references (void) expr = objc_build_constructor (TREE_TYPE (decl), nreverse (initlist)); finish_decl (decl, expr, NULL_TREE); - TREE_USED (decl) = 1; - - type = build_array_type (build_pointer_type (void_type_node), 0); - decl = build_decl (VAR_DECL, ident, type); - TREE_USED (decl) = 1; - TREE_STATIC (decl) = 1; decls = tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, decl, 1), decls); } @@ -2026,6 +2020,7 @@ generate_static_references (void) expr = objc_build_constructor (TREE_TYPE (static_instances_decl), nreverse (decls)); finish_decl (static_instances_decl, expr, NULL_TREE); + rest_of_decl_compilation (static_instances_decl, 0, 0, 0); } /* Output all strings. */ |