OSDN Git Service

* Makefile.in (attribs.o): Update.
[pf3gnuchains/gcc-fork.git] / gcc / objc / objc-lang.c
1 /* Language-dependent hooks for Objective-C.
2    Copyright 2001 Free Software Foundation, Inc.
3    Contributed by Ziemowit Laski  <zlaski@apple.com>
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "tree.h"
25 #include "c-tree.h"
26 #include "c-common.h"
27 #include "toplev.h"
28 #include "objc-act.h"
29 #include "langhooks.h"
30 #include "langhooks-def.h"
31
32 static void objc_init_options                   PARAMS ((void));
33 static void objc_post_options                   PARAMS ((void));
34
35 #undef LANG_HOOKS_NAME
36 #define LANG_HOOKS_NAME "GNU Objective-C"  
37 #undef LANG_HOOKS_INIT
38 #define LANG_HOOKS_INIT objc_init
39 #undef LANG_HOOKS_FINISH
40 #define LANG_HOOKS_FINISH c_common_finish
41 #undef LANG_HOOKS_INIT_OPTIONS
42 #define LANG_HOOKS_INIT_OPTIONS objc_init_options
43 #undef LANG_HOOKS_DECODE_OPTION
44 #define LANG_HOOKS_DECODE_OPTION objc_decode_option
45 #undef LANG_HOOKS_POST_OPTIONS
46 #define LANG_HOOKS_POST_OPTIONS objc_post_options
47 #undef LANG_HOOKS_PARSE_FILE
48 #define LANG_HOOKS_PARSE_FILE c_common_parse_file
49 #undef LANG_HOOKS_MARK_TREE
50 #define LANG_HOOKS_MARK_TREE c_mark_tree
51 #undef LANG_HOOKS_EXPAND_EXPR
52 #define LANG_HOOKS_EXPAND_EXPR c_expand_expr
53 #undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
54 #define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
55 #undef LANG_HOOKS_STATICP
56 #define LANG_HOOKS_STATICP c_staticp
57 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
58 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
59 #undef LANG_HOOKS_PRINT_IDENTIFIER
60 #define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier
61 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
62 #define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
63 #undef LANG_HOOKS_SET_YYDEBUG
64 #define LANG_HOOKS_SET_YYDEBUG c_set_yydebug
65 /* Inlining hooks same as the C front end.  */
66 #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
67 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
68   c_cannot_inline_tree_fn
69 #undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
70 #define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
71   c_disregard_inline_limits
72 #undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
73 #define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
74   anon_aggr_type_p
75 #undef LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING
76 #define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
77   c_convert_parm_for_inlining
78
79 /* Each front end provides its own hooks, for toplev.c.  */
80 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
81
82 /* Define the special tree codes that we use.  */
83
84 /* Table indexed by tree code giving a string containing a character
85    classifying the tree code.  */
86
87 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
88
89 const char tree_code_type[] = {
90 #include "tree.def"
91   'x',
92 #include "c-common.def"
93   'x',
94 #include "objc-tree.def"
95 };
96 #undef DEFTREECODE
97
98 /* Table indexed by tree code giving number of expression
99    operands beyond the fixed part of the node structure.
100    Not used for types or decls.  */
101
102 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
103
104 const unsigned char tree_code_length[] = {
105 #include "tree.def"
106   0,
107 #include "c-common.def"
108   0,
109 #include "objc-tree.def"
110 };
111 #undef DEFTREECODE
112
113 /* Names of tree components.
114    Used for printing out the tree and error messages.  */
115 #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
116
117 const char * const tree_code_name[] = {
118 #include "tree.def"
119   "@@dummy",
120 #include "c-common.def"
121   "@@dummy",
122 #include "objc-tree.def"
123 };
124 #undef DEFTREECODE
125
126 static void 
127 objc_init_options ()
128 {
129   c_common_init_options (clk_objective_c);
130
131
132 /* Post-switch processing.  */
133
134 static void
135 objc_post_options ()
136 {
137   c_common_post_options ();
138 }
139
140