gcc/gcc/gencheck.c

83 lines
1.9 KiB
C
Raw Normal View History

/* Generate check macros for tree codes.
Copyright (C) 1998 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "hconfig.h"
#include "system.h"
#define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGIFY(SYM),
const char *tree_codes[] = {
#include "tree.def"
#include "gencheck.h"
(char*)0
};
void usage ()
{
fprintf (stderr,"Usage: gencheck\n");
}
int main (argc, argv)
int argc;
Warning fixes: * Makefile.in (gencheck.o): Depend on gansidecl.h. * c-common.c (print_char_table): Add missing initializers. (scan_char_table): Likewise. (time_char_table): Likewise. * c-decl.c (c_decode_option): Mark parameter `argc' with ATTRIBUTE_UNUSED. (declare_parm_level): Mark parameter `definition_flag' with ATTRIBUTE_UNUSED. * c-lex.c (readescape): Use `(unsigned)1' in shift. (yylex): Likewise. Cast `sizeof' to an (int) when comparing against one. * calls.c (store_one_arg): Remove unused parameter `fndecl'. All callers changed. (emit_call_1): Mark parameters `fndecl' and `funtype' with ATTRIBUTE_UNUSED. (expand_call): Cast result of MIN() to (unsigned int) when comparing against an unsigned value. * cccp.c (pcfinclude): Remove unused parameter `limit'. All callers changed. (make_definition): Remove unused parameter `op'. All callers changed. (create_definition): Cast REST_EXTENSION_LENGTH to (long) when comparing against the result of pointer arithmetic. * config/mips/mips.h (FUNCTION_ARG_BOUNDARY): Cast to (unsigned) when comparing against one. * dwarf2out.c (dwarf2out_frame_debug): Cast REGNO() and HARD_FRAME_POINTER_REGNUM to (unsigned) when comparing against one. (output_die): Move variable `i' into the scope in which it is used. Change its type to `unsigned'. (output_die): Cast the result of `strlen' to (int) when passing it to ASM_OUTPUT_ASCII(). (output_pubnames): Likewise. (output_line_info): Likewise. * emit-rtl.c (global_rtl): Add missing initializers. * explow.c (promote_mode): Mark parameter `for_call' with ATTRIBUTE_UNUSED. * expmed.c (expand_shift): Cast the result of GET_MODE_BITSIZE to `unsigned HOST_WIDE_INT' when comparing against one. (synth_mult): Change type of variable `cost' to int. (emit_store_flag): Use `(unsigned HOST_WIDE_INT) 1' in shift. * expr.c (copy_blkmode_from_reg): Cast BITS_PER_WORD to (unsigned) when comparing against one. (get_inner_reference): Change variable `alignment' to unsigned. (expand_expr): Cast the result of GET_MODE_ALIGNMENT to (unsigned int) when comparing against one. (expand_builtin_setjmp): Change type of variable `i' to size_t. * fold-const.c (div_and_round_double): Cast BASE to (HOST_WIDE_INT) when comparing against one. * gencheck.c: Include gansidecl.h. (main): Mark parameter `argv' with ATTRIBUTE_UNUSED. * optabs.c (gen_cond_trap): Mark parameters `code', `op2' and `tcode' with ATTRIBUTE_UNUSED. * real.c (edivm): Cast constant value to (unsigned long) in expression compared against an unsigned value. * stmt.c (expand_return): Cast BITS_PER_WORD to (unsigned) when comparing against one. (expand_end_case): Cast CASE_VALUES_THRESHOLD to (unsigned int) when comparing against one. * stor-layout.c (mode_for_size): Cast MAX_FIXED_MODE_SIZE to (unsigned int) when comparing against one. Likewise for GET_MODE_BITSIZE. (smallest_mode_for_size): Likewise. (save_storage_status): Mark parameter `p' with ATTRIBUTE_UNUSED. (restore_storage_status): Likewise. * toplev.c (debug_args): Add missing initializer. (f_options): Spelling correction. Add missing initializers. (documented_lang_options): Likewise. (debug_end_source_file): Mark parameter `lineno' with ATTRIBUTE_UNUSED. * tree.c (valid_machine_attribute): Mark parameters `attr_args', `decl' and `type' with ATTRIBUTE_UNUSED. * varasm.c (decode_reg_name): Cast `sizeof' expression to (int) when comparing against one. (assemble_variable): Mark parameter `top_level' with ATTRIBUTE_UNUSED. (assemble_external_libcall): Mark parameter `fun' with ATTRIBUTE_UNUSED. (output_constant_pool): Mark parameters `fnname' and `fndecl' with ATTRIBUTE_UNUSED. From-SVN: r23054
1998-10-13 17:25:25 +02:00
char *argv[] ATTRIBUTE_UNUSED;
{
int i;
switch (argc)
{
case 1:
break;
default:
usage ();
exit (1);
}
printf ("/* This file is generated using gencheck. Do not edit. */\n");
for (i = 0; tree_codes[i]; i++)
{
printf ("#define %s_CHECK(t)\tTREE_CHECK (t, %s)\n",
tree_codes[i], tree_codes[i]);
}
return 0;
}
#if defined(USE_C_ALLOCA)
/* FIXME: We only need an xmalloc definition because we are forced to
link with alloca.o on some platforms. This should go away if/when
we link against libiberty.a. (ghazi@caip.rutgers.edu 6/3/98) */
system.h: Include libiberty.h. * system.h: Include libiberty.h. * c-aux-info.c: Remove prototypes for concat/concat3. Change function `concat' from fixed parameters to variable parameters, as is done in libiberty. All callers of concat/concat3 changed to use the new `concat' with variable args. * cccp.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * cexp.y: Likewise. * collect2.c: Likewise. * config/1750a/1750a.h: Likewise. * cppalloc.c: Likewise. * cppexp.c: Likewise. * cppfiles.c: Likewise. * cpphash.c: Likewise. * cpplib.c: Likewise. * dyn-string.c: Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * gencheck.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * gengenrtl.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * getpwd.c: Likewise. * halfpic.c: Likewise. * hash.c: Likewise. * mips-tdump.c: Likewise. Wrap malloc/realloc/calloc prototypes in NEED_DECLARATION_* macros. * mips-tfile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. (fatal): Fix const-ification of variable `format' in !ANSI_PROTOTYPES case. * prefix.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid conflicting with function `spaces' from libiberty. * profile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * protoize.c: Likewise. * rtl.h: Likewise. * scan.h: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tree.h: Likewise. From-SVN: r23931
1998-11-27 11:09:17 +01:00
PTR
xmalloc (nbytes)
system.h: Include libiberty.h. * system.h: Include libiberty.h. * c-aux-info.c: Remove prototypes for concat/concat3. Change function `concat' from fixed parameters to variable parameters, as is done in libiberty. All callers of concat/concat3 changed to use the new `concat' with variable args. * cccp.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * cexp.y: Likewise. * collect2.c: Likewise. * config/1750a/1750a.h: Likewise. * cppalloc.c: Likewise. * cppexp.c: Likewise. * cppfiles.c: Likewise. * cpphash.c: Likewise. * cpplib.c: Likewise. * dyn-string.c: Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * gencheck.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * gengenrtl.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * getpwd.c: Likewise. * halfpic.c: Likewise. * hash.c: Likewise. * mips-tdump.c: Likewise. Wrap malloc/realloc/calloc prototypes in NEED_DECLARATION_* macros. * mips-tfile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. (fatal): Fix const-ification of variable `format' in !ANSI_PROTOTYPES case. * prefix.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid conflicting with function `spaces' from libiberty. * profile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * protoize.c: Likewise. * rtl.h: Likewise. * scan.h: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tree.h: Likewise. From-SVN: r23931
1998-11-27 11:09:17 +01:00
size_t nbytes;
{
system.h: Include libiberty.h. * system.h: Include libiberty.h. * c-aux-info.c: Remove prototypes for concat/concat3. Change function `concat' from fixed parameters to variable parameters, as is done in libiberty. All callers of concat/concat3 changed to use the new `concat' with variable args. * cccp.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * cexp.y: Likewise. * collect2.c: Likewise. * config/1750a/1750a.h: Likewise. * cppalloc.c: Likewise. * cppexp.c: Likewise. * cppfiles.c: Likewise. * cpphash.c: Likewise. * cpplib.c: Likewise. * dyn-string.c: Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * gencheck.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * gengenrtl.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * getpwd.c: Likewise. * halfpic.c: Likewise. * hash.c: Likewise. * mips-tdump.c: Likewise. Wrap malloc/realloc/calloc prototypes in NEED_DECLARATION_* macros. * mips-tfile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. (fatal): Fix const-ification of variable `format' in !ANSI_PROTOTYPES case. * prefix.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid conflicting with function `spaces' from libiberty. * profile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * protoize.c: Likewise. * rtl.h: Likewise. * scan.h: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tree.h: Likewise. From-SVN: r23931
1998-11-27 11:09:17 +01:00
register PTR tmp = (PTR) malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
#endif /* USE_C_ALLOCA */