1 /* Language-specific hook definitions for C front end.
2 Copyright (C) 1991, 1995, 1997, 1998,
3 1999, 2000 Free Software Foundation, Inc.
5 This file is part of GNU CC.
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)
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.
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. */
38 extern cpp_reader parse_in
;
39 extern cpp_options parse_options
;
42 /* Each of the functions defined here
43 is an alternative to a function in objc-actions.c. */
46 lang_decode_option (argc
, argv
)
50 return c_decode_option (argc
, argv
);
57 cpp_reader_init (&parse_in
);
58 parse_in
.opts
= &parse_options
;
59 cpp_options_init (&parse_options
);
61 /* Mark as "unspecified". */
62 flag_bounds_check
= -1;
68 /* If still "unspecified", make it match -fbounded-pointers. */
69 if (flag_bounds_check
< 0)
70 flag_bounds_check
= flag_bounded_pointers
;
72 /* the beginning of the file is a new line; check for # */
73 /* With luck, we discover the real source file's name from that
74 and put it in input_filename. */
76 ungetc (check_newline (), finput
);
82 save_lang_status
= &push_c_function_context
;
83 restore_lang_status
= &pop_c_function_context
;
84 mark_lang_status
= &mark_c_function_context
;
101 print_lang_statistics ()
105 /* used by print-tree.c */
108 lang_print_xnode (file
, node
, indent
)
109 FILE *file ATTRIBUTE_UNUSED
;
110 tree node ATTRIBUTE_UNUSED
;
111 int indent ATTRIBUTE_UNUSED
;
115 /* Used by c-lex.c, but only for objc. */
118 lookup_interface (arg
)
119 tree arg ATTRIBUTE_UNUSED
;
126 tree arg ATTRIBUTE_UNUSED
;
132 maybe_objc_check_decl (decl
)
133 tree decl ATTRIBUTE_UNUSED
;
138 maybe_objc_comptypes (lhs
, rhs
, reflexive
)
139 tree lhs ATTRIBUTE_UNUSED
;
140 tree rhs ATTRIBUTE_UNUSED
;
141 int reflexive ATTRIBUTE_UNUSED
;
147 maybe_objc_method_name (decl
)
148 tree decl ATTRIBUTE_UNUSED
;
154 maybe_building_objc_message_expr ()
160 recognize_objc_keyword ()
166 build_objc_string (len
, str
)
167 int len ATTRIBUTE_UNUSED
;
168 const char *str ATTRIBUTE_UNUSED
;
174 /* Used by c-typeck.c (build_external_ref), but only for objc. */
177 lookup_objc_ivar (id
)
178 tree id ATTRIBUTE_UNUSED
;
183 /* Called at end of parsing, but before end-of-file processing. */
188 #ifndef ASM_OUTPUT_CONSTRUCTOR
189 extern tree static_ctors
;
191 #ifndef ASM_OUTPUT_DESTRUCTOR
192 extern tree static_dtors
;
194 extern tree build_function_call
PARAMS ((tree
, tree
));
195 #if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
196 tree void_list_node_1
= build_tree_list (NULL_TREE
, void_type_node
);
198 #ifndef ASM_OUTPUT_CONSTRUCTOR
201 tree fnname
= get_file_function_name ('I');
202 start_function (void_list_node_1
,
203 build_parse_node (CALL_EXPR
, fnname
,
204 tree_cons (NULL_TREE
, NULL_TREE
,
207 NULL_TREE
, NULL_TREE
);
208 fnname
= DECL_ASSEMBLER_NAME (current_function_decl
);
211 for (; static_ctors
; static_ctors
= TREE_CHAIN (static_ctors
))
212 expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors
),
217 assemble_constructor (IDENTIFIER_POINTER (fnname
));
220 #ifndef ASM_OUTPUT_DESTRUCTOR
223 tree fnname
= get_file_function_name ('D');
224 start_function (void_list_node_1
,
225 build_parse_node (CALL_EXPR
, fnname
,
226 tree_cons (NULL_TREE
, NULL_TREE
,
229 NULL_TREE
, NULL_TREE
);
230 fnname
= DECL_ASSEMBLER_NAME (current_function_decl
);
233 for (; static_dtors
; static_dtors
= TREE_CHAIN (static_dtors
))
234 expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors
),
239 assemble_destructor (IDENTIFIER_POINTER (fnname
));