OSDN Git Service

* config/linux.h (ASM_COMMENT_START): Remove from here,
[pf3gnuchains/gcc-fork.git] / gcc / c-lang.c
1 /* Language-specific hook definitions for C front end.
2    Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
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.
10
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.
15
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.  */
20
21
22 #include "config.h"
23 #include "system.h"
24 #include "tree.h"
25 #include "input.h"
26
27 /* Each of the functions defined here
28    is an alternative to a function in objc-actions.c.  */
29    
30 int
31 lang_decode_option (p)
32      char *p;
33 {
34   return c_decode_option (p);
35 }
36
37 void
38 lang_init ()
39 {
40 #if !USE_CPPLIB
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);
45 #endif
46 }
47
48 void
49 lang_finish ()
50 {
51 }
52
53 char *
54 lang_identify ()
55 {
56   return "c";
57 }
58
59 void
60 print_lang_statistics ()
61 {
62 }
63
64 /* used by print-tree.c */
65
66 void
67 lang_print_xnode (file, node, indent)
68      FILE *file;
69      tree node;
70      int indent;
71 {
72 }
73
74 /* Used by c-lex.c, but only for objc.  */
75
76 tree
77 lookup_interface (arg)
78      tree arg;
79 {
80   return 0;
81 }
82
83 tree
84 is_class_name (arg)
85     tree arg;
86 {
87   return 0;
88 }
89
90 void
91 maybe_objc_check_decl (decl)
92      tree decl;
93 {
94 }
95
96 int
97 maybe_objc_comptypes (lhs, rhs, reflexive)
98      tree lhs, rhs;
99      int reflexive;
100 {
101   return -1;
102 }
103
104 tree
105 maybe_objc_method_name (decl)
106     tree decl;
107 {
108   return 0;
109 }
110
111 tree
112 maybe_building_objc_message_expr ()
113 {
114   return 0;
115 }
116
117 int
118 recognize_objc_keyword ()
119 {
120   return 0;
121 }
122
123 tree
124 build_objc_string (len, str)
125     int len;
126     char *str;
127 {
128   abort ();
129   return NULL_TREE;
130 }
131
132 void
133 GNU_xref_begin ()
134 {
135   fatal ("GCC does not yet support XREF");
136 }
137
138 void
139 GNU_xref_end ()
140 {
141   fatal ("GCC does not yet support XREF");
142 }
143
144 /* Called at end of parsing, but before end-of-file processing.  */
145
146 void
147 finish_file ()
148 {
149 #ifndef ASM_OUTPUT_CONSTRUCTOR
150   extern tree static_ctors;
151 #endif
152 #ifndef ASM_OUTPUT_DESTRUCTOR
153   extern tree static_dtors;
154 #endif
155   extern tree build_function_call                 PROTO((tree, tree));
156 #if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
157   tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
158 #endif
159 #ifndef ASM_OUTPUT_CONSTRUCTOR
160   if (static_ctors)
161     {
162       tree fnname = get_file_function_name ('I');
163       start_function (void_list_node,
164                       build_parse_node (CALL_EXPR, fnname, void_list_node,
165                                         NULL_TREE),
166                       NULL_TREE, NULL_TREE, 0);
167       fnname = DECL_ASSEMBLER_NAME (current_function_decl);
168       store_parm_decls ();
169
170       for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors))
171         expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors),
172                                                NULL_TREE));
173
174       finish_function (0);
175
176       assemble_constructor (IDENTIFIER_POINTER (fnname));
177     }
178 #endif
179 #ifndef ASM_OUTPUT_DESTRUCTOR
180   if (static_dtors)
181     {
182       tree fnname = get_file_function_name ('D');
183       start_function (void_list_node,
184                       build_parse_node (CALL_EXPR, fnname, void_list_node,
185                                         NULL_TREE),
186                       NULL_TREE, NULL_TREE, 0);
187       fnname = DECL_ASSEMBLER_NAME (current_function_decl);
188       store_parm_decls ();
189
190       for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors))
191         expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors),
192                                                NULL_TREE));
193
194       finish_function (0);
195
196       assemble_destructor (IDENTIFIER_POINTER (fnname));
197     }
198 #endif
199 }