diff options
author | zlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-15 21:47:32 +0000 |
---|---|---|
committer | zlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-15 21:47:32 +0000 |
commit | 800b56f28d8519dee86a80792a8188ffe944b363 (patch) | |
tree | c3e8f860a2a9a8b5b2e3bce09b608aa48c4c8708 /gcc/objc | |
parent | 587754e3e64330d3bc99a538cf228f6c03d094e0 (diff) | |
download | gcc-800b56f28d8519dee86a80792a8188ffe944b363.tar.gz |
[gcc/ChangeLog]
2004-08-15 Ziemowit Laski <zlaski@apple.com>
* Makefile.in (C_PRETTY_PRINT_H): Add c-pretty-print.h.
(c-lang.o): Depend on c-objc-common.h.
(c-objc-common.o): Depend on $(C_PRETTY_PRINT_H) and
c-objc-common.h; remove duplicate $(C_TREE_H) dependency.
* c-lang.c: Include c-objc-common.h.
(LANG_HOOKS_FINISH, LANG_HOOKS_INIT_OPTIONS,
LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
LANG_HOOKS_MISSING_ARGUMENT, LANG_HOOKS_POST_OPTIONS,
LANG_HOOKS_GET_ALIAS_SET, LANG_HOOKS_SAFE_FROM_P,
LANG_HOOKS_EXPAND_EXPR, LANG_HOOKS_MARK_ADDRESSABLE,
LANG_HOOKS_PARSE_FILE, LANG_HOOKS_TRUTHVALUE_CONVERSION,
LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL,
LANG_HOOKS_STATICP, LANG_HOOKS_SET_DECL_ASSEMBLER_NAME,
LANG_HOOKS_NO_BODY_BLOCKS, LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_DUP_LANG_SPECIFIC_DECL,
LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT,
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS,
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING,
LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_TYPE_FOR_MODE,
LANG_HOOKS_TYPE_FOR_SIZE, LANG_HOOKS_SIGNED_TYPE,
LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE,
LANG_HOOKS_INCOMPLETE_TYPE_ERROR, LANG_HOOKS_TYPE_PROMOTES_TO,
LANG_HOOKS_REGISTER_BUILTIN_TYPE, LANG_HOOKS_WRITE_GLOBALS):
Move to c-objc-common.h.
* c-objc-common.c: Include c-objc-common.h.
* c-objc-common.h: New file.
[gcc/objc/ChangeLog]
2004-08-15 Ziemowit Laski <zlaski@apple.com>
* Make-lang.in (objc/objc-lang.o): Depend on $(C_PRETTY_PRINT_H),
$(DIAGNOSTIC_H), c-objc-common.h and gtype-objc.h, but not on toplev.h.
(objc/objc-parse.o): Do not depend on gtype-objc.h.
* objc-act.c: Do not include gtype-objc.h.
(finish_file): Rename to objc_finish_file().
* objc-act.h (finish_file): Update copyright notice; remove prototype.
* objc-lang.c: Update copyright notice; include diagnostic.h,
c-objc-common.h, c-pretty-print.h and gtype-objc.h; do not include
toplev.h.
(finish_file): New hook routine.
(LANG_HOOKS_FINISH, LANG_HOOKS_INIT_OPTIONS,
LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
LANG_HOOKS_MISSING_ARGUMENT, LANG_HOOKS_POST_OPTIONS,
LANG_HOOKS_GET_ALIAS_SET, LANG_HOOKS_SAFE_FROM_P,
LANG_HOOKS_EXPAND_EXPR, LANG_HOOKS_MARK_ADDRESSABLE,
LANG_HOOKS_PARSE_FILE, LANG_HOOKS_TRUTHVALUE_CONVERSION,
LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL,
LANG_HOOKS_STATICP, LANG_HOOKS_SET_DECL_ASSEMBLER_NAME,
LANG_HOOKS_NO_BODY_BLOCKS, LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_DUP_LANG_SPECIFIC_DECL,
LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT,
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS,
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING,
LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_TYPE_FOR_MODE,
LANG_HOOKS_TYPE_FOR_SIZE, LANG_HOOKS_SIGNED_TYPE,
LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE,
LANG_HOOKS_INCOMPLETE_TYPE_ERROR, LANG_HOOKS_TYPE_PROMOTES_TO,
LANG_HOOKS_REGISTER_BUILTIN_TYPE, LANG_HOOKS_WRITE_GLOBALS):
Move to c-objc-common.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86037 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/ChangeLog | 37 | ||||
-rw-r--r-- | gcc/objc/Make-lang.in | 8 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 3 | ||||
-rw-r--r-- | gcc/objc/objc-act.h | 6 | ||||
-rw-r--r-- | gcc/objc/objc-lang.c | 124 |
5 files changed, 66 insertions, 112 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog new file mode 100644 index 00000000000..d9f42f9df90 --- /dev/null +++ b/gcc/objc/ChangeLog @@ -0,0 +1,37 @@ +2004-08-15 Ziemowit Laski <zlaski@apple.com> + + * Make-lang.in (objc/objc-lang.o): Depend on $(C_PRETTY_PRINT_H), + $(DIAGNOSTIC_H), c-objc-common.h and gtype-objc.h, but not on toplev.h. + (objc/objc-parse.o): Do not depend on gtype-objc.h. + * objc-act.c: Do not include gtype-objc.h. + (finish_file): Rename to objc_finish_file(). + * objc-act.h (finish_file): Update copyright notice; remove prototype. + * objc-lang.c: Update copyright notice; include diagnostic.h, + c-objc-common.h, c-pretty-print.h and gtype-objc.h; do not include + toplev.h. + (finish_file): New hook routine. + (LANG_HOOKS_FINISH, LANG_HOOKS_INIT_OPTIONS, + LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION, + LANG_HOOKS_MISSING_ARGUMENT, LANG_HOOKS_POST_OPTIONS, + LANG_HOOKS_GET_ALIAS_SET, LANG_HOOKS_SAFE_FROM_P, + LANG_HOOKS_EXPAND_EXPR, LANG_HOOKS_MARK_ADDRESSABLE, + LANG_HOOKS_PARSE_FILE, LANG_HOOKS_TRUTHVALUE_CONVERSION, + LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL, + LANG_HOOKS_STATICP, LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, + LANG_HOOKS_NO_BODY_BLOCKS, LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_FUNCTION_ENTER_NESTED, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, + LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT, + LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, + LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, + LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, + LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, + LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING, + LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, + LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, + LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_TYPE_FOR_MODE, + LANG_HOOKS_TYPE_FOR_SIZE, LANG_HOOKS_SIGNED_TYPE, + LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, + LANG_HOOKS_INCOMPLETE_TYPE_ERROR, LANG_HOOKS_TYPE_PROMOTES_TO, + LANG_HOOKS_REGISTER_BUILTIN_TYPE, LANG_HOOKS_WRITE_GLOBALS): + Move to c-objc-common.h. diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in index 12a20569c67..a6d93b208d1 100644 --- a/gcc/objc/Make-lang.in +++ b/gcc/objc/Make-lang.in @@ -59,8 +59,10 @@ cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS) # Objective C language specific files. objc/objc-lang.o : objc/objc-lang.c \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) c-tree.h \ - c-common.h toplev.h objc/objc-act.h langhooks.h $(LANGHOOKS_DEF_H) + $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(C_TREE_H) $(C_PRETTY_PRINT_H) $(DIAGNOSTIC_H) \ + $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \ + c-objc-common.h objc/objc-act.h objc/objc-parse.o : objc/objc-parse.c \ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \ @@ -71,7 +73,7 @@ objc/objc-act.o : objc/objc-act.c \ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_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) gt-objc-objc-act.h gtype-objc.h + $(LANGHOOKS_DEF_H) gt-objc-objc-act.h objc.srcextra: objc/objc-parse.c objc/objc-parse.y -cp -p $^ $(srcdir)/objc diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index b718714c996..a97ca68d50f 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -516,7 +516,7 @@ objc_init (void) } void -finish_file (void) +objc_finish_file (void) { mark_referenced_methods (); @@ -9086,4 +9086,3 @@ lookup_objc_ivar (tree id) } #include "gt-objc-objc-act.h" -#include "gtype-objc.h" diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index dab0950c3f1..eb324b9c520 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -1,5 +1,5 @@ /* Declarations for objc-act.c. - Copyright (C) 1990, 2000, 2001, 2002, 2003 + Copyright (C) 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -22,14 +22,14 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_OBJC_ACT_H #define GCC_OBJC_ACT_H -/*** Public Interface (procedures) ***/ +/*** Language hooks ***/ bool objc_init (void); const char *objc_printable_name (tree, int); +void objc_finish_file (void); /* used by yyparse */ -void finish_file (void); tree start_class (enum tree_code, tree, tree, tree); tree continue_class (tree); void finish_class (tree); diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c index 5856ad599d3..0b657725306 100644 --- a/gcc/objc/objc-lang.c +++ b/gcc/objc/objc-lang.c @@ -26,123 +26,28 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "c-tree.h" #include "c-common.h" -#include "toplev.h" +#include "ggc.h" #include "objc-act.h" #include "langhooks.h" #include "langhooks-def.h" +#include "diagnostic.h" +#include "c-pretty-print.h" +#include "c-objc-common.h" enum c_language_kind c_language = clk_objc; +/* Lang hooks common to C and ObjC are declared in c-objc-common.h; + consequently, there should be very few hooks below. */ + #undef LANG_HOOKS_NAME #define LANG_HOOKS_NAME "GNU Objective-C" -#undef LANG_HOOKS_IDENTIFIER_SIZE -#define LANG_HOOKS_IDENTIFIER_SIZE C_SIZEOF_STRUCT_LANG_IDENTIFIER #undef LANG_HOOKS_INIT #define LANG_HOOKS_INIT objc_init -#undef LANG_HOOKS_FINISH -#define LANG_HOOKS_FINISH c_common_finish -#undef LANG_HOOKS_INIT_OPTIONS -#define LANG_HOOKS_INIT_OPTIONS c_common_init_options -#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS -#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics -#undef LANG_HOOKS_HANDLE_OPTION -#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option -#undef LANG_HOOKS_HANDLE_FILENAME -#define LANG_HOOKS_HANDLE_FILENAME c_common_handle_filename -#undef LANG_HOOKS_MISSING_ARGUMENT -#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument -#undef LANG_HOOKS_POST_OPTIONS -#define LANG_HOOKS_POST_OPTIONS c_common_post_options -#undef LANG_HOOKS_GET_ALIAS_SET -#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set -#undef LANG_HOOKS_PARSE_FILE -#define LANG_HOOKS_PARSE_FILE c_common_parse_file -#undef LANG_HOOKS_EXPAND_EXPR -#define LANG_HOOKS_EXPAND_EXPR c_expand_expr -#undef LANG_HOOKS_EXPAND_DECL -#define LANG_HOOKS_EXPAND_DECL c_expand_decl -#undef LANG_HOOKS_MARK_ADDRESSABLE -#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_objc_common_truthvalue_conversion -#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL -#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl -#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS -#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true -#undef LANG_HOOKS_STATICP -#define LANG_HOOKS_STATICP c_staticp -#undef LANG_HOOKS_NO_BODY_BLOCKS -#define LANG_HOOKS_NO_BODY_BLOCKS true -#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL -#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl -#undef LANG_HOOKS_PRINT_IDENTIFIER -#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier #undef LANG_HOOKS_DECL_PRINTABLE_NAME #define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name -#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL -#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl - -#undef LANG_HOOKS_FUNCTION_ENTER_NESTED -#define LANG_HOOKS_FUNCTION_ENTER_NESTED c_push_function_context -#undef LANG_HOOKS_FUNCTION_LEAVE_NESTED -#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context -#undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P -#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P c_missing_noreturn_ok_p - -/* Attribute hooks. */ -#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE -#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table -#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE -#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table - -/* Inlining hooks same as the C front end. */ -#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN -#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ - c_cannot_inline_tree_fn -#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS -#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \ - c_disregard_inline_limits -#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P -#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \ - anon_aggr_type_p -#undef LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING -#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \ - c_convert_parm_for_inlining - -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body - -#undef LANG_HOOKS_TYPE_FOR_MODE -#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode -#undef LANG_HOOKS_TYPE_FOR_SIZE -#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size -#undef LANG_HOOKS_SIGNED_TYPE -#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type -#undef LANG_HOOKS_UNSIGNED_TYPE -#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type -#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE -#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type -#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR -#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error -#undef LANG_HOOKS_TYPE_PROMOTES_TO -#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to -#undef LANG_HOOKS_GIMPLIFY_EXPR -#define LANG_HOOKS_GIMPLIFY_EXPR c_gimplify_expr - -/* The C front end's scoping structure is very different from - that expected by the language-independent code; it is best - to disable getdecls. - This means it must also provide its own write_globals. */ - -#undef LANG_HOOKS_GETDECLS -#define LANG_HOOKS_GETDECLS lhd_return_null_tree_v -#undef LANG_HOOKS_WRITE_GLOBALS -#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations - -/* Each front end provides its own hooks, for toplev.c. */ -const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; -/* Define the special tree codes that we use. */ +/* Each front end provides its own lang hook initializer. */ +const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; /* Table indexed by tree code giving a string containing a character classifying the tree code. */ @@ -185,3 +90,14 @@ const char * const tree_code_name[] = { #include "objc-tree.def" }; #undef DEFTREECODE + +/* Lang hook routines common to C and ObjC appear in c-objc-common.c; + there should be very few (if any) routines below. */ + +void +finish_file (void) +{ + objc_finish_file (); +} + +#include "gtype-objc.h" |