(TARGET_FILE_SWITCHING): Define.
[official-gcc.git] / gcc / c-lang.c
blob2e59e3a15cb7fa627ba2e0b55d5aac9c47d9a0de
1 /* Language-specific hook definitions for C front end.
2 Copyright (C) 1991, 1995 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 "tree.h"
24 #include <stdio.h>
25 #include "input.h"
27 /* Each of the functions defined here
28 is an alternative to a function in objc-actions.c. */
30 int
31 lang_decode_option (p)
32 char *p;
34 return c_decode_option (p);
37 void
38 lang_init ()
40 /* the beginning of the file is a new line; check for # */
41 /* With luck, we discover the real source file's name from that
42 and put it in input_filename. */
43 ungetc (check_newline (), finput);
46 void
47 lang_finish ()
51 char *
52 lang_identify ()
54 return "c";
57 void
58 print_lang_statistics ()
62 /* Used by c-lex.c, but only for objc. */
64 tree
65 lookup_interface (arg)
66 tree arg;
68 return 0;
71 tree
72 is_class_name (arg)
73 tree arg;
75 return 0;
78 void
79 maybe_objc_check_decl (decl)
80 tree decl;
84 int
85 maybe_objc_comptypes (lhs, rhs, reflexive)
86 tree lhs, rhs;
87 int reflexive;
89 return -1;
92 tree
93 maybe_objc_method_name (decl)
94 tree decl;
96 return 0;
99 tree
100 maybe_building_objc_message_expr ()
102 return 0;
106 recognize_objc_keyword ()
108 return 0;
111 tree
112 build_objc_string (len, str)
113 int len;
114 char *str;
116 abort ();
117 return NULL_TREE;
120 void
121 GNU_xref_begin ()
123 fatal ("GCC does not yet support XREF");
126 void
127 GNU_xref_end ()
129 fatal ("GCC does not yet support XREF");
132 /* Called at end of parsing, but before end-of-file processing. */
134 void
135 finish_file ()
137 extern tree static_ctors, static_dtors;
138 extern tree get_file_function_name ();
139 extern tree build_function_call PROTO((tree, tree));
140 tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
141 #ifndef ASM_OUTPUT_CONSTRUCTOR
142 if (static_ctors)
144 tree fnname = get_file_function_name ('I');
145 start_function (void_list_node,
146 build_parse_node (CALL_EXPR, fnname, void_list_node,
147 NULL_TREE),
148 NULL_TREE, NULL_TREE, 0);
149 fnname = DECL_ASSEMBLER_NAME (current_function_decl);
150 store_parm_decls ();
152 for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors))
153 expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors),
154 NULL_TREE));
156 finish_function (0);
158 assemble_constructor (IDENTIFIER_POINTER (fnname));
160 #endif
161 #ifndef ASM_OUTPUT_DESTRUCTOR
162 if (static_dtors)
164 tree fnname = get_file_function_name ('D');
165 start_function (void_list_node,
166 build_parse_node (CALL_EXPR, fnname, void_list_node,
167 NULL_TREE),
168 NULL_TREE, NULL_TREE, 0);
169 fnname = DECL_ASSEMBLER_NAME (current_function_decl);
170 store_parm_decls ();
172 for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors))
173 expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors),
174 NULL_TREE));
176 finish_function (0);
178 assemble_destructor (IDENTIFIER_POINTER (fnname));
180 #endif