]> gcc.gnu.org Git - gcc.git/blame - gcc/c-lang.c
Major cutover to using system.h:
[gcc.git] / gcc / c-lang.c
CommitLineData
c0f940ef 1/* Language-specific hook definitions for C front end.
2e6a5989 2 Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc.
c0f940ef
RS
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
940d9d63
RK
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
c0f940ef
RS
20
21
22#include "config.h"
670ee920 23#include "system.h"
c0f940ef 24#include "tree.h"
c0f940ef
RS
25#include "input.h"
26
27/* Each of the functions defined here
28 is an alternative to a function in objc-actions.c. */
29
30int
31lang_decode_option (p)
32 char *p;
33{
34 return c_decode_option (p);
35}
36
37void
38lang_init ()
39{
40365c92 40#if !USE_CPPLIB
c0f940ef
RS
41 /* the beginning of the file is a new line; check for # */
42 /* With luck, we discover the real source file's name from that
43 and put it in input_filename. */
44 ungetc (check_newline (), finput);
40365c92 45#endif
c0f940ef
RS
46}
47
48void
49lang_finish ()
50{
51}
52
d0d4af87
MS
53char *
54lang_identify ()
55{
56 return "c";
57}
58
a604ca26
TW
59void
60print_lang_statistics ()
61{
62}
63
c0f940ef 64/* Used by c-lex.c, but only for objc. */
a604ca26 65
c0f940ef
RS
66tree
67lookup_interface (arg)
68 tree arg;
69{
70 return 0;
71}
72
a604ca26
TW
73tree
74is_class_name (arg)
75 tree arg;
76{
77 return 0;
78}
79
c0f940ef
RS
80void
81maybe_objc_check_decl (decl)
82 tree decl;
83{
84}
85
86int
a604ca26 87maybe_objc_comptypes (lhs, rhs, reflexive)
c0f940ef 88 tree lhs, rhs;
a604ca26
TW
89 int reflexive;
90{
a0825a7f 91 return -1;
a604ca26
TW
92}
93
94tree
95maybe_objc_method_name (decl)
96 tree decl;
c0f940ef
RS
97{
98 return 0;
99}
100
101tree
102maybe_building_objc_message_expr ()
103{
104 return 0;
105}
106
107int
108recognize_objc_keyword ()
109{
110 return 0;
111}
112
a604ca26
TW
113tree
114build_objc_string (len, str)
115 int len;
116 char *str;
c0f940ef 117{
a604ca26
TW
118 abort ();
119 return NULL_TREE;
c0f940ef
RS
120}
121
122void
123GNU_xref_begin ()
124{
125 fatal ("GCC does not yet support XREF");
126}
127
128void
129GNU_xref_end ()
130{
131 fatal ("GCC does not yet support XREF");
132}
2c5f4139 133
0f41302f
MS
134/* Called at end of parsing, but before end-of-file processing. */
135
2c5f4139
JM
136void
137finish_file ()
138{
69d4ca36
RL
139#ifndef ASM_OUTPUT_CONSTRUCTOR
140 extern tree static_ctors;
141#endif
142#ifndef ASM_OUTPUT_DESTRUCTOR
143 extern tree static_dtors;
144#endif
2c5f4139 145 extern tree build_function_call PROTO((tree, tree));
081f5e7e 146#if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
2c5f4139 147 tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
081f5e7e 148#endif
2c5f4139
JM
149#ifndef ASM_OUTPUT_CONSTRUCTOR
150 if (static_ctors)
151 {
152 tree fnname = get_file_function_name ('I');
153 start_function (void_list_node,
154 build_parse_node (CALL_EXPR, fnname, void_list_node,
155 NULL_TREE),
79d101f8 156 NULL_TREE, NULL_TREE, 0);
2c5f4139
JM
157 fnname = DECL_ASSEMBLER_NAME (current_function_decl);
158 store_parm_decls ();
159
160 for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors))
161 expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors),
162 NULL_TREE));
163
164 finish_function (0);
165
166 assemble_constructor (IDENTIFIER_POINTER (fnname));
167 }
168#endif
169#ifndef ASM_OUTPUT_DESTRUCTOR
170 if (static_dtors)
171 {
172 tree fnname = get_file_function_name ('D');
173 start_function (void_list_node,
174 build_parse_node (CALL_EXPR, fnname, void_list_node,
175 NULL_TREE),
b7e043ad 176 NULL_TREE, NULL_TREE, 0);
2c5f4139
JM
177 fnname = DECL_ASSEMBLER_NAME (current_function_decl);
178 store_parm_decls ();
179
180 for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors))
181 expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors),
182 NULL_TREE));
183
184 finish_function (0);
185
186 assemble_destructor (IDENTIFIER_POINTER (fnname));
187 }
188#endif
189}
This page took 0.343748 seconds and 5 git commands to generate.