gcc/gcc/c-lang.c

190 lines
3.7 KiB
C
Raw Normal View History

1991-12-25 04:55:54 +01:00
/* Language-specific hook definitions for C front end.
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"
#include "tree.h"
#include <stdio.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 ()
{
#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);
#endif
1991-12-25 04:55:54 +01:00
}
void
lang_finish ()
{
}
char *
lang_identify ()
{
return "c";
}
void
print_lang_statistics ()
{
}
1991-12-25 04:55:54 +01:00
/* Used by c-lex.c, but only for objc. */
1991-12-25 04:55:54 +01:00
tree
lookup_interface (arg)
tree arg;
{
return 0;
}
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
maybe_objc_comptypes (lhs, rhs, reflexive)
1991-12-25 04:55:54 +01:00
tree lhs, rhs;
int reflexive;
{
return -1;
}
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;
}
tree
build_objc_string (len, str)
int len;
char *str;
1991-12-25 04:55:54 +01: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");
}
1996-07-04 00:07:53 +02:00
/* Called at end of parsing, but before end-of-file processing. */
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
extern tree build_function_call PROTO((tree, tree));
Fix more warnings... * c-lang.c (finish_file): Wrap variable `void_list_node' with macro test !ASM_OUTPUT_CONSTRUCTOR || !ASM_OUTPUT_DESTRUCTOR. * calls.c (emit_call_1): Wrap variable `already_popped' with macro test !ACCUMULATE_OUTGOING_ARGS. * collect2.c (write_c_file_glob): Wrap function definition in macro test !LD_INIT_SWITCH. * combine.c (try_combine): Wrap variables `cc_use' and `compare_mode' in macro test EXTRA_CC_MODES. * cpplib.c (do_ident): Remove unused variable `len'. (skip_if_group): Remove unused variables `at_beg_of_line' and `after_ident'. (cpp_get_token): Remove unused variable `dummy'. * dbxout.c (scope_labelno): Move static variable definition inside the one function scope where it is used. (dbxout_function_end): Wrap prototype and definition in macro test !NO_DBX_FUNCTION_END. * dwarf2out.c (add_subscript_info): Wrap variable `dimension_number' in macro test !MIPS_DEBUGGING_INFO. * expr.c (expand_builtin_setjmp): Move declaration of variable `i' into the scope where it is used. Wrap empty else-statement body in braces. * fix-header.c: Fix typo in comment. (inf_skip_spaces): Cast results of INF_UNGET to (void). (check_protection, main): Likewise. * flow.c (find_basic_blocks_1): Remove dangling comment text. * function.c (contains): Wrap prototype and definition in macro test HAVE_prologue || HAVE_epilogue. (fixup_var_refs_1): Remove unused variable `width'. * gen-protos.c (main): Remove unused variable `optr'. * haifa-sched.c (debug_control_flow): Remove unused variable `j'. * libgcc2.c (__udiv_w_sdiv): Provide dummy return value of 0. (__sjpopnthrow): Remove unused variable `jmpbuf'. (__throw): Remove unused variable `val'. * protoize.c: Check for a previously existing definition before defining *_OK macros. * scan-decls.c (scan_decls): Remove unused variable `old_written'. From-SVN: r18654
1998-03-18 08:18:06 +01:00
#if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
Fix more warnings... * c-lang.c (finish_file): Wrap variable `void_list_node' with macro test !ASM_OUTPUT_CONSTRUCTOR || !ASM_OUTPUT_DESTRUCTOR. * calls.c (emit_call_1): Wrap variable `already_popped' with macro test !ACCUMULATE_OUTGOING_ARGS. * collect2.c (write_c_file_glob): Wrap function definition in macro test !LD_INIT_SWITCH. * combine.c (try_combine): Wrap variables `cc_use' and `compare_mode' in macro test EXTRA_CC_MODES. * cpplib.c (do_ident): Remove unused variable `len'. (skip_if_group): Remove unused variables `at_beg_of_line' and `after_ident'. (cpp_get_token): Remove unused variable `dummy'. * dbxout.c (scope_labelno): Move static variable definition inside the one function scope where it is used. (dbxout_function_end): Wrap prototype and definition in macro test !NO_DBX_FUNCTION_END. * dwarf2out.c (add_subscript_info): Wrap variable `dimension_number' in macro test !MIPS_DEBUGGING_INFO. * expr.c (expand_builtin_setjmp): Move declaration of variable `i' into the scope where it is used. Wrap empty else-statement body in braces. * fix-header.c: Fix typo in comment. (inf_skip_spaces): Cast results of INF_UNGET to (void). (check_protection, main): Likewise. * flow.c (find_basic_blocks_1): Remove dangling comment text. * function.c (contains): Wrap prototype and definition in macro test HAVE_prologue || HAVE_epilogue. (fixup_var_refs_1): Remove unused variable `width'. * gen-protos.c (main): Remove unused variable `optr'. * haifa-sched.c (debug_control_flow): Remove unused variable `j'. * libgcc2.c (__udiv_w_sdiv): Provide dummy return value of 0. (__sjpopnthrow): Remove unused variable `jmpbuf'. (__throw): Remove unused variable `val'. * protoize.c: Check for a previously existing definition before defining *_OK macros. * scan-decls.c (scan_decls): Remove unused variable `old_written'. From-SVN: r18654
1998-03-18 08:18:06 +01:00
#endif
#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),
NULL_TREE, NULL_TREE, 0);
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),
NULL_TREE, NULL_TREE, 0);
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
}