aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2003-03-07 01:20:52 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2003-03-07 01:20:52 +0000
commit8643e92d0dd681d4effd5e65a0c9471a523fb7f6 (patch)
tree8ad6744b26cfc9c5e368db3e98047b9f2c161c89 /gcc/objc
parent7f3d80135f5d9e58ac87a6109eb1563e525a4c1a (diff)
downloadgcc-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')
-rw-r--r--gcc/objc/Make-lang.in3
-rw-r--r--gcc/objc/config-lang.in2
-rw-r--r--gcc/objc/lang-specs.h16
-rw-r--r--gcc/objc/objc-act.c22
4 files changed, 29 insertions, 14 deletions
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 6c5acd6..1904e3d 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -71,7 +71,7 @@ objc/objc-act.o : objc/objc-act.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(EXPR_H) \
$(TARGET_H) $(C_TREE_H) diagnostic.h toplev.h flags.h objc/objc-act.h \
input.h function.h output.h debug.h langhooks.h $(LANGHOOKS_DEF_H) \
- gtype-objc.h
+ gt-objc-objc-act.h gtype-objc.h
po-generated: $(parsedir)/objc/objc-parse.c
$(parsedir)/objc/objc-parse.c : $(parsedir)/objc/objc-parse.y
@@ -92,6 +92,7 @@ $(parsedir)/objc/objc-parse.y: $(srcdir)/c-parse.in
$(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(parsedir)/objc/objc-parse.y
gtype-objc.h : s-gtype ; @true
+gt-objc-objc-act.h : s-gtype ; @true
#
# Build hooks:
diff --git a/gcc/objc/config-lang.in b/gcc/objc/config-lang.in
index f18783c..705a76a 100644
--- a/gcc/objc/config-lang.in
+++ b/gcc/objc/config-lang.in
@@ -34,4 +34,4 @@ stagestuff=""
target_libs=target-libobjc
-gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-parse.in"
+gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/objc/objc-act.c"
diff --git a/gcc/objc/lang-specs.h b/gcc/objc/lang-specs.h
index f8e6761..379547f 100644
--- a/gcc/objc/lang-specs.h
+++ b/gcc/objc/lang-specs.h
@@ -24,8 +24,6 @@ Boston, MA 02111-1307, USA. */
{".m", "@objective-c", 0},
{"@objective-c",
- /* cc1obj has an integrated ISO C preprocessor. We should invoke the
- external preprocessor if -save-temps or -traditional is given. */
"%{E|M|MM:%(trad_capable_cpp)\
-lang-objc %(cpp_options) %(cpp_debug_options)}\
%{!E:%{!M:%{!MM:\
@@ -40,3 +38,17 @@ Boston, MA 02111-1307, USA. */
{"@objc-cpp-output",
"%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{gen-decls}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
+ {"@objective-c-header",
+ "%{E|M|MM:%(trad_capable_cpp)\
+ -lang-objc %(cpp_options) %(cpp_debug_options)}\
+ %{!E:%{!M:%{!MM:\
+ %{traditional|ftraditional|traditional-cpp:\
+%eGNU Objective C no longer supports traditional compilation}\
+ %{save-temps:cc1obj -E %(cpp_options) %b.mi \n\
+ cc1obj -fpreprocessed %b.mi %(cc1_options) %{gen-decls}\
+ -o %g.s %{!o*:--output-pch=%i.pch}\
+ %W{o*:--output-pch=%*}%V}\
+ %{!save-temps:\
+ cc1obj %(cpp_unique_options) %(cc1_options) %{gen-decls}\
+ -o %g.s %{!o*:--output-pch=%i.pch}\
+ %W{o*:--output-pch=%*}%V}}}}", 0},
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"