1998-09-21 Ben Elliston <bje@cygnus.com>
[official-gcc.git] / gcc / c-lang.c
blob8a5fd6bbfefb6ff414308e3f78396a7f2e468e08
1 /* Language-specific hook definitions for C front end.
2 Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 #include "config.h"
23 #include "system.h"
24 #include "tree.h"
25 #include "input.h"
26 #include "c-tree.h"
27 #include "c-lex.h"
28 #include "toplev.h"
29 #include "output.h"
31 /* Each of the functions defined here
32 is an alternative to a function in objc-actions.c. */
34 int
35 lang_decode_option (argc, argv)
36 int argc;
37 char **argv;
39 return c_decode_option (argc, argv);
42 void
43 lang_init_options ()
47 void
48 lang_init ()
50 #if !USE_CPPLIB
51 /* the beginning of the file is a new line; check for # */
52 /* With luck, we discover the real source file's name from that
53 and put it in input_filename. */
54 ungetc (check_newline (), finput);
55 #endif
58 void
59 lang_finish ()
63 char *
64 lang_identify ()
66 return "c";
69 void
70 print_lang_statistics ()
74 /* used by print-tree.c */
76 void
77 lang_print_xnode (file, node, indent)
78 FILE *file ATTRIBUTE_UNUSED;
79 tree node ATTRIBUTE_UNUSED;
80 int indent ATTRIBUTE_UNUSED;
84 /* Used by c-lex.c, but only for objc. */
86 tree
87 lookup_interface (arg)
88 tree arg ATTRIBUTE_UNUSED;
90 return 0;
93 tree
94 is_class_name (arg)
95 tree arg ATTRIBUTE_UNUSED;
97 return 0;
100 void
101 maybe_objc_check_decl (decl)
102 tree decl ATTRIBUTE_UNUSED;
107 maybe_objc_comptypes (lhs, rhs, reflexive)
108 tree lhs ATTRIBUTE_UNUSED;
109 tree rhs ATTRIBUTE_UNUSED;
110 int reflexive ATTRIBUTE_UNUSED;
112 return -1;
115 tree
116 maybe_objc_method_name (decl)
117 tree decl ATTRIBUTE_UNUSED;
119 return 0;
122 tree
123 maybe_building_objc_message_expr ()
125 return 0;
129 recognize_objc_keyword ()
131 return 0;
134 tree
135 build_objc_string (len, str)
136 int len ATTRIBUTE_UNUSED;
137 char *str ATTRIBUTE_UNUSED;
139 abort ();
140 return NULL_TREE;
143 /* Called at end of parsing, but before end-of-file processing. */
145 void
146 finish_file ()
148 #ifndef ASM_OUTPUT_CONSTRUCTOR
149 extern tree static_ctors;
150 #endif
151 #ifndef ASM_OUTPUT_DESTRUCTOR
152 extern tree static_dtors;
153 #endif
154 extern tree build_function_call PROTO((tree, tree));
155 #if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
156 tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
157 #endif
158 #ifndef ASM_OUTPUT_CONSTRUCTOR
159 if (static_ctors)
161 tree fnname = get_file_function_name ('I');
162 start_function (void_list_node,
163 build_parse_node (CALL_EXPR, fnname, void_list_node,
164 NULL_TREE),
165 NULL_TREE, NULL_TREE, 0);
166 fnname = DECL_ASSEMBLER_NAME (current_function_decl);
167 store_parm_decls ();
169 for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors))
170 expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors),
171 NULL_TREE));
173 finish_function (0);
175 assemble_constructor (IDENTIFIER_POINTER (fnname));
177 #endif
178 #ifndef ASM_OUTPUT_DESTRUCTOR
179 if (static_dtors)
181 tree fnname = get_file_function_name ('D');
182 start_function (void_list_node,
183 build_parse_node (CALL_EXPR, fnname, void_list_node,
184 NULL_TREE),
185 NULL_TREE, NULL_TREE, 0);
186 fnname = DECL_ASSEMBLER_NAME (current_function_decl);
187 store_parm_decls ();
189 for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors))
190 expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors),
191 NULL_TREE));
193 finish_function (0);
195 assemble_destructor (IDENTIFIER_POINTER (fnname));
197 #endif