diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-03-07 01:20:52 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-03-07 01:20:52 +0000 |
commit | 8643e92d0dd681d4effd5e65a0c9471a523fb7f6 (patch) | |
tree | 8ad6744b26cfc9c5e368db3e98047b9f2c161c89 /gcc/objc/objc-act.c | |
parent | 7f3d80135f5d9e58ac87a6109eb1563e525a4c1a (diff) | |
download | gcc-8643e92d0dd681d4effd5e65a0c9471a523fb7f6.zip gcc-8643e92d0dd681d4effd5e65a0c9471a523fb7f6.tar.gz gcc-8643e92d0dd681d4effd5e65a0c9471a523fb7f6.tar.bz2 |
c-pch.c: Include langhooks.h.
* c-pch.c: Include langhooks.h.
(IDENT_LENGTH): New.
(get_ident): New.
(pch_ident): Delete.
(pch_init): Use get_ident, IDENT_LENGTH.
(c_common_valid_pch): Likewise. Also, use actual language
in warning message.
* Makefile.in (c-pch.o): Add langhooks.h to dependencies.
* objc/config-lang.in (gtfiles): Add objc-act.c. Remove duplicate
c-parse.in.
* objc/Make-lang.in (objc/objc-act.o): Add dependency on
gt-objc-objc-act.h.
(gt-objc-objc-act.h): New rule.
* objc/lang-specs.h: Support PCH.
* objc/objc-act.c: Include gt-objc-objc-act.h.
(objc_add_static_instance): Move num_static_inst out, mark for PCH.
(build_selector_reference_decl): Move idx out, mark for PCH.
(build_class_reference_decl): Likewise.
(build_objc_string_decl): Move *_idx out, mark for PCH.
(build_tmp_function_decl): Move xxx out, mark for PCH.
From-SVN: r63924
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index d3a22a3..c55f250 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -1361,11 +1361,11 @@ build_objc_string_object (strings) /* Declare a static instance of CLASS_DECL initialized by CONSTRUCTOR. */ +static GTY(()) int num_static_inst; static tree objc_add_static_instance (constructor, class_decl) tree constructor, class_decl; { - static int num_static_inst; tree *chain, decl; char buf[256]; @@ -1983,14 +1983,14 @@ generate_strings () } } +static GTY(()) int selector_reference_idx; static tree build_selector_reference_decl () { tree decl, ident; char buf[256]; - static int idx = 0; - sprintf (buf, "_OBJC_SELECTOR_REFERENCES_%d", idx++); + sprintf (buf, "_OBJC_SELECTOR_REFERENCES_%d", selector_reference_idx++); ident = get_identifier (buf); @@ -2198,14 +2198,14 @@ build_selector_reference (ident) build_int_2 (index, 0))); } +static GTY(()) int class_reference_idx; static tree build_class_reference_decl () { tree decl, ident; char buf[256]; - static int idx = 0; - sprintf (buf, "_OBJC_CLASS_REFERENCES_%d", idx++); + sprintf (buf, "_OBJC_CLASS_REFERENCES_%d", class_reference_idx++); ident = get_identifier (buf); @@ -2326,15 +2326,16 @@ add_objc_string (ident, section) return build_unary_op (ADDR_EXPR, decl, 1); } +static GTY(()) int class_names_idx; +static GTY(()) int meth_var_names_idx; +static GTY(()) int meth_var_types_idx; + static tree build_objc_string_decl (section) enum string_section section; { tree decl, ident; char buf[256]; - static int class_names_idx = 0; - static int meth_var_names_idx = 0; - static int meth_var_types_idx = 0; if (section == class_names) sprintf (buf, "_OBJC_CLASS_NAME_%d", class_names_idx++); @@ -2927,11 +2928,11 @@ generate_method_descriptors (protocol) /* Generate a temporary FUNCTION_DECL node to be used in hack_method_prototype below. */ +static GTY(()) int build_tmp_function_decl_xxx; static tree build_tmp_function_decl () { tree decl_specs, expr_decl, parms; - static int xxx = 0; char buffer[80]; /* struct objc_object *objc_xxx (id, SEL, ...); */ @@ -2953,7 +2954,7 @@ build_tmp_function_decl () poplevel (0, 0, 0); decl_specs = build_tree_list (NULL_TREE, objc_object_reference); - sprintf (buffer, "__objc_tmp_%x", xxx++); + sprintf (buffer, "__objc_tmp_%x", build_tmp_function_decl_xxx++); expr_decl = build_nt (CALL_EXPR, get_identifier (buffer), parms, NULL_TREE); expr_decl = build1 (INDIRECT_REF, NULL_TREE, expr_decl); @@ -8561,4 +8562,5 @@ lookup_objc_ivar (id) return 0; } +#include "gt-objc-objc-act.h" #include "gtype-objc.h" |