gcc/gcc/sdbout.c

1768 lines
50 KiB
C
Raw Normal View History

1991-12-23 23:45:25 +01:00
/* Output sdb-format symbol table information from GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001 Free Software Foundation, Inc.
1991-12-23 23:45:25 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
This file is part of GCC.
1991-12-23 23:45:25 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC 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.
1991-12-23 23:45:25 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC 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.
1991-12-23 23:45:25 +01:00
You should have received a copy of the GNU General Public License
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
1991-12-23 23:45:25 +01:00
/* mike@tredysvr.Tredydev.Unisys.COM says:
I modified the struct.c example and have a nm of a .o resulting from the
AT&T C compiler. From the example below I would conclude the following:
1. All .defs from structures are emitted as scanned. The example below
clearly shows the symbol table entries for BoxRec2 are after the first
function.
2. All functions and their locals (including statics) are emitted as scanned.
3. All nested unnamed union and structure .defs must be emitted before
the structure in which they are nested. The AT&T assembler is a
one pass beast as far as symbolics are concerned.
4. All structure .defs are emitted before the typedefs that refer to them.
5. All top level static and external variable definitions are moved to the
end of file with all top level statics occurring first before externs.
1991-12-23 23:45:25 +01:00
6. All undefined references are at the end of the file.
*/
#include "config.h"
#ifdef SDB_DEBUGGING_INFO
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-23 23:45:25 +01:00
#include "tree.h"
#include "rtl.h"
#include "regs.h"
#include "flags.h"
#include "insn-config.h"
#include "reload.h"
#include "output.h"
#include "toplev.h"
#include "ggc.h"
#include "tm_p.h"
1991-12-23 23:45:25 +01:00
#include "gsyms.h"
#include "debug.h"
1991-12-23 23:45:25 +01:00
/* 1 if PARM is passed to this function in memory. */
#define PARM_PASSED_IN_MEMORY(PARM) \
(GET_CODE (DECL_INCOMING_RTL (PARM)) == MEM)
/* A C expression for the integer offset value of an automatic variable
(C_AUTO) having address X (an RTX). */
#ifndef DEBUGGER_AUTO_OFFSET
#define DEBUGGER_AUTO_OFFSET(X) \
(GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0)
#endif
/* A C expression for the integer offset value of an argument (C_ARG)
having address X (an RTX). The nominal offset is OFFSET. */
#ifndef DEBUGGER_ARG_OFFSET
#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET)
#endif
/* Line number of beginning of current function, minus one.
Negative means not in a function or not using sdb. */
int sdb_begin_function_line = -1;
1991-12-23 23:45:25 +01:00
/* Counter to generate unique "names" for nameless struct members. */
static int unnamed_struct_number = 0;
extern FILE *asm_out_file;
extern tree current_function_decl;
#include "sdbout.h"
1991-12-23 23:45:25 +01:00
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void sdbout_init PARAMS ((const char *));
static void sdbout_finish PARAMS ((const char *));
static void sdbout_start_source_file PARAMS ((unsigned int, const char *));
static void sdbout_end_source_file PARAMS ((unsigned int));
static void sdbout_begin_block PARAMS ((unsigned int, unsigned int));
static void sdbout_end_block PARAMS ((unsigned int, unsigned int));
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
static void sdbout_source_line PARAMS ((unsigned int, const char *));
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void sdbout_end_epilogue PARAMS ((void));
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
static void sdbout_global_decl PARAMS ((tree));
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
#ifndef MIPS_DEBUGGING_INFO
static void sdbout_begin_prologue PARAMS ((unsigned int, const char *));
#endif
static void sdbout_end_prologue PARAMS ((unsigned int));
static void sdbout_begin_function PARAMS ((tree));
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void sdbout_end_function PARAMS ((unsigned int));
Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. (toplev.o): Don't depend on xcoffout.h. * c-decl.c: Include debug.h (duplicate_decls): Use debug hook. * dbxout.c (dbxout_source_file, dbxout_args): Make static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_types): Remove. * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_true_tree, debug_nothing_rtx): New. * debug.h (struct rtx_def): New. (struct gcc_debug_hooks): New hooks ignore_block, outlining_inline_function and label. (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, dwarf2out_frame_finish): New. * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): Make static, update prototype. (dwarf2_debug_hooks): Update. * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, dwarf2out_frame_init, dwarf2out_frame_finish): Remove. * dwarfout.c (dwarf_debug_hooks): Update. * emit-rtl.c: Include debug.h. (remove_unnecessary_notes): Use debug hook. * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. (final_scan_insn): Use debug hook. * integrate.c (output_inline_function): Use debug hook. * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. (sdb_debug_hooks): Update. * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. * toplev.c: Don't include xcoffout.h. (note_outlining_of_inline_function, debug_ignore_block): Remove. * toplev.h (note_outlining_of_inline_function, debug_ignore_block): Remove. * tree.h (dwarf2out_do_frame): Remove. From-SVN: r44163
2001-07-19 23:17:09 +02:00
static void sdbout_toplevel_data PARAMS ((tree));
static void sdbout_label PARAMS ((rtx));
static char *gen_fake_label PARAMS ((void));
static int plain_type PARAMS ((tree));
static int template_name_p PARAMS ((tree));
static void sdbout_record_type_name PARAMS ((tree));
static int plain_type_1 PARAMS ((tree, int));
static void sdbout_block PARAMS ((tree));
static void sdbout_syms PARAMS ((tree));
#ifdef SDB_ALLOW_FORWARD_REFERENCES
static void sdbout_queue_anonymous_type PARAMS ((tree));
static void sdbout_dequeue_anonymous_types PARAMS ((void));
#endif
static void sdbout_type PARAMS ((tree));
static void sdbout_field_types PARAMS ((tree));
static void sdbout_one_type PARAMS ((tree));
static void sdbout_parms PARAMS ((tree));
static void sdbout_reg_parms PARAMS ((tree));
static void sdbout_global_decl PARAMS ((tree));
1991-12-23 23:45:25 +01:00
/* Random macros describing parts of SDB data. */
/* Put something here if lines get too long */
#define CONTIN
/* Default value of delimiter is ";". */
#ifndef SDB_DELIM
#define SDB_DELIM ";"
#endif
/* Maximum number of dimensions the assembler will allow. */
#ifndef SDB_MAX_DIM
#define SDB_MAX_DIM 4
#endif
#ifndef PUT_SDB_SCL
#define PUT_SDB_SCL(a) fprintf(asm_out_file, "\t.scl\t%d%s", (a), SDB_DELIM)
#endif
#ifndef PUT_SDB_INT_VAL
#define PUT_SDB_INT_VAL(a) \
do { \
fputs ("\t.val\t", asm_out_file); \
fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a)); \
fprintf (asm_out_file, "%s", SDB_DELIM); \
} while (0)
1991-12-23 23:45:25 +01:00
#endif
#ifndef PUT_SDB_VAL
#define PUT_SDB_VAL(a) \
( fputs ("\t.val\t", asm_out_file), \
output_addr_const (asm_out_file, (a)), \
fprintf (asm_out_file, SDB_DELIM))
#endif
#ifndef PUT_SDB_DEF
#define PUT_SDB_DEF(a) \
do { fprintf (asm_out_file, "\t.def\t"); \
assemble_name (asm_out_file, a); \
1991-12-23 23:45:25 +01:00
fprintf (asm_out_file, SDB_DELIM); } while (0)
#endif
#ifndef PUT_SDB_PLAIN_DEF
#define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\t.def\t.%s%s",a, SDB_DELIM)
#endif
#ifndef PUT_SDB_ENDEF
#define PUT_SDB_ENDEF fputs("\t.endef\n", asm_out_file)
#endif
#ifndef PUT_SDB_TYPE
#define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\t.type\t0%o%s", a, SDB_DELIM)
#endif
#ifndef PUT_SDB_SIZE
#define PUT_SDB_SIZE(a) \
do { \
fputs ("\t.size\t", asm_out_file); \
fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a)); \
fprintf (asm_out_file, "%s", SDB_DELIM); \
} while(0)
1991-12-23 23:45:25 +01:00
#endif
#ifndef PUT_SDB_START_DIM
#define PUT_SDB_START_DIM fprintf(asm_out_file, "\t.dim\t")
#endif
#ifndef PUT_SDB_NEXT_DIM
#define PUT_SDB_NEXT_DIM(a) fprintf(asm_out_file, "%d,", a)
#endif
#ifndef PUT_SDB_LAST_DIM
#define PUT_SDB_LAST_DIM(a) fprintf(asm_out_file, "%d%s", a, SDB_DELIM)
#endif
#ifndef PUT_SDB_TAG
#define PUT_SDB_TAG(a) \
do { fprintf (asm_out_file, "\t.tag\t"); \
assemble_name (asm_out_file, a); \
1991-12-23 23:45:25 +01:00
fprintf (asm_out_file, SDB_DELIM); } while (0)
#endif
#ifndef PUT_SDB_BLOCK_START
#define PUT_SDB_BLOCK_START(LINE) \
fprintf (asm_out_file, \
"\t.def\t.bb%s\t.val\t.%s\t.scl\t100%s\t.line\t%d%s\t.endef\n", \
SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
#endif
#ifndef PUT_SDB_BLOCK_END
#define PUT_SDB_BLOCK_END(LINE) \
fprintf (asm_out_file, \
"\t.def\t.eb%s\t.val\t.%s\t.scl\t100%s\t.line\t%d%s\t.endef\n", \
SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
#endif
#ifndef PUT_SDB_FUNCTION_START
#define PUT_SDB_FUNCTION_START(LINE) \
fprintf (asm_out_file, \
"\t.def\t.bf%s\t.val\t.%s\t.scl\t101%s\t.line\t%d%s\t.endef\n", \
SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
#endif
#ifndef PUT_SDB_FUNCTION_END
#define PUT_SDB_FUNCTION_END(LINE) \
fprintf (asm_out_file, \
"\t.def\t.ef%s\t.val\t.%s\t.scl\t101%s\t.line\t%d%s\t.endef\n", \
SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM)
#endif
#ifndef SDB_GENERATE_FAKE
#define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
sprintf ((BUFFER), ".%dfake", (NUMBER));
#endif
/* Return the sdb tag identifier string for TYPE
if TYPE has already been defined; otherwise return a null pointer. */
1991-12-23 23:45:25 +01:00
#define KNOWN_TYPE_TAG(type) TYPE_SYMTAB_POINTER (type)
1991-12-23 23:45:25 +01:00
/* Set the sdb tag identifier string for TYPE to NAME. */
#define SET_KNOWN_TYPE_TAG(TYPE, NAME) \
TYPE_SYMTAB_POINTER (TYPE) = (NAME)
1991-12-23 23:45:25 +01:00
/* Return the name (a string) of the struct, union or enum tag
described by the TREE_LIST node LINK. This is 0 for an anonymous one. */
#define TAG_NAME(link) \
(((link) && TREE_PURPOSE ((link)) \
&& IDENTIFIER_POINTER (TREE_PURPOSE ((link)))) \
? IDENTIFIER_POINTER (TREE_PURPOSE ((link))) : (char *) 0)
/* Ensure we don't output a negative line number. */
#define MAKE_LINE_SAFE(line) \
if ((int) line <= sdb_begin_function_line) \
line = sdb_begin_function_line + 1
/* Perform linker optimization of merging header file definitions together
for targets with MIPS_DEBUGGING_INFO defined. This won't work without a
post 960826 version of GAS. Nothing breaks with earlier versions of GAS,
the optimization just won't be done. The native assembler already has the
necessary support. */
#ifdef MIPS_DEBUGGING_INFO
#ifndef PUT_SDB_SRC_FILE
#define PUT_SDB_SRC_FILE(FILENAME) \
output_file_directive (asm_out_file, (FILENAME))
#endif
/* ECOFF linkers have an optimization that does the same kind of thing as
N_BINCL/E_INCL in stabs: eliminate duplicate debug information in the
executable. To achieve this, GCC must output a .file for each file
name change. */
/* This is a stack of input files. */
struct sdb_file
{
struct sdb_file *next;
const char *name;
};
/* This is the top of the stack. */
static struct sdb_file *current_file;
#endif /* MIPS_DEBUGGING_INFO */
1991-12-23 23:45:25 +01:00
Makefile.in (c-lex.o): Wrap long lines. * Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug hooks directly. * dbxout.c (dbx_debug_hooks): Add new hooks. (dbxout_start_new_source_file): Rename dbxout_start_source_file, make static. (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, make static. * dbxout.h (dbxout_start_new_source_file, dbxout_resume_previous_source_file): Delete. * debug.c (do_nothing_debug_hooks): Add new hooks. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * debug.h (gcc_debug_hooks): New hooks define, undef, start_source_file and end_source_file. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Make static. * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Remove. * dwarfout.c (dwarf_debug_hooks): Add new hooks. (dwarfout_start_source_file, dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Make static. (dwarfout_start_source_file_check, dwarfout_end_source_file_check): New. (dwarfout_define, dwarfout_finish): Update. * dwarfout.h (dwarfout_start_new_source_file, dwarfout_resume_previous_source_file, dwarfout_define, dwarfout_undef): Remove. * sdbout.c (sdb_debug_hooks): Add new hooks. (sdbout_start_new_source_file): Rename sdbout_start_source_file, make static. (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, make static, take an arg. * sdbout.h (sdbout_start_new_source_file, sdbout_resume_previous_source_file): Delete. * toplev.c (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * toplev.h (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * java/jcf-parse.c: Include debug.h. (parse_class_file): Update to use debug hooks directly. * java/Make-lang.in (jcf-parse.o): Depend on debug.h. From-SVN: r43952
2001-07-11 22:51:46 +02:00
/* The debug hooks structure. */
struct gcc_debug_hooks sdb_debug_hooks =
{
sdbout_init, /* init */
sdbout_finish, /* finish */
debug_nothing_int_charstar, /* define */
debug_nothing_int_charstar, /* undef */
sdbout_start_source_file, /* start_source_file */
sdbout_end_source_file, /* end_source_file */
sdbout_begin_block, /* begin_block */
sdbout_end_block, /* end_block */
Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. (toplev.o): Don't depend on xcoffout.h. * c-decl.c: Include debug.h (duplicate_decls): Use debug hook. * dbxout.c (dbxout_source_file, dbxout_args): Make static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_types): Remove. * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_true_tree, debug_nothing_rtx): New. * debug.h (struct rtx_def): New. (struct gcc_debug_hooks): New hooks ignore_block, outlining_inline_function and label. (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, dwarf2out_frame_finish): New. * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): Make static, update prototype. (dwarf2_debug_hooks): Update. * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, dwarf2out_frame_init, dwarf2out_frame_finish): Remove. * dwarfout.c (dwarf_debug_hooks): Update. * emit-rtl.c: Include debug.h. (remove_unnecessary_notes): Use debug hook. * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. (final_scan_insn): Use debug hook. * integrate.c (output_inline_function): Use debug hook. * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. (sdb_debug_hooks): Update. * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. * toplev.c: Don't include xcoffout.h. (note_outlining_of_inline_function, debug_ignore_block): Remove. * toplev.h (note_outlining_of_inline_function, debug_ignore_block): Remove. * tree.h (dwarf2out_do_frame): Remove. From-SVN: r44163
2001-07-19 23:17:09 +02:00
debug_true_tree, /* ignore_block */
sdbout_source_line, /* source_line */
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
#ifdef MIPS_DEBUGGING_INFO
/* Defer on MIPS systems so that parameter descriptions follow
function entry. */
debug_nothing_int_charstar, /* begin_prologue */
sdbout_end_prologue, /* end_prologue */
#else
sdbout_begin_prologue, /* begin_prologue */
debug_nothing_int, /* end_prologue */
#endif
sdbout_end_epilogue, /* end_epilogue */
sdbout_begin_function, /* begin_function */
sdbout_end_function, /* end_function */
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
debug_nothing_tree, /* function_decl */
sdbout_global_decl, /* global_decl */
Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. (toplev.o): Don't depend on xcoffout.h. * c-decl.c: Include debug.h (duplicate_decls): Use debug hook. * dbxout.c (dbxout_source_file, dbxout_args): Make static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_types): Remove. * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_true_tree, debug_nothing_rtx): New. * debug.h (struct rtx_def): New. (struct gcc_debug_hooks): New hooks ignore_block, outlining_inline_function and label. (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, dwarf2out_frame_finish): New. * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): Make static, update prototype. (dwarf2_debug_hooks): Update. * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, dwarf2out_frame_init, dwarf2out_frame_finish): Remove. * dwarfout.c (dwarf_debug_hooks): Update. * emit-rtl.c: Include debug.h. (remove_unnecessary_notes): Use debug hook. * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. (final_scan_insn): Use debug hook. * integrate.c (output_inline_function): Use debug hook. * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. (sdb_debug_hooks): Update. * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. * toplev.c: Don't include xcoffout.h. (note_outlining_of_inline_function, debug_ignore_block): Remove. * toplev.h (note_outlining_of_inline_function, debug_ignore_block): Remove. * tree.h (dwarf2out_do_frame): Remove. From-SVN: r44163
2001-07-19 23:17:09 +02:00
debug_nothing_tree, /* deferred_inline_function */
debug_nothing_tree, /* outlining_inline_function */
sdbout_label
};
1991-12-23 23:45:25 +01:00
#if 0
/* return the tag identifier for type
*/
char *
tag_of_ru_type (type,link)
tree type,link;
{
if (TYPE_SYMTAB_ADDRESS (type))
return TYPE_SYMTAB_ADDRESS (type);
1991-12-23 23:45:25 +01:00
if (link && TREE_PURPOSE (link)
&& IDENTIFIER_POINTER (TREE_PURPOSE (link)))
TYPE_SYMTAB_ADDRESS (type) = IDENTIFIER_POINTER (TREE_PURPOSE (link));
1991-12-23 23:45:25 +01:00
else
return (char *) TYPE_SYMTAB_ADDRESS (type);
}
#endif
/* Return a unique string to name an anonymous type. */
static char *
gen_fake_label ()
{
char label[10];
char *labelstr;
SDB_GENERATE_FAKE (label, unnamed_struct_number);
unnamed_struct_number++;
labelstr = (char *) permalloc (strlen (label) + 1);
strcpy (labelstr, label);
return labelstr;
}
/* Return the number which describes TYPE for SDB.
For pointers, etc., this function is recursive.
Each record, union or enumeral type must already have had a
tag number output. */
/* The number is given by d6d5d4d3d2d1bbbb
where bbbb is 4 bit basic type, and di indicate one of notype,ptr,fn,array.
Thus, char *foo () has bbbb=T_CHAR
d1=D_FCN
d2=D_PTR
N_BTMASK= 017 1111 basic type field.
N_TSHIFT= 2 derived type shift
N_BTSHFT= 4 Basic type shift */
/* Produce the number that describes a pointer, function or array type.
PREV is the number describing the target, value or element type.
DT_type describes how to transform that type. */
#define PUSH_DERIVED_LEVEL(DT_type,PREV) \
((((PREV) & ~(int)N_BTMASK) << (int)N_TSHIFT) \
| ((int)DT_type << (int)N_BTSHFT) \
| ((PREV) & (int)N_BTMASK))
1991-12-23 23:45:25 +01:00
/* Number of elements used in sdb_dims. */
static int sdb_n_dims = 0;
/* Table of array dimensions of current type. */
static int sdb_dims[SDB_MAX_DIM];
/* Size of outermost array currently being processed. */
static int sdb_type_size = -1;
static int
plain_type (type)
tree type;
{
int val = plain_type_1 (type, 0);
1991-12-23 23:45:25 +01:00
/* If we have already saved up some array dimensions, print them now. */
if (sdb_n_dims > 0)
{
int i;
PUT_SDB_START_DIM;
for (i = sdb_n_dims - 1; i > 0; i--)
PUT_SDB_NEXT_DIM (sdb_dims[i]);
PUT_SDB_LAST_DIM (sdb_dims[0]);
sdb_n_dims = 0;
sdb_type_size = int_size_in_bytes (type);
/* Don't kill sdb if type is not laid out or has variable size. */
if (sdb_type_size < 0)
sdb_type_size = 0;
}
/* If we have computed the size of an array containing this type,
print it now. */
if (sdb_type_size >= 0)
{
PUT_SDB_SIZE (sdb_type_size);
sdb_type_size = -1;
}
return val;
}
static int
template_name_p (name)
tree name;
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *ptr = IDENTIFIER_POINTER (name);
while (*ptr && *ptr != '<')
ptr++;
return *ptr != '\0';
}
1991-12-23 23:45:25 +01:00
static void
sdbout_record_type_name (type)
tree type;
{
char *name = 0;
1991-12-23 23:45:25 +01:00
int no_name;
if (KNOWN_TYPE_TAG (type))
return;
if (TYPE_NAME (type) != 0)
{
tree t = 0;
/* Find the IDENTIFIER_NODE for the type name. */
if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
t = TYPE_NAME (type);
else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
1991-12-23 23:45:25 +01:00
{
t = DECL_NAME (TYPE_NAME (type));
/* The DECL_NAME for templates includes "<>", which breaks
most assemblers. Use its assembler name instead, which
has been mangled into being safe. */
if (t && template_name_p (t))
t = DECL_ASSEMBLER_NAME (TYPE_NAME (type));
1991-12-23 23:45:25 +01:00
}
/* Now get the name as a string, or invent one. */
if (t != NULL_TREE)
1991-12-23 23:45:25 +01:00
name = IDENTIFIER_POINTER (t);
}
no_name = (name == 0 || *name == 0);
if (no_name)
name = gen_fake_label ();
SET_KNOWN_TYPE_TAG (type, name);
#ifdef SDB_ALLOW_FORWARD_REFERENCES
if (no_name)
sdbout_queue_anonymous_type (type);
#endif
}
/* Return the .type value for type TYPE.
LEVEL indicates how many levels deep we have recursed into the type.
The SDB debug format can only represent 6 derived levels of types.
After that, we must output inaccurate debug info. We deliberately
stop before the 7th level, so that ADA recursive types will not give an
infinite loop. */
1991-12-23 23:45:25 +01:00
static int
plain_type_1 (type, level)
1991-12-23 23:45:25 +01:00
tree type;
int level;
1991-12-23 23:45:25 +01:00
{
if (type == 0)
type = void_type_node;
else if (type == error_mark_node)
1991-12-23 23:45:25 +01:00
type = integer_type_node;
else
type = TYPE_MAIN_VARIANT (type);
1991-12-23 23:45:25 +01:00
switch (TREE_CODE (type))
{
case VOID_TYPE:
return T_VOID;
case BOOLEAN_TYPE:
1991-12-23 23:45:25 +01:00
case INTEGER_TYPE:
{
int size = int_size_in_bytes (type) * BITS_PER_UNIT;
/* Carefully distinguish all the standard types of C,
without messing up if the language is not C.
Note that we check only for the names that contain spaces;
other names might occur by coincidence in other languages. */
if (TYPE_NAME (type) != 0
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_NAME (TYPE_NAME (type)) != 0
&& TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
{
c-parse.in (yyerror): Const-ification and/or static-ization. * c-parse.in (yyerror): Const-ification and/or static-ization. * c-typeck.c (push_member_name): Likewise. * collect2.c (main): Likewise. * dbxout.c (dbxout_parms): Likewise. * diagnostic.c (format_with_decl): Likewise. * dwarf2out.c (output_ranges): Likewise. * dwarfout.c (fundamental_type_code): Likewise. * except.c (dw2_output_call_site_table): Likewise. * gcc.c (do_spec_1): Likewise. * genopinit.c (optabs): Likewise. * objc/objc-act.c (synth_id_with_class_suffix, start_class, gen_declaration_1, handle_impent): Likewise. * protoize.c (default_include, in_system_include_dir, abspath): Likewise. * sched-vis.c (visualize_stall_cycles): Likewise. * sdbout.c (plain_type_1, sdbout_end_function, sdbout_end_epilogue): Likewise. * varasm.c (decode_reg_name): Likewise. * 1750a.c (mod_regno_adjust): Likewise. * alpha.c (alpha_write_one_linkage, unicosmk_output_default_externs): Likewise. * arm.c (arm_condition_codes): Likewise. * arm.h (arm_condition_codes): Likewise. * avr.c (output_movsisf, encode_section_info): Likewise. * darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL): Likewise. * i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * m88k.c (output_function_profiler): Likewise. * mips.c (mips_output_conditional_branch): Likewise. * ns32k.c (ns32k_out_reg_names): Likewise. * ns32k.h (ns32k_out_reg_names): Likewise. * pj.c (pj_output_rval): Likewise. * rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise. * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue): Likewise. cp: * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): Const-ification. * pt.c (tsubst_decl): Likewise. f: * bad.c (ffebad_finish): Const-ification and/or static-ization. * intrin.c (ffeintrin_cmp_name_): Likewise. * stc.c (ffestc_R904): Likewise. java: * expr.c (expand_invoke): Const-ification. * parse.y (patch_method_invocation): Likewise. From-SVN: r45581
2001-09-13 16:37:29 +02:00
const char *const name
= IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
if (!strcmp (name, "char"))
return T_CHAR;
if (!strcmp (name, "unsigned char"))
return T_UCHAR;
if (!strcmp (name, "signed char"))
return T_CHAR;
if (!strcmp (name, "int"))
return T_INT;
if (!strcmp (name, "unsigned int"))
return T_UINT;
if (!strcmp (name, "short int"))
return T_SHORT;
if (!strcmp (name, "short unsigned int"))
return T_USHORT;
if (!strcmp (name, "long int"))
return T_LONG;
if (!strcmp (name, "long unsigned int"))
return T_ULONG;
}
if (size == INT_TYPE_SIZE)
return (TREE_UNSIGNED (type) ? T_UINT : T_INT);
1991-12-23 23:45:25 +01:00
if (size == CHAR_TYPE_SIZE)
return (TREE_UNSIGNED (type) ? T_UCHAR : T_CHAR);
if (size == SHORT_TYPE_SIZE)
return (TREE_UNSIGNED (type) ? T_USHORT : T_SHORT);
if (size == LONG_TYPE_SIZE)
return (TREE_UNSIGNED (type) ? T_ULONG : T_LONG);
if (size == LONG_LONG_TYPE_SIZE) /* better than nothing */
return (TREE_UNSIGNED (type) ? T_ULONG : T_LONG);
1991-12-23 23:45:25 +01:00
return 0;
}
case REAL_TYPE:
{
int precision = TYPE_PRECISION (type);
if (precision == FLOAT_TYPE_SIZE)
1991-12-23 23:45:25 +01:00
return T_FLOAT;
if (precision == DOUBLE_TYPE_SIZE)
1991-12-23 23:45:25 +01:00
return T_DOUBLE;
#ifdef EXTENDED_SDB_BASIC_TYPES
if (precision == LONG_DOUBLE_TYPE_SIZE)
return T_LNGDBL;
#else
if (precision == LONG_DOUBLE_TYPE_SIZE)
return T_DOUBLE; /* better than nothing */
#endif
1991-12-23 23:45:25 +01:00
return 0;
}
case ARRAY_TYPE:
{
int m;
if (level >= 6)
return T_VOID;
else
m = plain_type_1 (TREE_TYPE (type), level+1);
1991-12-23 23:45:25 +01:00
if (sdb_n_dims < SDB_MAX_DIM)
sdb_dims[sdb_n_dims++]
= (TYPE_DOMAIN (type)
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
&& TYPE_MIN_VALUE (TYPE_DOMAIN (type)) != 0
&& TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != 0
&& host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
&& host_integerp (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0)
? (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
- tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0) + 1)
1991-12-23 23:45:25 +01:00
: 0);
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
1991-12-23 23:45:25 +01:00
return PUSH_DERIVED_LEVEL (DT_ARY, m);
}
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
1991-12-23 23:45:25 +01:00
case ENUMERAL_TYPE:
{
char *tag;
#ifdef SDB_ALLOW_FORWARD_REFERENCES
sdbout_record_type_name (type);
#endif
#ifndef SDB_ALLOW_UNKNOWN_REFERENCES
if ((TREE_ASM_WRITTEN (type) && KNOWN_TYPE_TAG (type) != 0)
#ifdef SDB_ALLOW_FORWARD_REFERENCES
|| TYPE_MODE (type) != VOIDmode
#endif
)
#endif
{
/* Output the referenced structure tag name
only if the .def has already been finished.
At least on 386, the Unix assembler
cannot handle forward references to tags. */
1996-07-04 00:07:53 +02:00
/* But the 88100, it requires them, sigh... */
/* And the MIPS requires unknown refs as well... */
1991-12-23 23:45:25 +01:00
tag = KNOWN_TYPE_TAG (type);
PUT_SDB_TAG (tag);
/* These 3 lines used to follow the close brace.
However, a size of 0 without a tag implies a tag of 0,
so if we don't know a tag, we can't mention the size. */
sdb_type_size = int_size_in_bytes (type);
if (sdb_type_size < 0)
sdb_type_size = 0;
}
return ((TREE_CODE (type) == RECORD_TYPE) ? T_STRUCT
: (TREE_CODE (type) == UNION_TYPE) ? T_UNION
: (TREE_CODE (type) == QUAL_UNION_TYPE) ? T_UNION
1991-12-23 23:45:25 +01:00
: T_ENUM);
}
case POINTER_TYPE:
case REFERENCE_TYPE:
{
int m;
if (level >= 6)
return T_VOID;
else
m = plain_type_1 (TREE_TYPE (type), level+1);
1991-12-23 23:45:25 +01:00
return PUSH_DERIVED_LEVEL (DT_PTR, m);
}
case FUNCTION_TYPE:
case METHOD_TYPE:
{
int m;
if (level >= 6)
return T_VOID;
else
m = plain_type_1 (TREE_TYPE (type), level+1);
1991-12-23 23:45:25 +01:00
return PUSH_DERIVED_LEVEL (DT_FCN, m);
}
default:
return 0;
}
}
/* Output the symbols defined in block number DO_BLOCK.
This function works by walking the tree structure of blocks,
counting blocks until it finds the desired block. */
static int do_block = 0;
static void
sdbout_block (block)
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
tree block;
1991-12-23 23:45:25 +01:00
{
while (block)
{
/* Ignore blocks never expanded or otherwise marked as real. */
if (TREE_USED (block))
{
/* When we reach the specified block, output its symbols. */
emit-rtl.c (remove_unncessary_notes): Remove notes for empty blocks. * emit-rtl.c (remove_unncessary_notes): Remove notes for empty blocks. * final.c (next_block_index): Remove. (max_block_depth): Likewise. (pending_blocks): Likewise. (init_final): Don't initialize them. (final_start_function): Don't set next_block_index. Set up BLOCK_NUMBER. (final_scan_insn): Use BLOCK_NUMBER, not next_block_index. * function.h (number_blocks): New function. * function.c (get_block_vector): New function. (identify_blocks): Use it. (reorder_blocks): Set NOTE_BLOCK. (number_blocks): New function. * tree.def (BLOCK): Add documentation for TREE_ASM_WRITTEN flag. * tree.h (BLOCK_NUMBER): New macro. (tree_block): Add block_num field. * dbxout.c (next_block_number): Remove. (dbxout_init): Don't set it. (dbxout_block): Only output blocks that have TREE_ASM_WRITTEN set. Use BLOCK_NUMBER, rather than next_block_num, to determine block numbers. * toplev.c (rest_of_compilation): Always call find_loop_tree_blocks. Fix indentation. * dwarf2out.c (next_block_number): Remove. (gen_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, to determine block numbers. (gen_inlined_subroutine_die): Likewise. (gen_block_die): Only output blocks that have TREE_ASM_WRITTEN set. (decls_for_scope): Don't increment next_block_number. * dwarfout.c (next_block_number): Remove. (output_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, to determine block numbers. (output_inlined_subroutine_die): Likewise. (output_block): Only output blocks that have TREE_ASM_WRITTEN set. (output_decls_for_scope): Don't increment next_block_number. * sdbout.c (next_block_number): Remove. (sdbout_block): Use BLOCK_NUMBER. (sdbout_begin_block): Simplify. * xcoffout.c (next_block_number): Remove. (xcoffout_block): Use BLOCK_NUMBER, not next_block_number. (xcoffout_begin_block): Don't set next_block_number. (xcoffout_begin_function): Likewise. Use BLOCK_NUMBER, not next_block_number. From-SVN: r32228
2000-02-28 10:51:42 +01:00
if (BLOCK_NUMBER (block) == do_block)
sdbout_syms (BLOCK_VARS (block));
1991-12-23 23:45:25 +01:00
/* If we are past the specified block, stop the scan. */
emit-rtl.c (remove_unncessary_notes): Remove notes for empty blocks. * emit-rtl.c (remove_unncessary_notes): Remove notes for empty blocks. * final.c (next_block_index): Remove. (max_block_depth): Likewise. (pending_blocks): Likewise. (init_final): Don't initialize them. (final_start_function): Don't set next_block_index. Set up BLOCK_NUMBER. (final_scan_insn): Use BLOCK_NUMBER, not next_block_index. * function.h (number_blocks): New function. * function.c (get_block_vector): New function. (identify_blocks): Use it. (reorder_blocks): Set NOTE_BLOCK. (number_blocks): New function. * tree.def (BLOCK): Add documentation for TREE_ASM_WRITTEN flag. * tree.h (BLOCK_NUMBER): New macro. (tree_block): Add block_num field. * dbxout.c (next_block_number): Remove. (dbxout_init): Don't set it. (dbxout_block): Only output blocks that have TREE_ASM_WRITTEN set. Use BLOCK_NUMBER, rather than next_block_num, to determine block numbers. * toplev.c (rest_of_compilation): Always call find_loop_tree_blocks. Fix indentation. * dwarf2out.c (next_block_number): Remove. (gen_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, to determine block numbers. (gen_inlined_subroutine_die): Likewise. (gen_block_die): Only output blocks that have TREE_ASM_WRITTEN set. (decls_for_scope): Don't increment next_block_number. * dwarfout.c (next_block_number): Remove. (output_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, to determine block numbers. (output_inlined_subroutine_die): Likewise. (output_block): Only output blocks that have TREE_ASM_WRITTEN set. (output_decls_for_scope): Don't increment next_block_number. * sdbout.c (next_block_number): Remove. (sdbout_block): Use BLOCK_NUMBER. (sdbout_begin_block): Simplify. * xcoffout.c (next_block_number): Remove. (xcoffout_block): Use BLOCK_NUMBER, not next_block_number. (xcoffout_begin_block): Don't set next_block_number. (xcoffout_begin_function): Likewise. Use BLOCK_NUMBER, not next_block_number. From-SVN: r32228
2000-02-28 10:51:42 +01:00
if (BLOCK_NUMBER (block) > do_block)
1991-12-23 23:45:25 +01:00
return;
/* Scan the blocks within this block. */
sdbout_block (BLOCK_SUBBLOCKS (block));
}
block = BLOCK_CHAIN (block);
}
}
/* Call sdbout_symbol on each decl in the chain SYMS. */
static void
sdbout_syms (syms)
tree syms;
{
while (syms)
{
if (TREE_CODE (syms) != LABEL_DECL)
sdbout_symbol (syms, 1);
1991-12-23 23:45:25 +01:00
syms = TREE_CHAIN (syms);
}
}
/* Output SDB information for a symbol described by DECL.
LOCAL is nonzero if the symbol is not file-scope. */
void
sdbout_symbol (decl, local)
tree decl;
int local;
{
tree type = TREE_TYPE (decl);
tree context = NULL_TREE;
rtx value;
int regno = -1;
const char *name;
1991-12-23 23:45:25 +01:00
sdbout_one_type (type);
#if 0 /* This loses when functions are marked to be ignored,
which happens in the C++ front end. */
if (DECL_IGNORED_P (decl))
return;
#endif
1991-12-23 23:45:25 +01:00
switch (TREE_CODE (decl))
{
case CONST_DECL:
/* Enum values are defined by defining the enum type. */
return;
case FUNCTION_DECL:
/* Don't mention a nested function under its parent. */
context = decl_function_context (decl);
if (context == current_function_decl)
return;
/* Check DECL_INITIAL to distinguish declarations from definitions.
Don't output debug info here for declarations; they will have
a DECL_INITIAL value of 0. */
if (! DECL_INITIAL (decl))
1991-12-23 23:45:25 +01:00
return;
if (GET_CODE (DECL_RTL (decl)) != MEM
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
return;
PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
PUT_SDB_VAL (XEXP (DECL_RTL (decl), 0));
PUT_SDB_SCL (TREE_PUBLIC (decl) ? C_EXT : C_STAT);
break;
case TYPE_DECL:
/* Done with tagged types. */
if (DECL_NAME (decl) == 0)
return;
if (DECL_IGNORED_P (decl))
return;
1991-12-23 23:45:25 +01:00
/* Output typedef name. */
if (template_name_p (DECL_NAME (decl)))
PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
else
PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (decl)));
1991-12-23 23:45:25 +01:00
PUT_SDB_SCL (C_TPDEF);
break;
case PARM_DECL:
/* Parm decls go in their own separate chains
and are output by sdbout_reg_parms and sdbout_parms. */
abort ();
case VAR_DECL:
/* Don't mention a variable that is external.
Let the file that defines it describe it. */
if (DECL_EXTERNAL (decl))
1991-12-23 23:45:25 +01:00
return;
/* Ignore __FUNCTION__, etc. */
if (DECL_IGNORED_P (decl))
return;
1991-12-23 23:45:25 +01:00
/* If there was an error in the declaration, don't dump core
if there is no RTL associated with the variable doesn't
exist. */
if (!DECL_RTL_SET_P (decl))
1991-12-23 23:45:25 +01:00
return;
SET_DECL_RTL (decl,
eliminate_regs (DECL_RTL (decl), 0, NULL_RTX));
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
leaf_renumber_regs_insn (DECL_RTL (decl));
#endif
value = DECL_RTL (decl);
1991-12-23 23:45:25 +01:00
/* Don't mention a variable at all
if it was completely optimized into nothingness.
If DECL was from an inline function, then its rtl
is not identically the rtl that was used in this
particular compilation. */
if (GET_CODE (value) == REG)
{
regno = REGNO (DECL_RTL (decl));
if (regno >= FIRST_PSEUDO_REGISTER)
return;
}
else if (GET_CODE (value) == SUBREG)
1991-12-23 23:45:25 +01:00
{
while (GET_CODE (value) == SUBREG)
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
value = SUBREG_REG (value);
1991-12-23 23:45:25 +01:00
if (GET_CODE (value) == REG)
{
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
if (REGNO (value) >= FIRST_PSEUDO_REGISTER)
return;
1991-12-23 23:45:25 +01:00
}
regno = REGNO (alter_subreg (&DECL_RTL (decl)));
value = DECL_RTL (decl);
1991-12-23 23:45:25 +01:00
}
/* Don't output anything if an auto variable
gets RTL that is static.
GAS version 2.2 can't handle such output. */
else if (GET_CODE (value) == MEM && CONSTANT_P (XEXP (value, 0))
&& ! TREE_STATIC (decl))
return;
1991-12-23 23:45:25 +01:00
/* Emit any structure, union, or enum type that has not been output.
This occurs for tag-less structs (et al) used to declare variables
within functions. */
if (TREE_CODE (type) == ENUMERAL_TYPE
|| TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE)
1991-12-23 23:45:25 +01:00
{
tree.h (COMPLETE_TYPE_P): New macro. gcc * tree.h (COMPLETE_TYPE_P): New macro. (COMPLETE_OR_VOID_TYPE_P): New macro. (COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro. * stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE. * c-aux-info.c (gen_type): Use them. * c-common.c (c_expand_expr_stmt): Likewise. * c-decl.c (poplevel, pushdecl, start_decl, finish_decl, grokdeclarator, grokparms, finish_struct, start_function, store_parm_decls, combine_parm_decls): Likewise. * c-parse.y (cast_expr): Likewise. * c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn, c_size_in_bytes, c_alignof, build_component_ref, build_indirect_ref, build_array_ref, convert_arguments, build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise. * calls.c (initialize_argument_information): Likewise. * convert.c (convert_to_integer): Likewise. * dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise. * dwarfout.c (location_or_const_value_attribute, output_enumeration_type_die, output_structure_type_die, output_union_type_die, output_type): Likewise. * expr.c (safe_from_p, expand_expr): Likewise. * function.c (assign_parms): Likewise. * sdbout.c (sdbout_symbol, sdbout_one_type): Likewise. * tree.c (build_array_type, build_function_type, build_method_type, build_offset_type, build_complex_type): Likewise. * c-parse.c, c-parse.h: Regenerated. gcc/cp * typeck.c (require_complete_type, complete_type, complete_type_or_else, c_sizeof, c_sizeof_nowarn, build_array_ref, convert_arguments, pointer_diff, build_x_unary_op, build_unary_op, build_c_cast, build_modify_expr): Use COMPLETE_TYPE_P etc. * call.c (is_complete, convert_like_real, build_new_method_call): Likewise. * class.c (build_vbase_pointer_fields, check_bases, build_base_field, finish_struct_1, pushclass): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. * decl.c (maybe_process_template_type_declaration, pushtag, pushdecl, redeclaration_error_message, start_decl, start_decl_1, layout_var_decl, check_initializer, cp_finish_decl, grokdeclarator, require_complete_types_for_parms, grok_op_properties, xref_tag, xref_basetypes, check_function_type): Likewise. * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. * friend.c (do_friend): Likewise. * init.c (build_offset_ref): Likewise. * parse.y (structsp): Likewise. * pt.c (maybe_process_partial_specialization, tsubst_friend_function, instantiate_class_template, tsubst, do_type_instantiation, instantiate_pending_templates): Likewise. * repo.c (repo_get_id): Likewise. * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, synthesize_tinfo_var, emit_support_tinfos): Likewise. * search.c (lookup_fnfields_1, lookup_conversions): Likewise. * semantics.c (begin_class_definition): Likewise. * tree.c (build_cplus_method_type): Likewise. * typeck2.c (digest_init, build_functional_cast, add_exception_specifier): Likewise. * parse.h, parse.c: Regenerated. From-SVN: r32671
2000-03-21 19:10:48 +01:00
if (COMPLETE_TYPE_P (type) /* not a forward reference */
1991-12-23 23:45:25 +01:00
&& KNOWN_TYPE_TAG (type) == 0) /* not yet declared */
sdbout_one_type (type);
}
/* Defer SDB information for top-level initialized variables! */
if (! local
&& GET_CODE (value) == MEM
&& DECL_INITIAL (decl))
return;
/* C++ in 2.3 makes nameless symbols. That will be fixed later.
For now, avoid crashing. */
if (DECL_NAME (decl) == NULL_TREE)
return;
1991-12-23 23:45:25 +01:00
/* Record the name for, starting a symtab entry. */
if (local)
name = IDENTIFIER_POINTER (DECL_NAME (decl));
else
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
1991-12-23 23:45:25 +01:00
if (GET_CODE (value) == MEM
&& GET_CODE (XEXP (value, 0)) == SYMBOL_REF)
{
PUT_SDB_DEF (name);
if (TREE_PUBLIC (decl))
{
PUT_SDB_VAL (XEXP (value, 0));
PUT_SDB_SCL (C_EXT);
}
else
{
PUT_SDB_VAL (XEXP (value, 0));
PUT_SDB_SCL (C_STAT);
}
}
else if (regno >= 0)
{
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (regno));
PUT_SDB_SCL (C_REG);
}
else if (GET_CODE (value) == MEM
&& (GET_CODE (XEXP (value, 0)) == MEM
|| (GET_CODE (XEXP (value, 0)) == REG
&& REGNO (XEXP (value, 0)) != HARD_FRAME_POINTER_REGNUM
&& REGNO (XEXP (value, 0)) != STACK_POINTER_REGNUM)))
1991-12-23 23:45:25 +01:00
/* If the value is indirect by memory or by a register
that isn't the frame pointer
then it means the object is variable-sized and address through
that register or stack slot. COFF has no way to represent this
so all we can do is output the variable as a pointer. */
{
PUT_SDB_DEF (name);
if (GET_CODE (XEXP (value, 0)) == REG)
{
PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (REGNO (XEXP (value, 0))));
PUT_SDB_SCL (C_REG);
}
else
{
/* DECL_RTL looks like (MEM (MEM (PLUS (REG...)
(CONST_INT...)))).
We want the value of that CONST_INT. */
/* Encore compiler hates a newline in a macro arg, it seems. */
PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET
(XEXP (XEXP (value, 0), 0)));
PUT_SDB_SCL (C_AUTO);
}
/* Effectively do build_pointer_type, but don't cache this type,
since it might be temporary whereas the type it points to
might have been saved for inlining. */
/* Don't use REFERENCE_TYPE because dbx can't handle that. */
type = make_node (POINTER_TYPE);
TREE_TYPE (type) = TREE_TYPE (decl);
1991-12-23 23:45:25 +01:00
}
else if (GET_CODE (value) == MEM
&& ((GET_CODE (XEXP (value, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (value, 0), 0)) == REG
&& GET_CODE (XEXP (XEXP (value, 0), 1)) == CONST_INT)
/* This is for variables which are at offset zero from
the frame pointer. This happens on the Alpha.
Non-frame pointer registers are excluded above. */
|| (GET_CODE (XEXP (value, 0)) == REG)))
1991-12-23 23:45:25 +01:00
{
/* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
or (MEM (REG...)). We want the value of that CONST_INT
or zero. */
1991-12-23 23:45:25 +01:00
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET (XEXP (value, 0)));
PUT_SDB_SCL (C_AUTO);
}
else if (GET_CODE (value) == MEM && GET_CODE (XEXP (value, 0)) == CONST)
{
/* Handle an obscure case which can arise when optimizing and
when there are few available registers. (This is *always*
the case for i386/i486 targets). The DECL_RTL looks like
(MEM (CONST ...)) even though this variable is a local `auto'
or a local `register' variable. In effect, what has happened
is that the reload pass has seen that all assignments and
references for one such a local variable can be replaced by
equivalent assignments and references to some static storage
variable, thereby avoiding the need for a register. In such
cases we're forced to lie to debuggers and tell them that
this variable was itself `static'. */
PUT_SDB_DEF (name);
PUT_SDB_VAL (XEXP (XEXP (value, 0), 0));
PUT_SDB_SCL (C_STAT);
}
1991-12-23 23:45:25 +01:00
else
{
/* It is something we don't know how to represent for SDB. */
return;
}
break;
bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration. * bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration. * c-decl.c (finish_decl): Use parentheses around && within ||. * rtl.c: Include stdlib.h. (read_skip_spaces): Add parentheses around assignments used as truth values. (read_rtx): Initialize list_rtx. * cppexp.c (parse_number): Use || when operands are truth values. * alias.c (find_base_value): Add default case. (memrefs_conflict): Likewise. * combine.c (sets_function_arg_p): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (contains_replace_regs): Likewise. * rtlanal.c (jmp_uses_reg_or_mem): Likewise. * fold-const.c (fold_convert): Use "&&" for truth values. (fold): Add default case. * sdbout.c (sdbout_field_types): Fix typo in declaration. (sdbout_one_type): Add default case. * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS. (some_operand): Add default case. (input_operand): Likewise. (signed_comparison_operator): Likewise. (divmod_operator): Likewise. (alpha_set_memflags_1): Likewise. * reload1.c (reload_cse_simplify_operands): Ensure function always returns a value. * scan-decls.c (scan_decls): Likewise. * c-lex.c (skip_white_space): Fix typo in declaraion. * c-typeck.c (comp_target_types): Add parentheses around assignment used as truth value. (print_spelling): Likewise. (constructor_implicit, constructor_result): Remove unused variables. * collect2.c (scan_library): Protect prototype with #ifdef SCAN_LIBRARIES. * emit-rtl.c (find_line_note): Fix typo in declaration. * final.c (asm_insn_count): Protect prototype with #ifdef HAVE_ATTR_length. * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC. (try_pre_increment_1, try_pre_increment): Likewise. * regclass.c (auto_inc_dec_reg_p): Protect prototype with #ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit. * gcov-io.h (__store_long, __write_long, __read_long): Fix unsigned/signed comparisons. * gcov.c (read_files): Remove unused "first_type" variable. (scan _for_source_files): Initialize s_ptr. (function_summary): Eliminate "%lf" formatting, use %ld for longs. (output_data): Initialize branch_probs and last_line_num. Eliminate "%lf" formatting, use "%ld" for longs. Co-Authored-By: Jeffrey A Law <law@cygnus.com> From-SVN: r17158
1997-12-20 12:31:54 +01:00
default:
break;
1991-12-23 23:45:25 +01:00
}
PUT_SDB_TYPE (plain_type (type));
PUT_SDB_ENDEF;
}
/* Output SDB information for a top-level initialized variable
that has been delayed. */
Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. (toplev.o): Don't depend on xcoffout.h. * c-decl.c: Include debug.h (duplicate_decls): Use debug hook. * dbxout.c (dbxout_source_file, dbxout_args): Make static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_types): Remove. * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_true_tree, debug_nothing_rtx): New. * debug.h (struct rtx_def): New. (struct gcc_debug_hooks): New hooks ignore_block, outlining_inline_function and label. (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, dwarf2out_frame_finish): New. * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): Make static, update prototype. (dwarf2_debug_hooks): Update. * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, dwarf2out_frame_init, dwarf2out_frame_finish): Remove. * dwarfout.c (dwarf_debug_hooks): Update. * emit-rtl.c: Include debug.h. (remove_unnecessary_notes): Use debug hook. * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. (final_scan_insn): Use debug hook. * integrate.c (output_inline_function): Use debug hook. * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. (sdb_debug_hooks): Update. * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. * toplev.c: Don't include xcoffout.h. (note_outlining_of_inline_function, debug_ignore_block): Remove. * toplev.h (note_outlining_of_inline_function, debug_ignore_block): Remove. * tree.h (dwarf2out_do_frame): Remove. From-SVN: r44163
2001-07-19 23:17:09 +02:00
static void
1991-12-23 23:45:25 +01:00
sdbout_toplevel_data (decl)
tree decl;
{
tree type = TREE_TYPE (decl);
if (DECL_IGNORED_P (decl))
return;
1991-12-23 23:45:25 +01:00
if (! (TREE_CODE (decl) == VAR_DECL
&& GET_CODE (DECL_RTL (decl)) == MEM
&& DECL_INITIAL (decl)))
abort ();
PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
PUT_SDB_VAL (XEXP (DECL_RTL (decl), 0));
if (TREE_PUBLIC (decl))
{
PUT_SDB_SCL (C_EXT);
}
else
{
PUT_SDB_SCL (C_STAT);
}
PUT_SDB_TYPE (plain_type (type));
PUT_SDB_ENDEF;
}
#ifdef SDB_ALLOW_FORWARD_REFERENCES
1996-07-04 00:07:53 +02:00
/* Machinery to record and output anonymous types. */
1991-12-23 23:45:25 +01:00
static tree anonymous_types;
static void
sdbout_queue_anonymous_type (type)
tree type;
{
Remove obstacks. * Makefile.in (ggc-callbacks.o): Remove target. (flow.o): Depend on GGC_H. * alias.c (init_alias_analysis): Remove ggc_p conditionals. (end_alias_analysis): Likewise. * basic-block.h (init_flow): New function. (allocate_reg_life_data): Declare. * bb-reorder.c (function_obstack): Replace with ... (flow_obstack): ... new variable. (fixup_reorder_chain): Use it. * c-decl.c (ggc_p): Remove. (caller-save.c): Don't call oballoc/obfree. * combine.c (struct undobuf): Remove storage. (try_combine): Don't call oballoc. (undo_all): Don't call obfree. * cse.c (insert): Use xmalloc, not oballoc. (cse_main): Adjust accordingly. * dwarf2out.c (save_rtx): Remove obstack code. (dwarf2out_init): Remove ggc_p conditionals. * emit-rtl.c (rtl_obstack): Remove. (gen_rtx_CONST_INT): Remove ggc_p conditionals. (make_insn_raw): Likewise. (emit_insn_before): Likewise. (emit_insn_after): Likewise. (emit_insn): Likewise. (gen_sequence): Likewise. (copy_insn_1): Remove handling of `b' RTL components. (init_emit_once): Remove ggc_p conditionals. * except.c (create_rethrow_ref): Don't fool with obstacks. (add_partial_entry): Likewise. (call_get_eh_context): Likewise. (begin_protect_partials): Likewise. (protect_with_terminate): Likewise. * explow.c (plus_constant_wide): Likewise. * expr.c (init_expr_once): Likewise. (emit_block_move): Likewise. (clear_storage): Likewise. (expand_expr): Likewise. * flow.c (function_obstack): Remove. (flow_obstack): New variable. (flow_firstobj): Likewise. (create_base_block): Use the flow_obstack. (split_block): Likewise. (split_edge): Likewise. (calculate_global_regs_live): Likewise. (allocate_bb_life_data): Make it static. Likewiwse. (init_flow): New function. (size_int_type_wide): Remove ggc_p conditionals. * function.c (push_function_context_to): Don't call save_tree_status. (pop_function_context_from): Or restore_tree_status. (assign_stack_local_1): Don't call push_obstacks. (find_fixup_replacement): Use xmalloc. (fixup_var_refs_insns): Free the storage. (insns_for_mem_walk): Don't mess with obstacks. (instantiate_decls): Likewise. (trampoline_address): Likewise. (expand_function_end): Likewise. * function.h (sturct function): Remove obstack-related variables. (save_tree_status): Don't declare. (restore_tree_status): Likewise. * gcse.c (compute_can_copy): Don't call oballoc/obfree. * genattrtab.c (operate_exp): Remove ggc_p conditionals. (simplify_cond): Likewise. (simplify_test_exp): Don't mess with obstacks. (optimize_attrs): Likewise. * gengenrtl.c (gendef): Don't include ggc_p conditionals. * ggc-callbacks.c (ggc_p): Remove. * ggc-none.c (ggc_p): Remove. * ggc.h (ggc_p): Don't declare. * integrate.c (save_for_inline): Don't mess with obstacks. (integrate_decl_tree): Likewise. (output_inline_function): Likewise. * lists.c (init_EXPR_INSN_LIST_cache): Likewise. * loop.c (temp_obstack): Remove. (rtl_obstack): Likewise. (init_loop): Don't mess with obstacks. (reg_address_cost): Free BIVs and GIVs. (check_insns_for_bivs): Use xmalloc, not oballoc. (find_mem_givs): Likewise. (record_biv): Likewise. (general_induction_var): Likewise. (product_cheap_p): Likewse. * optabs.c (init_one_libfunc): Remove ggc_p conditional. * print-tree.c (debug_tree): Don't use oballoc/obfree. (print_node): Likewise. * profile.c (output_func_start_profiler): Remove call to temporary_allocation. * reload1.c (eliminate_regs_in_insn): Don't mess with obstacks. * resource.c (mark_target_live_regs): Use xmalloc. (free_resource_info): Free the memory. * rtl.c (rtl_obstack): Remove. (rtvec_alloc): Don't mess with obstacks. (rtx_alloc): Likewise. (rtx_free): Remove. (copy_rtx): Don't handle `b' cases. (read_rtx): Use a local rtl_obstack. * rtl.h (oballoc): Remove. (obfree): Likewise. (pop_obstacks): Likewise. (push_obstacks): Likewise. (allocate_bb_life_data): Likewise. (allocate_reg_life_data): Likewise. (rtx_free): Likewise. * sdbout.c (sdbout_queue_anonymous_type): Use tree_cons, not saveable_tree_cons. * simplify-rtx.c (cselib_init): Don't mess with obstacks. * stmt.c (mark_block_nesting): Mark the label_chain. (epxand_label): Use ggc_alloc, not oballoc. (clear_last_expr): Don't mess with obstacks. (expand_decl_cleanup): Likewise. (expand_dcc_cleanup): Likewise. (expand_dhc_cleanup): Likewise. (expand_anon_union_decl): Likewise. (add_case_node): Use xmalloc, not oballoc. (free_case_nodes): New function. (expand_end_case): Call it. * stor-layout.c (layout_type): Don't mess with obstacks. (layout_type): Likewise. * toplev.c (wrapup_global_declarations): Likewise. (compile_file): Remove ggc_p conditionals. (rest_of_compilation): Call init_flow. Remove ggc_p conditionals. (decode_f_option): Remove ggc_p conditionals. * tree.c (function_maybepermanent_obstack): Remove. (maybepermanent_obstack): Likewise. (function_obstack): Likewise. (tmeporary_obstack): Likewise. (momentary_obstack): Likewise. (temp_decl_obstack): Likewise. (saveable_obstack): Likewise. (rtl_obstack): Likewise. (current_obstack): Likewise. (expression_obstack): Likewise. (struct obstack_stack): Likewise. (obstack_stack): Likewise. (obstack_stack_obstack): Likewise. (maybepermanent_firstobj): Likewise. (temporary_firstobj): Likewise. (momentary_firstobj): Likewise. (temp_decl_firstobj): Likewise. (momentary_function_firstobj): Likewise. (all_types_permanent): Likewise. (struct momentary_level): Likewise. (momentary_stack): Likewise. (init_obstacks): Remove initialization of removed obstacks. (save_tree_status): Remove. (restore_tree_status): Likewise. (temporary_allocation): Liekwise. (end_temporary_allocation): Liekwise. (resume_temporary_allocation): Likewise. (saveable_allocation): Likewise. (push_obstacks): Likewise. (push_obstacks_nochange): Likewise. (pop_obstacks): Likewise. (allocation_temporary_p): Likewise. (permanent_allocation): Likewise. (preserve_data): Likewise. (preserve_initializer): Likewise. (rtl_in_current_obstack): Likewise. (rtl_in_saveable_obstack): Likewise. (oballoc): Likewise. (obfree): Likewise. (savealloc): Likewise. (expralloc): Likewise. (print_obstack_name): Likewise. (debug_obstack): Likewise. (object_permanent_p): Likewise. (push_momentary): Likewise. (perserve_momentary): Likewise. (clear_momentary): Likewise. (pop_momentary): Likewise. (pop_momentary_nofree): Likewise. (suspend_momentary): Likewise. (resume_momentary): Likewise. (make_node): Don't set TREE_PERMANENT. (copy_node): Remove ggc_p conditionals. Don't set TYPE_OBSTACK. Don't set TREE_PERMANENT. (get_identifier): Remove ggc_p conditionals. (build_string): Likewise. (make_tree_vec): Likewise. (build_decl_list): Remove. (build_expr_list): Likewise. (tree_cons): Remove ggc_p conditionals. (decl_tree_cons): Remove. (expr_tree_cons): Likewise. (perm_tree_cons): Likewise. (temp_tree_cons): Likewise. (saveable_tree_cons): Likewise. (build1): Remove ggc_p conditionals. (build_parse_node): Likewise. (build_type_attribute_variant): Don't mess with obstacks. (build_type_copy): Likewise. (type_hash_canon): Likewise. (build_pointer_type): Likewise. (build_reference_type): Likewise. (build_index_type): Likewise. (build_range_type): Likewise. (dump_tree_statistics): Don't print obstack information. * tree.h (struct tree_common): Remove permanent_flag. (TREE_PERMANENT): Remove. (TREE_SET_PERMANENT): Likewise. (TYPE_OBSTACK): Likewise. (struct tree_type): Remove obstack. (oballoc): Remove. (savealloc): Likewise. (build_decl_list): Likewise. (build_expr_list): Likewise. (perm_tree_cons): Likewise. (temp_tree_cons): Likewise. (saveable_tree_cons): Likewise. (decl_tree_cons): Likewise. (expr_tree_cons): Likewise. (suspend_momentary): Likewise. (allocation_temporary_p): Likewise. (resume_momentary): Likewise. (push_obstacks_nochange): Likewise. (permanent_allocation): Likewise. (push_momentary): Likewise. (clear_momentary): Likewise. (pop_momentary): Likewise. (end_temporary_allocation): Likewise. (pop_obstacks): Likewise. (push_obstacks): Likewise. (pop_momentary_nofree): LIkewise. (preserve_momentary): Likewise. (saveable_allocation): Likewise. (temporary_allocation): Likewise. (resume_temporary_allocation): Likewise. (perserve_initializer): Likewise. (debug_obstack): Likewise. (rtl_in_current_obstack): Likewise. (rtl_in_saveable_obstack): Likewise. (obfree): Likewise. * varasm.c (current_obstack): Remove. (saveable_obstack): Remove. (rtl_obstack): Remove. (immed_double_const): Don't mess with obstacks. (immed_real_cons): Likewise. (output_constant_def): Likewise. (init_varasm_status): Use xcalloc. (mark_pool_constant): Mark the pool constant itself. (free_varasm_status): Free memory. (decode_rtx_const): Call bzero directly, rather than expanding it inline. (record_rtx_const): Don't mess with obstacks. (force_const_mem): Likewise. * config/arm/arm.c (arm_encode_call_attribute): Remove ggc_p conditionals. (aof_pic_entry): Likewise. * config/ia64/ia64.c (ia64_encode_section_info): Likewise. * config/m32r/m32r.c (m32r_encode_section_info): Likewise. * config/pa/pa.c (saveable_obstack): Remove. (rtl_obstack): Likewise. (current_obstack): Likewise. (output_call): Don't mess with obstacks. (hppa_encode_label): Remove ggc_p conditionals. * config/romp/romp.c (get_symref): Don't mess with obstacks. * config/rs6000/rs6000.c (output_toc): Remove ggc_p conditional. (rs6000_encode_section_info): Likewise. * config/sh/sh.c (get_fpscr_rtx): Likewise. From-SVN: r36856
2000-10-13 08:26:46 +02:00
anonymous_types = tree_cons (NULL_TREE, type, anonymous_types);
1991-12-23 23:45:25 +01:00
}
static void
sdbout_dequeue_anonymous_types ()
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
tree types, link;
1991-12-23 23:45:25 +01:00
while (anonymous_types)
{
types = nreverse (anonymous_types);
anonymous_types = NULL_TREE;
for (link = types; link; link = TREE_CHAIN (link))
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
tree type = TREE_VALUE (link);
1991-12-23 23:45:25 +01:00
if (type && ! TREE_ASM_WRITTEN (type))
1991-12-23 23:45:25 +01:00
sdbout_one_type (type);
}
}
}
#endif
/* Given a chain of ..._TYPE nodes, all of which have names,
output definitions of those names, as typedefs. */
void
sdbout_types (types)
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
tree types;
1991-12-23 23:45:25 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
tree link;
1991-12-23 23:45:25 +01:00
for (link = types; link; link = TREE_CHAIN (link))
sdbout_one_type (link);
#ifdef SDB_ALLOW_FORWARD_REFERENCES
sdbout_dequeue_anonymous_types ();
#endif
}
static void
sdbout_type (type)
tree type;
{
if (type == error_mark_node)
type = integer_type_node;
PUT_SDB_TYPE (plain_type (type));
}
/* Output types of the fields of type TYPE, if they are structs.
Formerly did not chase through pointer types, since that could be circular.
They must come before TYPE, since forward refs are not allowed.
Now james@bigtex.cactus.org says to try them. */
static void
sdbout_field_types (type)
tree type;
{
tree tail;
1991-12-23 23:45:25 +01:00
for (tail = TYPE_FIELDS (type); tail; tail = TREE_CHAIN (tail))
/* This condition should match the one for emitting the actual
members below. */
if (TREE_CODE (tail) == FIELD_DECL
&& DECL_NAME (tail)
&& DECL_SIZE (tail)
&& host_integerp (DECL_SIZE (tail), 1)
&& host_integerp (bit_position (tail), 0))
{
if (POINTER_TYPE_P (TREE_TYPE (tail)))
sdbout_one_type (TREE_TYPE (TREE_TYPE (tail)));
else
sdbout_one_type (TREE_TYPE (tail));
}
1991-12-23 23:45:25 +01:00
}
/* Use this to put out the top level defined record and union types
for later reference. If this is a struct with a name, then put that
name out. Other unnamed structs will have .xxfake labels generated so
that they may be referred to later.
The label will be stored in the KNOWN_TYPE_TAG slot of a type.
It may NOT be called recursively. */
static void
sdbout_one_type (type)
tree type;
{
if (current_function_decl != NULL_TREE
&& DECL_SECTION_NAME (current_function_decl) != NULL_TREE)
; /* Don't change section amid function. */
else
text_section ();
1991-12-23 23:45:25 +01:00
switch (TREE_CODE (type))
{
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
1991-12-23 23:45:25 +01:00
case ENUMERAL_TYPE:
type = TYPE_MAIN_VARIANT (type);
/* Don't output a type twice. */
if (TREE_ASM_WRITTEN (type))
/* James said test TREE_ASM_BEING_WRITTEN here. */
return;
/* Output nothing if type is not yet defined. */
tree.h (COMPLETE_TYPE_P): New macro. gcc * tree.h (COMPLETE_TYPE_P): New macro. (COMPLETE_OR_VOID_TYPE_P): New macro. (COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro. * stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE. * c-aux-info.c (gen_type): Use them. * c-common.c (c_expand_expr_stmt): Likewise. * c-decl.c (poplevel, pushdecl, start_decl, finish_decl, grokdeclarator, grokparms, finish_struct, start_function, store_parm_decls, combine_parm_decls): Likewise. * c-parse.y (cast_expr): Likewise. * c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn, c_size_in_bytes, c_alignof, build_component_ref, build_indirect_ref, build_array_ref, convert_arguments, build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise. * calls.c (initialize_argument_information): Likewise. * convert.c (convert_to_integer): Likewise. * dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise. * dwarfout.c (location_or_const_value_attribute, output_enumeration_type_die, output_structure_type_die, output_union_type_die, output_type): Likewise. * expr.c (safe_from_p, expand_expr): Likewise. * function.c (assign_parms): Likewise. * sdbout.c (sdbout_symbol, sdbout_one_type): Likewise. * tree.c (build_array_type, build_function_type, build_method_type, build_offset_type, build_complex_type): Likewise. * c-parse.c, c-parse.h: Regenerated. gcc/cp * typeck.c (require_complete_type, complete_type, complete_type_or_else, c_sizeof, c_sizeof_nowarn, build_array_ref, convert_arguments, pointer_diff, build_x_unary_op, build_unary_op, build_c_cast, build_modify_expr): Use COMPLETE_TYPE_P etc. * call.c (is_complete, convert_like_real, build_new_method_call): Likewise. * class.c (build_vbase_pointer_fields, check_bases, build_base_field, finish_struct_1, pushclass): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. * decl.c (maybe_process_template_type_declaration, pushtag, pushdecl, redeclaration_error_message, start_decl, start_decl_1, layout_var_decl, check_initializer, cp_finish_decl, grokdeclarator, require_complete_types_for_parms, grok_op_properties, xref_tag, xref_basetypes, check_function_type): Likewise. * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. * friend.c (do_friend): Likewise. * init.c (build_offset_ref): Likewise. * parse.y (structsp): Likewise. * pt.c (maybe_process_partial_specialization, tsubst_friend_function, instantiate_class_template, tsubst, do_type_instantiation, instantiate_pending_templates): Likewise. * repo.c (repo_get_id): Likewise. * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, synthesize_tinfo_var, emit_support_tinfos): Likewise. * search.c (lookup_fnfields_1, lookup_conversions): Likewise. * semantics.c (begin_class_definition): Likewise. * tree.c (build_cplus_method_type): Likewise. * typeck2.c (digest_init, build_functional_cast, add_exception_specifier): Likewise. * parse.h, parse.c: Regenerated. From-SVN: r32671
2000-03-21 19:10:48 +01:00
if (!COMPLETE_TYPE_P (type))
1991-12-23 23:45:25 +01:00
return;
TREE_ASM_WRITTEN (type) = 1;
#if 1
/* This is reputed to cause trouble with the following case,
1992-07-20 05:26:54 +02:00
but perhaps checking TYPE_SIZE above will fix it. */
1991-12-23 23:45:25 +01:00
/* Here is a test case:
struct foo {
struct badstr *bbb;
} forwardref;
typedef struct intermediate {
int aaaa;
} intermediate_ref;
typedef struct badstr {
int ccccc;
} badtype; */
#if 0
TREE_ASM_BEING_WRITTEN (type) = 1;
#endif
/* This change, which ought to make better output,
used to make the COFF assembler unhappy.
Changes involving KNOWN_TYPE_TAG may fix the problem. */
/* Before really doing anything, output types we want to refer to. */
/* Note that in version 1 the following two lines
are not used if forward references are in use. */
if (TREE_CODE (type) != ENUMERAL_TYPE)
sdbout_field_types (type);
#if 0
TREE_ASM_WRITTEN (type) = 1;
#endif
#endif
/* Output a structure type. */
{
int size = int_size_in_bytes (type);
builtins.c (expand_builtin_strlen): Initialize variable `icode'. * builtins.c (expand_builtin_strlen): Initialize variable `icode'. * calls.c (expand_call): Likewise for `old_stack_arg_under_construction'. * cpphash.c (macroexpand): Likewise for `args' and `rest_zero'. * function.c (pad_to_arg_alignment): Likewise for `save_var' and `save_constant'. * gcc.c (execute): Likewise for `ut' and `st'. * genattrtab.c (attr_rtx): Likewise for `rt_val'. * genopinit.c (gen_insn): Likewise for `m1', `m2' and `op'. * jump.c (jump_optimize_1): Likewise for `temp2'. * local-alloc.c (block_alloc): Likewise for `r1'. * loop.c (recombine_givs): Likewise for `life_start' and `life_end'. * reg-stack.c (check_asm_stack_operands): Likewise for `clobber_reg'. (subst_asm_stack_regs): Likewise for `clobber_reg' and `clobber_loc'. * regmove.c (fixup_match_1): Likewise for `insn_const', `dst_node' and `set2'. * reload.c (find_reloads): Likewise for `goal_alternative_number' and `goal_earlyclobber'. * scan-decls.c (scan_decls): Likewise for `prev_id_end'. * sdbout.c (sdbout_one_type): Likewise for `member_scl'. * stupid.c (stupid_life_analysis): Likewise for `chain'. * unroll.c (copy_loop_body): Likewise for `copy'. * varasm.c (output_constructor): Likewise for `byte'. ch: * actions.c (update_else_range_for_int_const): Initialize variables `lowval' and `highval'. (update_else_range_for_range): Likewise for `low_range_val' and `high_range_val'. cp: * class.c (warn_hidden): Initialize variable `fndecl'. From-SVN: r31207
2000-01-04 17:29:41 +01:00
int member_scl = 0;
1991-12-23 23:45:25 +01:00
tree tem;
int i, n_baseclasses = 0;
1991-12-23 23:45:25 +01:00
/* Record the type tag, but not in its permanent place just yet. */
sdbout_record_type_name (type);
PUT_SDB_DEF (KNOWN_TYPE_TAG (type));
switch (TREE_CODE (type))
{
case UNION_TYPE:
case QUAL_UNION_TYPE:
1991-12-23 23:45:25 +01:00
PUT_SDB_SCL (C_UNTAG);
PUT_SDB_TYPE (T_UNION);
member_scl = C_MOU;
break;
case RECORD_TYPE:
PUT_SDB_SCL (C_STRTAG);
PUT_SDB_TYPE (T_STRUCT);
member_scl = C_MOS;
break;
case ENUMERAL_TYPE:
PUT_SDB_SCL (C_ENTAG);
PUT_SDB_TYPE (T_ENUM);
member_scl = C_MOE;
break;
bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration. * bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration. * c-decl.c (finish_decl): Use parentheses around && within ||. * rtl.c: Include stdlib.h. (read_skip_spaces): Add parentheses around assignments used as truth values. (read_rtx): Initialize list_rtx. * cppexp.c (parse_number): Use || when operands are truth values. * alias.c (find_base_value): Add default case. (memrefs_conflict): Likewise. * combine.c (sets_function_arg_p): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (contains_replace_regs): Likewise. * rtlanal.c (jmp_uses_reg_or_mem): Likewise. * fold-const.c (fold_convert): Use "&&" for truth values. (fold): Add default case. * sdbout.c (sdbout_field_types): Fix typo in declaration. (sdbout_one_type): Add default case. * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS. (some_operand): Add default case. (input_operand): Likewise. (signed_comparison_operator): Likewise. (divmod_operator): Likewise. (alpha_set_memflags_1): Likewise. * reload1.c (reload_cse_simplify_operands): Ensure function always returns a value. * scan-decls.c (scan_decls): Likewise. * c-lex.c (skip_white_space): Fix typo in declaraion. * c-typeck.c (comp_target_types): Add parentheses around assignment used as truth value. (print_spelling): Likewise. (constructor_implicit, constructor_result): Remove unused variables. * collect2.c (scan_library): Protect prototype with #ifdef SCAN_LIBRARIES. * emit-rtl.c (find_line_note): Fix typo in declaration. * final.c (asm_insn_count): Protect prototype with #ifdef HAVE_ATTR_length. * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC. (try_pre_increment_1, try_pre_increment): Likewise. * regclass.c (auto_inc_dec_reg_p): Protect prototype with #ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit. * gcov-io.h (__store_long, __write_long, __read_long): Fix unsigned/signed comparisons. * gcov.c (read_files): Remove unused "first_type" variable. (scan _for_source_files): Initialize s_ptr. (function_summary): Eliminate "%lf" formatting, use %ld for longs. (output_data): Initialize branch_probs and last_line_num. Eliminate "%lf" formatting, use "%ld" for longs. Co-Authored-By: Jeffrey A Law <law@cygnus.com> From-SVN: r17158
1997-12-20 12:31:54 +01:00
default:
break;
1991-12-23 23:45:25 +01:00
}
PUT_SDB_SIZE (size);
PUT_SDB_ENDEF;
/* Print out the base class information with fields
named after the types they hold. */
/* This is only relevant to aggregate types. TYPE_BINFO is used
for other purposes in an ENUMERAL_TYPE, so we must exclude that
case. */
if (TREE_CODE (type) != ENUMERAL_TYPE)
{
if (TYPE_BINFO (type)
&& TYPE_BINFO_BASETYPES (type))
n_baseclasses = TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type));
for (i = 0; i < n_baseclasses; i++)
{
tree child = TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (type)),
i);
tree child_type = BINFO_TYPE (child);
tree child_type_name;
if (TYPE_NAME (child_type) == 0)
continue;
if (TREE_CODE (TYPE_NAME (child_type)) == IDENTIFIER_NODE)
child_type_name = TYPE_NAME (child_type);
else if (TREE_CODE (TYPE_NAME (child_type)) == TYPE_DECL)
{
child_type_name = DECL_NAME (TYPE_NAME (child_type));
if (child_type_name && template_name_p (child_type_name))
child_type_name
= DECL_ASSEMBLER_NAME (TYPE_NAME (child_type));
}
else
continue;
CONTIN;
PUT_SDB_DEF (IDENTIFIER_POINTER (child_type_name));
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
PUT_SDB_INT_VAL (tree_low_cst (BINFO_OFFSET (child), 0));
PUT_SDB_SCL (member_scl);
sdbout_type (BINFO_TYPE (child));
PUT_SDB_ENDEF;
}
}
1991-12-23 23:45:25 +01:00
/* output the individual fields */
if (TREE_CODE (type) == ENUMERAL_TYPE)
{
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
if (host_integerp (TREE_VALUE (tem), 0))
{
PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
PUT_SDB_INT_VAL (tree_low_cst (TREE_VALUE (tem), 0));
PUT_SDB_SCL (C_MOE);
PUT_SDB_TYPE (T_MOE);
PUT_SDB_ENDEF;
}
}
1991-12-23 23:45:25 +01:00
else /* record or union type */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
/* Output the name, type, position (in bits), size (in bits)
of each field. */
/* Omit here the nameless fields that are used to skip bits.
Also omit fields with variable size or position.
Also omit non FIELD_DECL nodes that GNU C++ may put here. */
if (TREE_CODE (tem) == FIELD_DECL
&& DECL_NAME (tem)
&& DECL_SIZE (tem)
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
&& host_integerp (DECL_SIZE (tem), 1)
&& host_integerp (bit_position (tem), 0))
1991-12-23 23:45:25 +01:00
{
const char *name;
1991-12-23 23:45:25 +01:00
CONTIN;
name = IDENTIFIER_POINTER (DECL_NAME (tem));
PUT_SDB_DEF (name);
1991-12-23 23:45:25 +01:00
if (DECL_BIT_FIELD_TYPE (tem))
{
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
PUT_SDB_INT_VAL (int_bit_position (tem));
1991-12-23 23:45:25 +01:00
PUT_SDB_SCL (C_FIELD);
sdbout_type (DECL_BIT_FIELD_TYPE (tem));
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
PUT_SDB_SIZE (tree_low_cst (DECL_SIZE (tem), 1));
1991-12-23 23:45:25 +01:00
}
else
{
* Clean up usages of TREE_INT_CST_LOW. * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-17 18:31:58 +01:00
PUT_SDB_INT_VAL (int_bit_position (tem) / BITS_PER_UNIT);
1991-12-23 23:45:25 +01:00
PUT_SDB_SCL (member_scl);
sdbout_type (TREE_TYPE (tem));
}
PUT_SDB_ENDEF;
}
/* output end of a structure,union, or enumeral definition */
PUT_SDB_PLAIN_DEF ("eos");
PUT_SDB_INT_VAL (size);
PUT_SDB_SCL (C_EOS);
PUT_SDB_TAG (KNOWN_TYPE_TAG (type));
PUT_SDB_SIZE (size);
PUT_SDB_ENDEF;
break;
bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration. * bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration. * c-decl.c (finish_decl): Use parentheses around && within ||. * rtl.c: Include stdlib.h. (read_skip_spaces): Add parentheses around assignments used as truth values. (read_rtx): Initialize list_rtx. * cppexp.c (parse_number): Use || when operands are truth values. * alias.c (find_base_value): Add default case. (memrefs_conflict): Likewise. * combine.c (sets_function_arg_p): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (contains_replace_regs): Likewise. * rtlanal.c (jmp_uses_reg_or_mem): Likewise. * fold-const.c (fold_convert): Use "&&" for truth values. (fold): Add default case. * sdbout.c (sdbout_field_types): Fix typo in declaration. (sdbout_one_type): Add default case. * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS. (some_operand): Add default case. (input_operand): Likewise. (signed_comparison_operator): Likewise. (divmod_operator): Likewise. (alpha_set_memflags_1): Likewise. * reload1.c (reload_cse_simplify_operands): Ensure function always returns a value. * scan-decls.c (scan_decls): Likewise. * c-lex.c (skip_white_space): Fix typo in declaraion. * c-typeck.c (comp_target_types): Add parentheses around assignment used as truth value. (print_spelling): Likewise. (constructor_implicit, constructor_result): Remove unused variables. * collect2.c (scan_library): Protect prototype with #ifdef SCAN_LIBRARIES. * emit-rtl.c (find_line_note): Fix typo in declaration. * final.c (asm_insn_count): Protect prototype with #ifdef HAVE_ATTR_length. * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC. (try_pre_increment_1, try_pre_increment): Likewise. * regclass.c (auto_inc_dec_reg_p): Protect prototype with #ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit. * gcov-io.h (__store_long, __write_long, __read_long): Fix unsigned/signed comparisons. * gcov.c (read_files): Remove unused "first_type" variable. (scan _for_source_files): Initialize s_ptr. (function_summary): Eliminate "%lf" formatting, use %ld for longs. (output_data): Initialize branch_probs and last_line_num. Eliminate "%lf" formatting, use "%ld" for longs. Co-Authored-By: Jeffrey A Law <law@cygnus.com> From-SVN: r17158
1997-12-20 12:31:54 +01:00
default:
break;
1991-12-23 23:45:25 +01:00
}
}
}
/* The following two functions output definitions of function parameters.
Each parameter gets a definition locating it in the parameter list.
Each parameter that is a register variable gets a second definition
locating it in the register.
Printing or argument lists in gdb uses the definitions that
locate in the parameter list. But reference to the variable in
expressions uses preferentially the definition as a register. */
/* Output definitions, referring to storage in the parmlist,
of all the parms in PARMS, which is a chain of PARM_DECL nodes. */
static void
sdbout_parms (parms)
tree parms;
{
for (; parms; parms = TREE_CHAIN (parms))
if (DECL_NAME (parms))
{
int current_sym_value = 0;
const char *name = IDENTIFIER_POINTER (DECL_NAME (parms));
1991-12-23 23:45:25 +01:00
if (name == 0 || *name == 0)
name = gen_fake_label ();
/* Perform any necessary register eliminations on the parameter's rtl,
so that the debugging output will be accurate. */
DECL_INCOMING_RTL (parms)
= eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
SET_DECL_RTL (parms,
eliminate_regs (DECL_RTL (parms), 0, NULL_RTX));
1991-12-23 23:45:25 +01:00
if (PARM_PASSED_IN_MEMORY (parms))
{
rtx addr = XEXP (DECL_INCOMING_RTL (parms), 0);
tree type;
/* ??? Here we assume that the parm address is indexed
off the frame pointer or arg pointer.
If that is not true, we produce meaningless results,
but do not crash. */
if (GET_CODE (addr) == PLUS
&& GET_CODE (XEXP (addr, 1)) == CONST_INT)
current_sym_value = INTVAL (XEXP (addr, 1));
else
current_sym_value = 0;
if (GET_CODE (DECL_RTL (parms)) == REG
&& REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
type = DECL_ARG_TYPE (parms);
else
{
int original_sym_value = current_sym_value;
/* This is the case where the parm is passed as an int or
double and it is converted to a char, short or float
and stored back in the parmlist. In this case, describe
the parm with the variable's declared type, and adjust
the address if the least significant bytes (which we are
using) are not the first ones. */
if (BYTES_BIG_ENDIAN
&& TREE_TYPE (parms) != DECL_ARG_TYPE (parms))
1991-12-23 23:45:25 +01:00
current_sym_value +=
(GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms)))
- GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))));
1991-12-23 23:45:25 +01:00
if (GET_CODE (DECL_RTL (parms)) == MEM
&& GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
&& (GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 1))
== CONST_INT)
&& (INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1))
== current_sym_value))
type = TREE_TYPE (parms);
else
{
current_sym_value = original_sym_value;
type = DECL_ARG_TYPE (parms);
}
}
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DEBUGGER_ARG_OFFSET (current_sym_value, addr));
PUT_SDB_SCL (C_ARG);
PUT_SDB_TYPE (plain_type (type));
PUT_SDB_ENDEF;
}
else if (GET_CODE (DECL_RTL (parms)) == REG)
{
rtx best_rtl;
/* Parm passed in registers and lives in registers or nowhere. */
/* If parm lives in a register, use that register;
pretend the parm was passed there. It would be more consistent
to describe the register where the parm was passed,
but in practice that register usually holds something else. */
* Rework fields used to describe positions of bitfields and modify sizes to be unsigned and use HOST_WIDE_INT. * alias.c (reg_known_value_size): Now unsigned. * c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position. (really_start_incremental_init): Use bitsize_zero_node. (push_init_level, pop_init_level, output_init_element): Likewise. Use bitsize_unit_node and bitsize_one_node. (output_pending_init_elements, process_init_element): Likewise. * combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned. (make_extraction): Position and length HOST_WIDE_INT and unsigned HOST_WIDE_INT, respectively. (get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT. (num_sign_bit_copies): Returns unsigned. BITWIDTH now unsigned; rework arithmetic. Remove recursive call from arg to MAX. (combine_instructions, init_reg_last_arrays): NREGS now unsigned. (setup_incoming_promotions, can_combine_p, try_combine, simplify_set): REGNO now unsigned. (set_nonzero_bit_and_sign_copies): NUM now unsigned. (find_split_point, expand_compound_operation, make_extraction): LEN now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT. (make_field_assignment): Likewise. (combine_simplify_rtx): Add cast. (expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic. (force_to_mode): WIDTH now unsigned; add cast. (if_then_else_cond): SIZE now unsigned. (nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned. (extended_count): Now returns unsigned. (simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT. Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned. (simplify_comparison): MODE_WIDTH now unsigned. (update_table_tick): REGNO and ENDREGNO now unsigned; new var R. (mark_used_regs_combine): Likewise; rework arithmetic. (record_value_for_reg): REGNO, ENDREGNO, and I now unsigned. (record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise. (record_promoted_value): REGNO now unsigned. (get_last_value_validate): REGNO, ENDREGNO, and J now unsigned. (get_last_value): REGNO now unsigned. (use_crosses_set_p): REGNO and ENDREGNO now unsigned. (reg_dead_regno, reg_dead_endregno): Now unsigned. (remove_death): Arg REGNO now unsigned. (move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned. (reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO now unsigned. * convert.c (convert_to_integer): INPREC and OUTPREC now unsigned. * cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned. (struct cse_reg_info): REGNO now unsigned. (cached_regno): Now unsigned. (REGNO_QTY_VALID_P): Add cast. (make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned. (remove_invalid_regs): Likewise. (remove_invalid_subreg_refs): Likewise; arg WORD also unsigned as are variables END and I. (get_cse_reg_info, insert): Likewise. (mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned. (canon_hash): Likewise. (insert_regs, lookup_for_remove): REGNO now unsigned. (invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned. New variable RN. * dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0. * dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast. * emit-rtl.c (subreg_realpart_p): Add cast. (operand_subword): Arg I is now unsigned as is var PARTWORDS. (operand_subword_force): Arg I is now unsigned. * except.c (eh_regs): Variable I is now unsigned. * explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT. * expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT; length is unsigned HOST_WIDE_INT; likewise for internal variables. (store_split_bit_field, extract_fixed_bit_field): Likewise. (extract_split_bit_field, store_bit_field, extract_bit_field): Likewise. * expr.c (store_constructor_fields, store_constructor, store_field): Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT. (expand_assignment, expand_expr, expand_expr_unaligned): Likewise. (do_jump): Likewise. (move_by_pieces, move_by_pieces_ninsns, clear_by_pieces): MAX_SIZE is now unsigned. (emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned. (emit_group_store): Likewise. (emit_move_insn): I now unsigned. (store_constructor): Use host_integerp, tree_low_cst, and bitsize_unit_node. (get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT. Rework all calculations to use trees and new fields. * expr.h (promoted_input_arg): Regno now unsigned. (store_bit_field, extract_bit_field): Adjust types of pos and size. (mark_seen_cases): Arg is HOST_WIDE_INT. * flow.c (verify_wide_reg_1): REGNO now unsigned. * fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT; precisions and alignments are unsigned. (optimize_bit_field_compare, fold_truthop): Likewise. (int_const_binop): Adjust threshold for size_int_type_wide call. (fold_convert): Likewise. (size_int_type_wide): Make table larger and fix thinko that only had half of table used. (all_ones_mask_p, fold): Precisions are unsigned. * function.c (put_reg_info_stack): REGNO is unsigned. (instantiate_decl): Size is HOST_WIDE_INT. (instantiate_virtual_regs): I is unsigned. (assign_parms): REGNO, REGNOI, and REGNOR are unsigned. (promoted_input_arg): REGNO is unsigned. * function.h (struct function): x_max_parm_reg is now unsigned. * gcse.c (max_gcse_regno): Now unsigned. (struct null_pointer_info): min_reg and max_reg now unsigned. (lookup_set, next_set): REGNO arg now unsigned. (compute_hash_table): REGNO and I now unsigned. (handle_avail_expr): regnum_for_replacing now unsigned. (cprop_insn): REGNO now unsigned. (delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned. * ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case. * global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned. * hard-reg-set.h (reg_class_size): Now unsigned. * integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO. * jump.c (mark_modified_reg): I now unsigned; add cast. (rtx_equal_for_thread_p): Add cast. * loop.c (max_reg_before_loop): Now unsigned. (struct_movable): REGNO now unsigned. (try_copy_prop): REGNO arg unsigned. (regs_match_p): XN and YN now unsigned. (consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned. (strength_reduce): Likewise; NREGS also unsigned. (first_increment_giv, last_increment_giv unsigned): Now unsigned. * loop.h (struct iv_class): REGNO now unsigned. (max_reg_before_loop, first_increment_giv, last_increment_giv): Now unsigned. * machmode.h (mode_size, mode_unit_size): Now unsigned. (mode_for_size, smallest_mode_for_size): Pass size as unsigned. * optabs.c (expand_binop): I and NWORDS now unsigned. (expand_unop): I now unsigned. * print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET. * real.c (significand_size): Now returns unsigned. * real.h (significand_size): Likewise. * regclass.c (reg_class_size): Now unsigned. (choose_hard_reg_mode): Both operands now unsigned. (record_reg_classes): REGNO and NR now unsigned. (reg_scan): NREGS now unsigned. (reg_scan_update): old_max_regno now unsigned. (reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned. * reload.c (find_valid_class): BEST_SIZE now unsigned. (find_dummy_reload): REGNO, NWORDS, and I now unsigned. (hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned. Likewise for variable R. (refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned, as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R. (find_equiv_reg): Add casts. (regno_clobbered_p): Arg REGNO now unsigned. * reload.h (struct reload): NREGS now unsigned. (refers_to_regno_for_reload_p): Regno args are unsigned. (regno_clobbered_p): Likewise. * reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned. (compute_use_by_pseudos): REGNO now unsigned. (find_reg): I and J now unsigned, new variable K, and change loop variables accordingly; THIS_NREGS now unsigned. (alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned. (spill_hard_reg): REGNO arg now unsigned; add casts. (forget_old_reloads_1): REGNO, NR, and I now unsigned. (mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned. (clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO, END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned. (reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned. (choose_reload_regs): MAX_GROUP_SIZE now unsigned. (emit_reload_insns): REGNO now unsigned. (reload_cse_move2add): Add cast. (move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO and rework loop. * resource.c (mark_referenced_resources, mark_set_resources): New variable R; REGNO and LAST_REGNO now unsigned. (mark_target_live_regs): J and REGNO now unsigned. * rtl.c (mode_size, mode_unit_size): Now unsigned. * rtl.h (union rtunion_def): New field rtuint. (XCUINT): New macro. (ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT. (operand_subword, operand_subword_force): Word number is unsigned. (choose_hard_reg_mode): Operands are unsigned. (refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned. (find_regno_note, find_regno_fusage, replace_regs): Likewise. (regno_use_in, combine_instructions, remove_death): Likewise. (reg_scan, reg_scan_update): Likewise. (extended_count): Return is unsigned. * rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I, INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO. (reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned. (reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned. (reg_reg_last_1): FIRS and LAST now unsigned. (dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned. (dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO now unsigned. (find_regno_note, regno_use_in): Arg REGNO now unsigned. (find_regno_fusage): Likewise; also var REGNOTE now unsigned. (find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned. (replace_regs): Arg NREGS now unsigned. * sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0. * simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned. (simplify_binary_operation): Likewise. (cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and THIS_LAST now unsigned. (cselib_record_set): Add cast. * ssa.c (ssa_max_reg_num): Now unsigned. (rename_block): REGNO now unsigned. * stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT; sizes now unsigned. (all_cases_count): Just return -1 not -2. COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT. Rework tests to use trees whenever possible. Use host_integerp and tree_low_cst. (mark_seen_cases): COUNT arg now HOST_WIDE_INT; Likewise variable NEXT_NODE_OFFSET; XLO now unsigned. (check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT. * stor-layout.c (mode_for_size): SIZE arg now unsigned. (smallest_mode_for_size): Likewise. (layout_decl): Simplify handing of a specified DECL_SIZE_UNIT. KNOWN_ALIGN is now an alignment, so simplify code. Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type. (start_record_layout): Renamed from new_record_layout_info. Update to new fields. (debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far): New functions. (place_union_field): Renamed from layout_union_field. Update to use new fields in rli. (place_field): Renamed from layout_field. Major rewrite to use new fields in rli; pass alignment to layout_decl. (finalize_record_size): Rework to use new fields in rli and handle union. (compute_record_mode): Rework to simplify and to use new DECL fields. (finalize_type_size): Make rounding more consistent. (finish_union_layout): Deleted. (layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either. (layout_type, case RECORD_TYPE): Call new function names. (initialize_sizetypes): Set TYPE_IS_SIZETYPE. (set_sizetype): Set TYPE_IS_SIZETYPE earlier. (get_best_mode): UNIT is now unsigned; remove casts. * tree.c (bit_position): Compute from new fields. (byte_position, int_byte_position): New functions. (print_type_hash_statistics): Cast to remove warning. (build_range_type): Use host_integerp and tree_low_cst to try to hash. (build_index_type): Likewise; make subtype of sizetype. (build_index_2_type): Pass sizetype to build_range_type. (build_common_tree_nodes): Use size_int and bitsize_int to initialize nodes; add bitsize_{zero,one,unit}_node. * tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK. (DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise. (DECL_PACKED, DECL_BIT_FIELD): Likewise. (DECL_FIELD_BITPOS): Deleted. (DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields. (DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK. (DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise. (DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise. (DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise. (DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise. (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise. (DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK. (DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK. (DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise. (DECL_ALIGN): Adjust to new field in union. (DECL_OFFSET_ALIGN): New field. (DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK. (DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK. (union tree_decl): Add struct for both aligns. (enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}. (bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added. (struct record_layout_info): Rework fields to have offset alignment and byte and bit position. (start_record_layout, place_field): Renamed from old names. (rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls. (byte_position, int_byte_position): Likewise. (get_inner_reference): Change types of position and length. * unroll.c (unroll_loop): New variable R; use for some loops. MAX_LOCAL_REGNUM and MAXREGNUM now unsigned. (calculate_giv_inc): Arg REGNO now unsigned. (copy_loop_body): REGNO and SRC_REGNO now unsigned. * varasm.c (assemble_variable): Clean up handling of size using host_integerp and tree_low_cst. (decode_addr_const): Use byte, not bit, position. (output_constructor): bitpos and offsets are HOST_WIDE_INT; use tree_low_cst and int_bit_position. * objc/objc-act.c (build_ivar_list_initializer): Use byte_position. * ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT. * ch/typeck.c (expand_constant_to_buffer): Use int_byte_position. (extract_constant_from_buffer): Likewise. * cp/class.c (build_vbase_pointer_fields): layout_field now place_field. (get_vfield_offset): Use byte_position. (set_rtti_entry): Set OFFSET to ssizetype zero. (get_binfo_offset_as_int): Deleted. (dfs_record_base_offsets): Use tree_low_cst. (dfs_search_base_offsets): Likewise. (layout_nonempty_base_or_field): Reflect changes in RLI format and call byte_position. (layout_empty_base): Convert offset to ssizetype. (build_base_field): use rli_size_unit_so_far. (dfs_propagate_binfo_offsets): Do computation in proper type. (layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets. (layout_class_type): Reflect changes in RLI names and fields. (finish_struct_1): Set DECL_FIELD_OFFSET. * cp/dump.c (dequeue_and_dump): Call bit_position. * cp/expr.c (cplus_expand_constant): Use byte_position. * cp/rtti.c (expand_class_desc): Use bitsize_one_node. * cp/typeck.c (build_component_addr): Use byte_position and don't special case for zero offset. * f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node. (ffecom_tree_canonize_ref_): Likewise. * java/class.c (make_field_value): Use byte_position. * java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position. (java_array_data_offset): Likewise. * java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to bzero call. From-SVN: r32742
2000-03-25 19:34:13 +01:00
if (REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
1991-12-23 23:45:25 +01:00
best_rtl = DECL_RTL (parms);
/* If the parm lives nowhere,
use the register where it was passed. */
else
best_rtl = DECL_INCOMING_RTL (parms);
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (REGNO (best_rtl)));
PUT_SDB_SCL (C_REGPARM);
PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
1991-12-23 23:45:25 +01:00
PUT_SDB_ENDEF;
}
else if (GET_CODE (DECL_RTL (parms)) == MEM
&& XEXP (DECL_RTL (parms), 0) != const0_rtx)
{
/* Parm was passed in registers but lives on the stack. */
/* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
in which case we want the value of that CONST_INT,
or (MEM (REG ...)) or (MEM (MEM ...)),
in which case we use a value of zero. */
if (GET_CODE (XEXP (DECL_RTL (parms), 0)) == REG
|| GET_CODE (XEXP (DECL_RTL (parms), 0)) == MEM)
current_sym_value = 0;
else
current_sym_value = INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1));
/* Again, this assumes the offset is based on the arg pointer. */
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DEBUGGER_ARG_OFFSET (current_sym_value,
XEXP (DECL_RTL (parms), 0)));
PUT_SDB_SCL (C_ARG);
PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
1991-12-23 23:45:25 +01:00
PUT_SDB_ENDEF;
}
}
}
/* Output definitions for the places where parms live during the function,
when different from where they were passed, when the parms were passed
in memory.
It is not useful to do this for parms passed in registers
that live during the function in different registers, because it is
impossible to look in the passed register for the passed value,
so we use the within-the-function register to begin with.
PARMS is a chain of PARM_DECL nodes. */
static void
sdbout_reg_parms (parms)
tree parms;
{
for (; parms; parms = TREE_CHAIN (parms))
if (DECL_NAME (parms))
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (parms));
1991-12-23 23:45:25 +01:00
/* Report parms that live in registers during the function
but were passed in memory. */
if (GET_CODE (DECL_RTL (parms)) == REG
&& REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER
&& PARM_PASSED_IN_MEMORY (parms))
{
if (name == 0 || *name == 0)
name = gen_fake_label ();
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DBX_REGISTER_NUMBER (REGNO (DECL_RTL (parms))));
PUT_SDB_SCL (C_REG);
PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
1991-12-23 23:45:25 +01:00
PUT_SDB_ENDEF;
}
/* Report parms that live in memory but not where they were passed. */
else if (GET_CODE (DECL_RTL (parms)) == MEM
&& GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
&& GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 1)) == CONST_INT
&& PARM_PASSED_IN_MEMORY (parms)
&& ! rtx_equal_p (DECL_RTL (parms), DECL_INCOMING_RTL (parms)))
{
#if 0 /* ??? It is not clear yet what should replace this. */
int offset = DECL_OFFSET (parms) / BITS_PER_UNIT;
/* A parm declared char is really passed as an int,
so it occupies the least significant bytes.
On a big-endian machine those are not the low-numbered ones. */
if (BYTES_BIG_ENDIAN
&& offset != -1
&& TREE_TYPE (parms) != DECL_ARG_TYPE (parms))
1991-12-23 23:45:25 +01:00
offset += (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms)))
- GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))));
if (INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1)) != offset) {...}
#endif
{
if (name == 0 || *name == 0)
name = gen_fake_label ();
PUT_SDB_DEF (name);
PUT_SDB_INT_VAL (DEBUGGER_AUTO_OFFSET
(XEXP (DECL_RTL (parms), 0)));
PUT_SDB_SCL (C_AUTO);
PUT_SDB_TYPE (plain_type (TREE_TYPE (parms)));
PUT_SDB_ENDEF;
}
}
}
}
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
/* Output debug information for a global DECL. Called from toplev.c
after compilation proper has finished. */
static void
sdbout_global_decl (decl)
tree decl;
{
if (TREE_CODE (decl) == VAR_DECL
&& !DECL_EXTERNAL (decl)
&& DECL_RTL_SET_P (decl))
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
{
/* The COFF linker can move initialized global vars to the end.
And that can screw up the symbol ordering. Defer those for
sdbout_finish (). */
if (!DECL_INITIAL (decl) || !TREE_PUBLIC (decl))
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
sdbout_symbol (decl, 0);
/* Output COFF information for non-global file-scope initialized
variables. */
if (DECL_INITIAL (decl) && GET_CODE (DECL_RTL (decl)) == MEM)
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
sdbout_toplevel_data (decl);
}
}
/* Output initialized global vars at the end, in the order of
definition. See comment in sdbout_global_decl. */
static void
sdbout_finish (main_filename)
const char *main_filename ATTRIBUTE_UNUSED;
{
tree decl = getdecls ();
unsigned int len = list_length (decl);
tree *vec = (tree *) xmalloc (sizeof (tree) * len);
unsigned int i;
/* Process the decls in reverse order--earliest first. Put them
into VEC from back to front, then take out from front. */
for (i = 0; i < len; i++, decl = TREE_CHAIN (decl))
vec[len - i - 1] = decl;
for (i = 0; i < len; i++)
{
decl = vec[i];
if (TREE_CODE (decl) == VAR_DECL
&& ! DECL_EXTERNAL (decl)
&& DECL_INITIAL (decl)
&& TREE_PUBLIC (decl)
&& DECL_RTL_SET_P (decl))
sdbout_symbol (decl, 0);
}
free (vec);
}
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h. * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
2001-07-19 08:22:04 +02:00
1991-12-23 23:45:25 +01:00
/* Describe the beginning of an internal block within a function.
Also output descriptions of variables defined in this block.
N is the number of the block, by order of beginning, counting from 1,
and not counting the outermost (function top-level) block.
The blocks match the BLOCKs in DECL_INITIAL (current_function_decl),
if the count starts at 0 for the outermost one. */
static void
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
sdbout_begin_block (line, n)
unsigned int line;
unsigned int n;
1991-12-23 23:45:25 +01:00
{
tree decl = current_function_decl;
MAKE_LINE_SAFE (line);
/* The SCO compiler does not emit a separate block for the function level
scope, so we avoid it here also. However, mips ECOFF compilers do emit
a separate block, so we retain it when MIPS_DEBUGGING_INFO is defined. */
#ifndef MIPS_DEBUGGING_INFO
if (n != 1)
#endif
PUT_SDB_BLOCK_START (line - sdb_begin_function_line);
1991-12-23 23:45:25 +01:00
if (n == 1)
{
/* Include the outermost BLOCK's variables in block 1. */
emit-rtl.c (remove_unncessary_notes): Remove notes for empty blocks. * emit-rtl.c (remove_unncessary_notes): Remove notes for empty blocks. * final.c (next_block_index): Remove. (max_block_depth): Likewise. (pending_blocks): Likewise. (init_final): Don't initialize them. (final_start_function): Don't set next_block_index. Set up BLOCK_NUMBER. (final_scan_insn): Use BLOCK_NUMBER, not next_block_index. * function.h (number_blocks): New function. * function.c (get_block_vector): New function. (identify_blocks): Use it. (reorder_blocks): Set NOTE_BLOCK. (number_blocks): New function. * tree.def (BLOCK): Add documentation for TREE_ASM_WRITTEN flag. * tree.h (BLOCK_NUMBER): New macro. (tree_block): Add block_num field. * dbxout.c (next_block_number): Remove. (dbxout_init): Don't set it. (dbxout_block): Only output blocks that have TREE_ASM_WRITTEN set. Use BLOCK_NUMBER, rather than next_block_num, to determine block numbers. * toplev.c (rest_of_compilation): Always call find_loop_tree_blocks. Fix indentation. * dwarf2out.c (next_block_number): Remove. (gen_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, to determine block numbers. (gen_inlined_subroutine_die): Likewise. (gen_block_die): Only output blocks that have TREE_ASM_WRITTEN set. (decls_for_scope): Don't increment next_block_number. * dwarfout.c (next_block_number): Remove. (output_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, to determine block numbers. (output_inlined_subroutine_die): Likewise. (output_block): Only output blocks that have TREE_ASM_WRITTEN set. (output_decls_for_scope): Don't increment next_block_number. * sdbout.c (next_block_number): Remove. (sdbout_block): Use BLOCK_NUMBER. (sdbout_begin_block): Simplify. * xcoffout.c (next_block_number): Remove. (xcoffout_block): Use BLOCK_NUMBER, not next_block_number. (xcoffout_begin_block): Don't set next_block_number. (xcoffout_begin_function): Likewise. Use BLOCK_NUMBER, not next_block_number. From-SVN: r32228
2000-02-28 10:51:42 +01:00
do_block = BLOCK_NUMBER (DECL_INITIAL (decl));
1991-12-23 23:45:25 +01:00
sdbout_block (DECL_INITIAL (decl));
}
/* If -g1, suppress all the internal symbols of functions
except for arguments. */
if (debug_info_level != DINFO_LEVEL_TERSE)
{
do_block = n;
sdbout_block (DECL_INITIAL (decl));
}
#ifdef SDB_ALLOW_FORWARD_REFERENCES
sdbout_dequeue_anonymous_types ();
#endif
}
/* Describe the end line-number of an internal block within a function. */
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void
sdbout_end_block (line, n)
unsigned int line;
unsigned int n ATTRIBUTE_UNUSED;
1991-12-23 23:45:25 +01:00
{
MAKE_LINE_SAFE (line);
/* The SCO compiler does not emit a separate block for the function level
scope, so we avoid it here also. However, mips ECOFF compilers do emit
a separate block, so we retain it when MIPS_DEBUGGING_INFO is defined. */
#ifndef MIPS_DEBUGGING_INFO
if (n != 1)
#endif
1991-12-23 23:45:25 +01:00
PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
}
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
sdbout_source_line (line, filename)
unsigned int line;
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
const char *filename ATTRIBUTE_UNUSED;
{
/* COFF relative line numbers must be positive. */
if ((int) line > sdb_begin_function_line)
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
{
#ifdef ASM_OUTPUT_SOURCE_LINE
ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
#else
fprintf (asm_out_file, "\t.ln\t%d\n",
((sdb_begin_function_line > -1)
? line - sdb_begin_function_line : 1));
#endif
}
}
1991-12-23 23:45:25 +01:00
/* Output sdb info for the current function name.
Called from assemble_start_function. */
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
static void
sdbout_begin_function (decl)
tree decl ATTRIBUTE_UNUSED;
1991-12-23 23:45:25 +01:00
{
sdbout_symbol (current_function_decl, 0);
}
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
/* Called at beginning of function body (before or after prologue,
depending on MIPS_DEBUGGING_INFO). Record the function's starting
line number, so we can output relative line numbers for the other
lines. Describe beginning of outermost block. Also describe the
parameter list. */
1991-12-23 23:45:25 +01:00
dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. * dbxout.c (dbxout_really_begin_function): Rename to dbxout_begin_function. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_begin_function): Remove. (dbxout_function): Update. (dbxout_source_line): Update prototype. * dbxout.h (dbxout_begin_function): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_nothing_tree): Update. (debug_nothing_charstar_rtx): Remove. * debug.h (union tree_node): Declare. (struct rtx_def): Remove. (gcc_debug_hooks): New hooks begin_prologue, end_prologue, begin_function. Change source_line prototype. (debug_nothing_tree): New. (debug_nothing_charstar_rtx): Delete. (dwarf2out_begin_prologue): Moved from ... * tree.h: ... here. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 debug info, call dwarf2out_source_line. (dwarf2out_souce_line): Update prototype. * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. Change prototype, make static. (dwarfout_source_line): Update prototype. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_begin_function): Remove. * final.c (final_start_function, final_scan_insn): Use appropriate debug hooks, update to use notice_source_line. (output_source_line): Rename notice_source_line. Don't call the source_line debug hook. * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, make static, update prototype. (sdbout_mark_begin_function): Rename sdbout_begin_function, update prototype. (sdbout_end_prologue): New. (sdbout_source_line): Update prototype. (sdbout_debug_hooks): Update. (sdbout_symbol): Remove unused var. * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): Delete. * varasm.c: Include debug.h. (assemble_start_function): Use begin_function debug_hook. * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, update with prototype. (xcoffout_source_line): Update prototype. * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, update prototype. (xcoffout_source_line): Update prototype. From-SVN: r44087
2001-07-17 21:47:58 +02:00
#ifndef MIPS_DEBUGGING_INFO
static void
sdbout_begin_prologue (line, file)
unsigned int line;
const char *file ATTRIBUTE_UNUSED;
{
sdbout_end_prologue (line);
}
#endif
static void
sdbout_end_prologue (line)
unsigned int line;
1991-12-23 23:45:25 +01:00
{
sdb_begin_function_line = line - 1;
PUT_SDB_FUNCTION_START (line);
sdbout_parms (DECL_ARGUMENTS (current_function_decl));
sdbout_reg_parms (DECL_ARGUMENTS (current_function_decl));
}
/* Called at end of function (before epilogue).
Describe end of outermost block. */
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void
1991-12-23 23:45:25 +01:00
sdbout_end_function (line)
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
unsigned int line;
1991-12-23 23:45:25 +01:00
{
#ifdef SDB_ALLOW_FORWARD_REFERENCES
sdbout_dequeue_anonymous_types ();
#endif
MAKE_LINE_SAFE (line);
PUT_SDB_FUNCTION_END (line - sdb_begin_function_line);
/* Indicate we are between functions, for line-number output. */
sdb_begin_function_line = -1;
}
/* Output sdb info for the absolute end of a function.
Called after the epilogue is output. */
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
static void
1991-12-23 23:45:25 +01:00
sdbout_end_epilogue ()
{
unicosmk.h (ASM_OUTPUT_DOUBLE, [...]): Fix format specifier warning. * alpha/unicosmk.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Fix format specifier warning. * convex.h (ASM_OUTPUT_BYTE): Likewise. * elfos.h (ALIGN_ASM_OP): Undef before defining. * i386/att.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warning. * i386/bsd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/gas.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386-interix.h (gen_stdcall_suffix): Prototype. * i386.h (ASM_OUTPUT_BYTE): Fix format specifier warning. * i386elf.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE): Likewise. * i386/interix.c (gen_stdcall_suffix): Const-ify. * i386/next.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warnings. * i386/osfrose.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/ptx4-i.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE): Likewise. * i386/sco5.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/sequent.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/sun386.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * i386/svr3dbx.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/3b1.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_FLOAT, ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/altos3068.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/amix.h (ASM_OUTPUT_ASCII, ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/atari.h (ASM_OUTPUT_ASCII, ASM_GENERATE_INTERNAL_LABEL): Likewise. * m68k/crds.h (ASM_OUTPUT_DOUBLE, PRINT_OPERAND): Likewise. * m68k/dpx2.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_BYTE, ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/hp320.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_BYTE): Likewise. * m68k.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE): Likewise. * m68k/m68kv4.h (ASM_OUTPUT_ASCII): Delete unused variable. * m68k/mot3300.h (ASM_OUTPUT_BYTE): Fix format specifier warning. * m68k/news.h (PRINT_OPERAND): Likewise. * m68k/next.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_FLOAT_OPERAND, ASM_OUTPUT_DOUBLE_OPERAND): Likewise. * m68k/next21.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/plexus.h (ASM_SPEC): Insert space between macro name and definition. * m68k/sgs.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ASCII, ASM_OUTPUT_FLOAT_OPERAND, ASM_OUTPUT_DOUBLE_OPERAND): Fix format specifier warnings. * m68k/sun3.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. * m68k/tower-as.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_BYTE, PRINT_OPERAND): Likewise. * m88k/m88k.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE): Likewise. * mips/elf.h (PUT_SDB_SIZE, ASM_DECLARE_OBJECT_NAME): Likewise. * mips/elf64.h (PUT_SDB_SIZE, ASM_DECLARE_OBJECT_NAME): Likewise. * mips/iris5gas.h (PUT_SDB_SIZE): Likewise. * mips/linux.h (ASM_DECLARE_OBJECT_NAME): Likewise. * mips.c (mips_output_external_libcall): Mark parameter with ATTRIBUTE_UNUSED. (mips_asm_file_start): Move variable into the scope where it's used. * mips.h (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise. * mips/netbsd.h (ASM_DECLARE_OBJECT_NAME): Likewise. * mips/sni-gas.h (PUT_SDB_SIZE): Likewise. * ns32k/encore.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * ns32k.c (print_operand): Likewise. * pa.c (print_operand, output_div_insn): Likewise. * pa.h (ASM_OUTPUT_MI_THUNK, ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE, PRINT_OPERAND_ADDRESS): Likewise. * pa/pa64-hpux.h (UNIQUE_SECTION): Const-ify. * sparc/linux.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warnings. * sparc/linux64.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * sparc/pbd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. (ASM_OUTPUT_SOURCE_LINE): Don't list macro arguments in undef. * sparc/vxsim.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warnings. * svr3.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. * sdbout.c (sdbout_end_epilogue): Mark parameter with ATTRIBUTE_UNUSED. * varasm.c (assemble_global): Likewise. From-SVN: r46922
2001-11-11 06:56:47 +01:00
const char *const name ATTRIBUTE_UNUSED
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
#ifdef PUT_SDB_EPILOGUE_END
PUT_SDB_EPILOGUE_END (name);
#else
fprintf (asm_out_file, "\t.def\t");
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "%s\t.val\t.%s\t.scl\t-1%s\t.endef\n",
SDB_DELIM, SDB_DELIM, SDB_DELIM);
#endif
1991-12-23 23:45:25 +01:00
}
/* Output sdb info for the given label. Called only if LABEL_NAME (insn)
is present. */
Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. (toplev.o): Don't depend on xcoffout.h. * c-decl.c: Include debug.h (duplicate_decls): Use debug hook. * dbxout.c (dbxout_source_file, dbxout_args): Make static. (dbx_debug_hooks, xcoff_debug_hooks): Update. (dbxout_types): Remove. * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. * debug.c (do_nothing_debug_hooks): Update. (debug_true_tree, debug_nothing_rtx): New. * debug.h (struct rtx_def): New. (struct gcc_debug_hooks): New hooks ignore_block, outlining_inline_function and label. (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, dwarf2out_frame_finish): New. * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): Make static, update prototype. (dwarf2_debug_hooks): Update. * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, dwarf2out_frame_init, dwarf2out_frame_finish): Remove. * dwarfout.c (dwarf_debug_hooks): Update. * emit-rtl.c: Include debug.h. (remove_unnecessary_notes): Use debug hook. * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. (final_scan_insn): Use debug hook. * integrate.c (output_inline_function): Use debug hook. * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. (sdb_debug_hooks): Update. * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. * toplev.c: Don't include xcoffout.h. (note_outlining_of_inline_function, debug_ignore_block): Remove. * toplev.h (note_outlining_of_inline_function, debug_ignore_block): Remove. * tree.h (dwarf2out_do_frame): Remove. From-SVN: r44163
2001-07-19 23:17:09 +02:00
static void
1991-12-23 23:45:25 +01:00
sdbout_label (insn)
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx insn;
1991-12-23 23:45:25 +01:00
{
PUT_SDB_DEF (LABEL_NAME (insn));
PUT_SDB_VAL (insn);
PUT_SDB_SCL (C_LABEL);
PUT_SDB_TYPE (T_NULL);
PUT_SDB_ENDEF;
}
/* Change to reading from a new source file. */
Makefile.in (c-lex.o): Wrap long lines. * Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug hooks directly. * dbxout.c (dbx_debug_hooks): Add new hooks. (dbxout_start_new_source_file): Rename dbxout_start_source_file, make static. (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, make static. * dbxout.h (dbxout_start_new_source_file, dbxout_resume_previous_source_file): Delete. * debug.c (do_nothing_debug_hooks): Add new hooks. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * debug.h (gcc_debug_hooks): New hooks define, undef, start_source_file and end_source_file. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Make static. * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Remove. * dwarfout.c (dwarf_debug_hooks): Add new hooks. (dwarfout_start_source_file, dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Make static. (dwarfout_start_source_file_check, dwarfout_end_source_file_check): New. (dwarfout_define, dwarfout_finish): Update. * dwarfout.h (dwarfout_start_new_source_file, dwarfout_resume_previous_source_file, dwarfout_define, dwarfout_undef): Remove. * sdbout.c (sdb_debug_hooks): Add new hooks. (sdbout_start_new_source_file): Rename sdbout_start_source_file, make static. (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, make static, take an arg. * sdbout.h (sdbout_start_new_source_file, sdbout_resume_previous_source_file): Delete. * toplev.c (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * toplev.h (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * java/jcf-parse.c: Include debug.h. (parse_class_file): Update to use debug hooks directly. * java/Make-lang.in (jcf-parse.o): Depend on debug.h. From-SVN: r43952
2001-07-11 22:51:46 +02:00
static void
sdbout_start_source_file (line, filename)
unsigned int line ATTRIBUTE_UNUSED;
const char *filename ATTRIBUTE_UNUSED;
{
#ifdef MIPS_DEBUGGING_INFO
struct sdb_file *n = (struct sdb_file *) xmalloc (sizeof *n);
n->next = current_file;
n->name = filename;
current_file = n;
PUT_SDB_SRC_FILE (filename);
#endif
}
/* Revert to reading a previous source file. */
Makefile.in (c-lex.o): Wrap long lines. * Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug hooks directly. * dbxout.c (dbx_debug_hooks): Add new hooks. (dbxout_start_new_source_file): Rename dbxout_start_source_file, make static. (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, make static. * dbxout.h (dbxout_start_new_source_file, dbxout_resume_previous_source_file): Delete. * debug.c (do_nothing_debug_hooks): Add new hooks. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * debug.h (gcc_debug_hooks): New hooks define, undef, start_source_file and end_source_file. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Make static. * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Remove. * dwarfout.c (dwarf_debug_hooks): Add new hooks. (dwarfout_start_source_file, dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Make static. (dwarfout_start_source_file_check, dwarfout_end_source_file_check): New. (dwarfout_define, dwarfout_finish): Update. * dwarfout.h (dwarfout_start_new_source_file, dwarfout_resume_previous_source_file, dwarfout_define, dwarfout_undef): Remove. * sdbout.c (sdb_debug_hooks): Add new hooks. (sdbout_start_new_source_file): Rename sdbout_start_source_file, make static. (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, make static, take an arg. * sdbout.h (sdbout_start_new_source_file, sdbout_resume_previous_source_file): Delete. * toplev.c (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * toplev.h (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * java/jcf-parse.c: Include debug.h. (parse_class_file): Update to use debug hooks directly. * java/Make-lang.in (jcf-parse.o): Depend on debug.h. From-SVN: r43952
2001-07-11 22:51:46 +02:00
static void
sdbout_end_source_file (line)
unsigned int line ATTRIBUTE_UNUSED;
{
#ifdef MIPS_DEBUGGING_INFO
struct sdb_file *next;
next = current_file->next;
free (current_file);
current_file = next;
PUT_SDB_SRC_FILE (current_file->name);
#endif
}
/* Set up for SDB output at the start of compilation. */
static void
dbxout.c (dbxout_source_line): Make static, update prototype. * dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
2001-07-15 10:34:46 +02:00
sdbout_init (input_file_name)
const char *input_file_name ATTRIBUTE_UNUSED;
{
#ifdef MIPS_DEBUGGING_INFO
current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
current_file->next = NULL;
current_file->name = input_file_name;
#endif
#ifdef RMS_QUICK_HACK_1
tree t;
for (t = getdecls (); t; t = TREE_CHAIN (t))
if (DECL_NAME (t) && IDENTIFIER_POINTER (DECL_NAME (t)) != 0
&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__vtbl_ptr_type"))
sdbout_symbol (t, 0);
#endif
#ifdef SDB_ALLOW_FORWARD_REFERENCES
ggc_add_tree_root (&anonymous_types, 1);
#endif
}
1991-12-23 23:45:25 +01:00
#endif /* SDB_DEBUGGING_INFO */