1991-12-25 04:55:54 +01:00
|
|
|
/* Language-specific hook definitions for C front end.
|
1998-02-13 06:40:34 +01:00
|
|
|
Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc.
|
1991-12-25 04:55:54 +01:00
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
1995-06-15 13:33:25 +02:00
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1991-12-25 04:55:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 15:58:42 +01:00
|
|
|
#include "system.h"
|
1991-12-25 04:55:54 +01:00
|
|
|
#include "tree.h"
|
|
|
|
#include "input.h"
|
|
|
|
|
|
|
|
/* Each of the functions defined here
|
|
|
|
is an alternative to a function in objc-actions.c. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lang_decode_option (p)
|
|
|
|
char *p;
|
|
|
|
{
|
|
|
|
return c_decode_option (p);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
lang_init ()
|
|
|
|
{
|
1997-08-01 23:18:54 +02:00
|
|
|
#if !USE_CPPLIB
|
1991-12-25 04:55:54 +01:00
|
|
|
/* the beginning of the file is a new line; check for # */
|
|
|
|
/* With luck, we discover the real source file's name from that
|
|
|
|
and put it in input_filename. */
|
|
|
|
ungetc (check_newline (), finput);
|
1997-08-01 23:18:54 +02:00
|
|
|
#endif
|
1991-12-25 04:55:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
lang_finish ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1993-03-25 09:51:26 +01:00
|
|
|
char *
|
|
|
|
lang_identify ()
|
|
|
|
{
|
|
|
|
return "c";
|
|
|
|
}
|
|
|
|
|
1993-04-10 01:11:34 +02:00
|
|
|
void
|
|
|
|
print_lang_statistics ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1998-03-24 00:04:47 +01:00
|
|
|
/* used by print-tree.c */
|
|
|
|
|
|
|
|
void
|
|
|
|
lang_print_xnode (file, node, indent)
|
|
|
|
FILE *file;
|
|
|
|
tree node;
|
|
|
|
int indent;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1991-12-25 04:55:54 +01:00
|
|
|
/* Used by c-lex.c, but only for objc. */
|
1993-04-10 01:11:34 +02:00
|
|
|
|
1991-12-25 04:55:54 +01:00
|
|
|
tree
|
|
|
|
lookup_interface (arg)
|
|
|
|
tree arg;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1993-04-10 01:11:34 +02:00
|
|
|
tree
|
|
|
|
is_class_name (arg)
|
|
|
|
tree arg;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1991-12-25 04:55:54 +01:00
|
|
|
void
|
|
|
|
maybe_objc_check_decl (decl)
|
|
|
|
tree decl;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
1993-04-10 01:11:34 +02:00
|
|
|
maybe_objc_comptypes (lhs, rhs, reflexive)
|
1991-12-25 04:55:54 +01:00
|
|
|
tree lhs, rhs;
|
1993-04-10 01:11:34 +02:00
|
|
|
int reflexive;
|
|
|
|
{
|
1993-04-22 13:48:17 +02:00
|
|
|
return -1;
|
1993-04-10 01:11:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tree
|
|
|
|
maybe_objc_method_name (decl)
|
|
|
|
tree decl;
|
1991-12-25 04:55:54 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
tree
|
|
|
|
maybe_building_objc_message_expr ()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
recognize_objc_keyword ()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1993-04-10 01:11:34 +02:00
|
|
|
tree
|
|
|
|
build_objc_string (len, str)
|
|
|
|
int len;
|
|
|
|
char *str;
|
1991-12-25 04:55:54 +01:00
|
|
|
{
|
1993-04-10 01:11:34 +02:00
|
|
|
abort ();
|
|
|
|
return NULL_TREE;
|
1991-12-25 04:55:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GNU_xref_begin ()
|
|
|
|
{
|
|
|
|
fatal ("GCC does not yet support XREF");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GNU_xref_end ()
|
|
|
|
{
|
|
|
|
fatal ("GCC does not yet support XREF");
|
|
|
|
}
|
1995-01-14 02:09:01 +01:00
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
/* Called at end of parsing, but before end-of-file processing. */
|
|
|
|
|
1995-01-14 02:09:01 +01:00
|
|
|
void
|
|
|
|
finish_file ()
|
|
|
|
{
|
c-lang.c (finish_file): Bracket declaration of static_ctors, static_dtors.
* c-lang.c (finish_file): Bracket declaration of static_ctors,
static_dtors.
* calls.c (expand_call): Bracket declaration of 'rtx_before_call',
'old_stack_arg_under_construction'
(emit_library_call): Bracket declaration of 'upper_bound',
'lower_bound', 'i', 'reg_parm_stack_space'
(emit_library_call_value): Likewise.
(store_one_arg):
* collect2.c: include <unistd.h> when appropriate.
Bracket declaration of 'exportf' and 'full_real_ld_suffix'.
* emit-rtl.c (prev_cc0_setter): Remove unused variable 'link'.
* explow.c (plus_constant_for_output_wide): Remove unused variable
'code'.
(memory_address): Remove unused variable 'orig_x'.
* genattrtab.c (make_canonical): Remove unreferenced label 'cond:'.
(write_const_num_delay_slots): Remove unused variable 'i'.
* genopinit.c (main): Remove unused variables 'dummy', 'insn_ptr'.
(gen_insn): Remove unused variable 'obstack_ptr'.
* libgcc2.c (__bb_exit_func): Remove unused variables 'ret',
'j', 'tmp', 'i'.
(__bb_exit_trace_func): Remove unused variable 'e'.
* optabs.c (expand_binop): remove unused variables 'lhs', 'rhs',
'funexp'.
(expand_unop): Remove unused variable 'funexp'.
(expand_complex_abs): Remove unused variable 'funexp'.
(init_optabs): Bracket declaration of 'j'.
(init_complex_libfuncs): Deleted. Dead static function.
* profile.c (branch_prob): Remove unused variables 'insn', 'dest'.
* reg-stack.c: Fix typo in proto for 'get_asm_operand_lengths'
(reg_to_stack): 'initialized', 'before_function_beg'
explictly type as ints instead of defaulting.
(emit_swap_insn): Remove unused variable 'i2'.
(compare_for_stack_reg): Remove unused variable 'src_note'.
* rtlanal.c (computed_jump_p): Remove unused variable 'computed_jump'.
* sched.c (actual_hazard): Bracket declaration of 'this_cost'.
* stmt.c (add_case_node): Add parens for assignment used as truth.
(all_cases_count): Remove unused variable 'count_high'.
(mark_seen_cases): Remove unused variable 'i'.
(check_for_full_enumeration_handling): Remove unused variable 't'.
Bracket declaration of 'all_values', 'l'.
* tlink.c: Include <stdlib.h>, <unistd.h>, <string.h>/<strings.h>.
* varasm.c (assemble_string): Remove unused variable 'i'.
(immed_double_const): Remove unused variable 'in_current_obstack'.
(immed_real_const_1): Likewise.
(output_constant_pool): Remove unreferenced label 'done'.
(output_constant): Remove unused variable 'x'.
* i386/i386.h (ENCODE_SECTION_INFO): TREE_PUBLIC is an int, not
a string.
* i386/sco5.h (ASM_OUTPUT_ASCII): Add parens for assignment used
as truth.
From-SVN: r17901
1998-02-13 06:30:56 +01:00
|
|
|
#ifndef ASM_OUTPUT_CONSTRUCTOR
|
|
|
|
extern tree static_ctors;
|
|
|
|
#endif
|
|
|
|
#ifndef ASM_OUTPUT_DESTRUCTOR
|
|
|
|
extern tree static_dtors;
|
|
|
|
#endif
|
1995-01-14 02:09:01 +01:00
|
|
|
extern tree build_function_call PROTO((tree, tree));
|
1998-03-18 08:18:06 +01:00
|
|
|
#if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
|
1995-01-14 02:09:01 +01:00
|
|
|
tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
|
1998-03-18 08:18:06 +01:00
|
|
|
#endif
|
1995-01-14 02:09:01 +01:00
|
|
|
#ifndef ASM_OUTPUT_CONSTRUCTOR
|
|
|
|
if (static_ctors)
|
|
|
|
{
|
|
|
|
tree fnname = get_file_function_name ('I');
|
|
|
|
start_function (void_list_node,
|
|
|
|
build_parse_node (CALL_EXPR, fnname, void_list_node,
|
|
|
|
NULL_TREE),
|
1995-06-14 14:07:43 +02:00
|
|
|
NULL_TREE, NULL_TREE, 0);
|
1995-01-14 02:09:01 +01:00
|
|
|
fnname = DECL_ASSEMBLER_NAME (current_function_decl);
|
|
|
|
store_parm_decls ();
|
|
|
|
|
|
|
|
for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors))
|
|
|
|
expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors),
|
|
|
|
NULL_TREE));
|
|
|
|
|
|
|
|
finish_function (0);
|
|
|
|
|
|
|
|
assemble_constructor (IDENTIFIER_POINTER (fnname));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifndef ASM_OUTPUT_DESTRUCTOR
|
|
|
|
if (static_dtors)
|
|
|
|
{
|
|
|
|
tree fnname = get_file_function_name ('D');
|
|
|
|
start_function (void_list_node,
|
|
|
|
build_parse_node (CALL_EXPR, fnname, void_list_node,
|
|
|
|
NULL_TREE),
|
1995-07-11 01:47:26 +02:00
|
|
|
NULL_TREE, NULL_TREE, 0);
|
1995-01-14 02:09:01 +01:00
|
|
|
fnname = DECL_ASSEMBLER_NAME (current_function_decl);
|
|
|
|
store_parm_decls ();
|
|
|
|
|
|
|
|
for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors))
|
|
|
|
expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors),
|
|
|
|
NULL_TREE));
|
|
|
|
|
|
|
|
finish_function (0);
|
|
|
|
|
|
|
|
assemble_destructor (IDENTIFIER_POINTER (fnname));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|