1991-12-23 23:45:25 +01:00
|
|
|
|
/* Output sdb-format symbol table information from GNU compiler.
|
c-common.c (decl_attributes): Set DECL_SIZE_UNIT.
* c-common.c (decl_attributes): Set DECL_SIZE_UNIT.
* c-decl.c (duplicate_decls, finish_enum): Likewise.
(finish_decl): Remove -Wlarger-than code from here.
* flags.h (id_clash_len): Now int.
(larger_than_size): Now HOST_WIDE_INT.
* fold-const.c (size_int_wide): No more HIGH parm; NUMBER is signed.
Clean up checking to see if in table.
(make_bit_field_ref): Remove extra parm to bitsize_int.
* ggc-common.c (ggc_mark_tree_children): Mark DECL_SIZE_UNIT.
* print-tree.c (print_node): Print DECL_SIZE_UNIT and TYPE_SIZE_UNIT.
* stmt.c (expand_decl): Use DECL_SIZE_UNIT for stack checking size
and for computing size of decl.
* stor-layout.c (layout_decl): Set DECL_SIZE_UNIT.
Move -Wlarger-than code to here.
(layout_record): Remove extra arg to bitsize_int.
Set TYPE_BINFO_SIZE_UNIT.
(layout_union): Remove extra arg to bitsize_int.
Use proper type for size of QUAL_UNION.
(layout_type): Remove extra arg to bitsize_int.
* toplev.c (id_clash_len): Now int.
(larger_than_size): Now HOST_WIDE_INT.
(decode_W_option): Clean up id-clash and larger-than- cases.
* tree.c (get_identifier, maybe_get_identifier): Remove unneeded casts.
(expr_align, case FUNCTION_DECL): DECL_ALIGN is not defined.
* tree.h (BINFO_SIZE_UNIT, TYPE_BINFO_SIZE_UNIT, DECL_SIZE_UNIT): New.
(struct tree_decl): New field size_unit.
(size_int_wide): No HIGH operand; NUMBER is now signed.
(size_int_2): Deleted.
(size_int, bitsize_int): Don't use it and rework args.
* varasm.c (assemble_variable, output_constructor): Use DECL_SIZE_UNIT.
* ch/decl.c (layout_enum): Set DECL_SIZE_UNIT.
* ch/satisfy.c (safe_satisfy_decl): Likewise.
* cp/class.c (build_primary_vtable, layout_vtable_decl): Likewise.
(avoid_overlap, build_base_field): Likewise.
(build_base_field, build_base_fields, is_empty_class):
Test DECL_SIZE with integer_zero.
(layout_class_type): Set CLASSTYPE_SIZE_UNIT.
* cp/cp-tree.h (struct lang_type): New field size_unit.
(CLASSTYPE_SIZE_UNIT): New macro.
* cp/decl.c (init_decl_processing): Set DECL_SIZE_UNIT.
(cp_finish_decl): Delete -Wlarger-than processing.
* cp/optimize.c (remap_decl): Walk DECL_SIZE_UNIT.
* cp/pt.c (tsubst_decl): Set DECL_SIZE_UNIT.
* cp/tree.c (make_binfo): binfo vector is one entry longer.
(walk_tree): Walk DECL_SIZE_UNIT.
* f/com.c (ffecom_sym_transform): Use DECL_SIZE_UNIT.
(ffecom_transform_common_, ffecom_transform_equiv_): Likewise.
(duplicate_decls): Likewise.
(ffecom_tree_canonize_ptr_): Delete extra arg to bitsize_int.
(finish_decl): Delete -Wlarger-than processing.
* java/class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
* java/constants.c (build_constants_constructor): Likewise.
From-SVN: r32068
2000-02-20 02:11:00 +01:00
|
|
|
|
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
|
|
|
|
Free Software Foundation, Inc.
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
1995-06-15 14:29:51 +02:00
|
|
|
|
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
|
1992-05-07 08:41:23 +02:00
|
|
|
|
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"
|
1996-10-09 13:00:20 +02:00
|
|
|
|
#include "defaults.h"
|
1991-12-23 23:45:25 +01:00
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "insn-config.h"
|
|
|
|
|
#include "reload.h"
|
1998-06-22 07:32:38 +02:00
|
|
|
|
#include "output.h"
|
|
|
|
|
#include "toplev.h"
|
2000-01-11 23:57:39 +01:00
|
|
|
|
#include "tm_p.h"
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
1996-06-08 02:12:38 +02:00
|
|
|
|
/* Mips systems use the SDB functions to dump out symbols, but do not
|
|
|
|
|
supply usable syms.h include files. Which syms.h file to use is a
|
|
|
|
|
target parameter so don't use the native one if we're cross compiling. */
|
|
|
|
|
|
1999-03-23 00:23:26 +01:00
|
|
|
|
#if defined(USG) && !defined(MIPS) && !defined (hpux) && !defined(_WIN32) && !defined(__linux__) && !defined(__INTERIX) && !defined(CROSS_COMPILE)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
#include <syms.h>
|
|
|
|
|
/* Use T_INT if we don't have T_VOID. */
|
|
|
|
|
#ifndef T_VOID
|
|
|
|
|
#define T_VOID T_INT
|
|
|
|
|
#endif
|
1996-06-08 02:12:38 +02:00
|
|
|
|
#else
|
1991-12-23 23:45:25 +01:00
|
|
|
|
#include "gsyms.h"
|
1996-06-08 02:12:38 +02:00
|
|
|
|
#endif
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
|
|
|
|
/* #include <storclass.h> used to be this instead of syms.h. */
|
|
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
|
dwarfout.h, [...]: New files.
* dwarfout.h, dwarf2out.h, dbxout.h, sdbout.h: New files.
Prototypes for externally used functions in respective C files.
* dwarfout.c, dbxout.c, dwarf2out.c, sdbout.c, toplev,c,
final.c: Include above files.
* Makefile.in (toplev.o): Add dependency for above four headers.
(final.o): Likewise.
(dwarfout.o, dbxout.o, dwarf2out.o, sdbout.o): Depend on four
respective header files.
From-SVN: r19835
1998-05-18 09:11:42 +02:00
|
|
|
|
#include "sdbout.h"
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
2000-01-17 16:47:29 +01:00
|
|
|
|
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));
|
2000-01-11 00:48:03 +01:00
|
|
|
|
#ifdef SDB_ALLOW_FORWARD_REFERENCES
|
2000-01-17 16:47:29 +01:00
|
|
|
|
static void sdbout_queue_anonymous_type PARAMS ((tree));
|
|
|
|
|
static void sdbout_dequeue_anonymous_types PARAMS ((void));
|
2000-01-11 00:48:03 +01:00
|
|
|
|
#endif
|
2000-01-17 16:47:29 +01:00
|
|
|
|
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));
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
|
|
|
|
/* Define the default sizes for various types. */
|
|
|
|
|
|
|
|
|
|
#ifndef CHAR_TYPE_SIZE
|
|
|
|
|
#define CHAR_TYPE_SIZE BITS_PER_UNIT
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SHORT_TYPE_SIZE
|
|
|
|
|
#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef INT_TYPE_SIZE
|
|
|
|
|
#define INT_TYPE_SIZE BITS_PER_WORD
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef LONG_TYPE_SIZE
|
|
|
|
|
#define LONG_TYPE_SIZE BITS_PER_WORD
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef LONG_LONG_TYPE_SIZE
|
|
|
|
|
#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef FLOAT_TYPE_SIZE
|
|
|
|
|
#define FLOAT_TYPE_SIZE BITS_PER_WORD
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef DOUBLE_TYPE_SIZE
|
|
|
|
|
#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef LONG_DOUBLE_TYPE_SIZE
|
|
|
|
|
#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* 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
|
1998-06-22 07:32:38 +02:00
|
|
|
|
#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"); \
|
|
|
|
|
ASM_OUTPUT_LABELREF (asm_out_file, a); \
|
|
|
|
|
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
|
1998-06-22 07:32:38 +02:00
|
|
|
|
#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"); \
|
|
|
|
|
ASM_OUTPUT_LABELREF (asm_out_file, a); \
|
|
|
|
|
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 PUT_SDB_EPILOGUE_END
|
|
|
|
|
#define PUT_SDB_EPILOGUE_END(NAME) \
|
|
|
|
|
do { fprintf (asm_out_file, "\t.def\t"); \
|
|
|
|
|
ASM_OUTPUT_LABELREF (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); } while (0)
|
|
|
|
|
#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. */
|
|
|
|
|
|
1993-10-12 22:06:37 +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) \
|
1993-10-12 22:06:37 +01:00
|
|
|
|
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 (line <= sdb_begin_function_line) line = sdb_begin_function_line + 1
|
1996-11-15 23:37:40 +01:00
|
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
/* Set up for SDB output at the start of compilation. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_init (asm_file, input_file_name, syms)
|
2000-01-09 15:23:35 +01:00
|
|
|
|
FILE *asm_file ATTRIBUTE_UNUSED;
|
2000-01-11 00:48:03 +01:00
|
|
|
|
char *input_file_name ATTRIBUTE_UNUSED;
|
1999-03-19 09:50:14 +01:00
|
|
|
|
tree syms ATTRIBUTE_UNUSED;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
{
|
1996-11-15 23:37:40 +01:00
|
|
|
|
#ifdef MIPS_DEBUGGING_INFO
|
|
|
|
|
current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
|
|
|
|
|
current_file->next = NULL;
|
|
|
|
|
current_file->name = input_file_name;
|
|
|
|
|
#endif
|
|
|
|
|
|
1993-11-08 23:57:28 +01:00
|
|
|
|
#ifdef RMS_QUICK_HACK_1
|
|
|
|
|
tree t;
|
|
|
|
|
for (t = syms; 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
|
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))
|
1993-10-12 22:06:37 +01:00
|
|
|
|
return TYPE_SYMTAB_ADDRESS (type);
|
1991-12-23 23:45:25 +01:00
|
|
|
|
if (link && TREE_PURPOSE (link)
|
|
|
|
|
&& IDENTIFIER_POINTER (TREE_PURPOSE (link)))
|
1993-10-12 22:06:37 +01:00
|
|
|
|
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. */
|
1993-03-09 01:10:48 +01:00
|
|
|
|
#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;
|
|
|
|
|
{
|
1995-05-04 20:14:53 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
1992-11-24 06:18:35 +01:00
|
|
|
|
static int
|
|
|
|
|
template_name_p (name)
|
|
|
|
|
tree name;
|
|
|
|
|
{
|
|
|
|
|
register 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;
|
|
|
|
|
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)
|
1995-04-12 20:35:15 +02:00
|
|
|
|
t = TYPE_NAME (type);
|
1995-03-10 20:37:52 +01:00
|
|
|
|
else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
{
|
|
|
|
|
t = DECL_NAME (TYPE_NAME (type));
|
1992-11-24 06:18:35 +01:00
|
|
|
|
/* 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. */
|
1992-11-24 06:18:35 +01:00
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
1995-05-04 20:14:53 +02:00
|
|
|
|
/* 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
|
1995-05-04 20:14:53 +02:00
|
|
|
|
plain_type_1 (type, level)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
tree type;
|
1995-05-04 20:14:53 +02:00
|
|
|
|
int level;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
{
|
|
|
|
|
if (type == 0)
|
|
|
|
|
type = void_type_node;
|
1995-05-04 20:14:53 +02:00
|
|
|
|
else if (type == error_mark_node)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
type = integer_type_node;
|
1995-05-04 20:14:53 +02:00
|
|
|
|
else
|
|
|
|
|
type = TYPE_MAIN_VARIANT (type);
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
|
|
|
|
switch (TREE_CODE (type))
|
|
|
|
|
{
|
|
|
|
|
case VOID_TYPE:
|
|
|
|
|
return T_VOID;
|
1999-03-11 00:30:08 +01:00
|
|
|
|
case BOOLEAN_TYPE:
|
1991-12-23 23:45:25 +01:00
|
|
|
|
case INTEGER_TYPE:
|
|
|
|
|
{
|
|
|
|
|
int size = int_size_in_bytes (type) * BITS_PER_UNIT;
|
1993-01-02 01:39:33 +01:00
|
|
|
|
|
|
|
|
|
/* 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)
|
|
|
|
|
{
|
|
|
|
|
char *name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
|
|
|
|
|
|
1998-01-14 21:57:58 +01:00
|
|
|
|
if (!strcmp (name, "char"))
|
|
|
|
|
return T_CHAR;
|
1993-01-02 01:39:33 +01:00
|
|
|
|
if (!strcmp (name, "unsigned char"))
|
|
|
|
|
return T_UCHAR;
|
|
|
|
|
if (!strcmp (name, "signed char"))
|
|
|
|
|
return T_CHAR;
|
1998-01-14 21:57:58 +01:00
|
|
|
|
if (!strcmp (name, "int"))
|
|
|
|
|
return T_INT;
|
1993-01-02 01:39:33 +01:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
1998-01-14 21:57:58 +01:00
|
|
|
|
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);
|
1992-11-10 22:27:39 +01:00
|
|
|
|
if (size == LONG_TYPE_SIZE)
|
|
|
|
|
return (TREE_UNSIGNED (type) ? T_ULONG : T_LONG);
|
1995-01-14 02:40:18 +01:00
|
|
|
|
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:
|
|
|
|
|
{
|
1996-06-08 02:12:38 +02:00
|
|
|
|
int precision = TYPE_PRECISION (type);
|
|
|
|
|
if (precision == FLOAT_TYPE_SIZE)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
return T_FLOAT;
|
1996-06-08 02:12:38 +02:00
|
|
|
|
if (precision == DOUBLE_TYPE_SIZE)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
return T_DOUBLE;
|
1996-06-08 02:12:38 +02:00
|
|
|
|
#ifdef EXTENDED_SDB_BASIC_TYPES
|
|
|
|
|
if (precision == LONG_DOUBLE_TYPE_SIZE)
|
|
|
|
|
return T_LNGDBL;
|
1998-04-04 15:32:39 +02:00
|
|
|
|
#else
|
|
|
|
|
if (precision == LONG_DOUBLE_TYPE_SIZE)
|
|
|
|
|
return T_DOUBLE; /* better than nothing */
|
1996-06-08 02:12:38 +02:00
|
|
|
|
#endif
|
1991-12-23 23:45:25 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case ARRAY_TYPE:
|
|
|
|
|
{
|
|
|
|
|
int m;
|
1995-05-04 20:14:53 +02:00
|
|
|
|
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:
|
1993-04-13 12:47:33 +02:00
|
|
|
|
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
|
1993-04-13 12:47:33 +02:00
|
|
|
|
: (TREE_CODE (type) == QUAL_UNION_TYPE) ? T_UNION
|
1991-12-23 23:45:25 +01:00
|
|
|
|
: T_ENUM);
|
|
|
|
|
}
|
|
|
|
|
case POINTER_TYPE:
|
|
|
|
|
case REFERENCE_TYPE:
|
|
|
|
|
{
|
1995-05-04 20:14:53 +02:00
|
|
|
|
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:
|
|
|
|
|
{
|
1995-05-04 20:14:53 +02:00
|
|
|
|
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)
|
|
|
|
|
register tree block;
|
|
|
|
|
{
|
|
|
|
|
while (block)
|
|
|
|
|
{
|
|
|
|
|
/* Ignore blocks never expanded or otherwise marked as real. */
|
|
|
|
|
if (TREE_USED (block))
|
|
|
|
|
{
|
|
|
|
|
/* When we reach the specified block, output its symbols. */
|
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. */
|
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)
|
|
|
|
|
{
|
1992-03-11 05:52:53 +01:00
|
|
|
|
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;
|
|
|
|
|
char *name;
|
|
|
|
|
|
1992-05-31 07:03:41 +02:00
|
|
|
|
sdbout_one_type (type);
|
|
|
|
|
|
|
|
|
|
#if 0 /* This loses when functions are marked to be ignored,
|
|
|
|
|
which happens in the C++ front end. */
|
1992-05-27 23:54:51 +02:00
|
|
|
|
if (DECL_IGNORED_P (decl))
|
|
|
|
|
return;
|
1992-05-31 07:03:41 +02:00
|
|
|
|
#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;
|
1995-12-19 01:08:11 +01:00
|
|
|
|
/* 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;
|
1992-05-31 07:03:41 +02:00
|
|
|
|
if (DECL_IGNORED_P (decl))
|
|
|
|
|
return;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
|
|
|
|
|
/* Output typedef name. */
|
1992-11-24 06:18:35 +01:00
|
|
|
|
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. */
|
1992-07-12 04:43:19 +02:00
|
|
|
|
if (DECL_EXTERNAL (decl))
|
1991-12-23 23:45:25 +01:00
|
|
|
|
return;
|
|
|
|
|
|
1992-05-31 07:03:41 +02:00
|
|
|
|
/* 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 (decl) == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
reload.h, [...]: Revert March 15 change.
* reload.h, reload1.c (eliminate_regs), caller-save.c, dbxout.c,
dwarfout.c, dwarf2out.c, reload.c, sdbout.c: Revert March 15 change.
* reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
SUBREG_REG if the word count is unchanged.
* reload1.c (eliminate_regs) [case SET]: If W_R_O, preserve
subregs of identical word size for push_reload.
From-SVN: r17105
1997-12-15 18:55:58 +01:00
|
|
|
|
DECL_RTL (decl) = eliminate_regs (DECL_RTL (decl), 0, NULL_RTX);
|
1992-06-30 03:12:43 +02:00
|
|
|
|
#ifdef LEAF_REG_REMAP
|
1999-04-18 15:09:37 +02:00
|
|
|
|
if (current_function_uses_only_leaf_regs)
|
1992-06-30 03:12:43 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
1992-06-30 03:12:43 +02:00
|
|
|
|
else if (GET_CODE (value) == SUBREG)
|
1991-12-23 23:45:25 +01:00
|
|
|
|
{
|
|
|
|
|
int offset = 0;
|
|
|
|
|
while (GET_CODE (value) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
offset += SUBREG_WORD (value);
|
|
|
|
|
value = SUBREG_REG (value);
|
|
|
|
|
}
|
|
|
|
|
if (GET_CODE (value) == REG)
|
|
|
|
|
{
|
|
|
|
|
regno = REGNO (value);
|
|
|
|
|
if (regno >= FIRST_PSEUDO_REGISTER)
|
1992-06-30 03:12:43 +02:00
|
|
|
|
return;
|
|
|
|
|
regno += offset;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
}
|
1992-06-30 03:12:43 +02:00
|
|
|
|
alter_subreg (DECL_RTL (decl));
|
|
|
|
|
value = DECL_RTL (decl);
|
1991-12-23 23:45:25 +01:00
|
|
|
|
}
|
1993-11-16 11:22:29 +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
|
1993-04-13 12:47:33 +02:00
|
|
|
|
|| 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;
|
|
|
|
|
|
1992-10-24 02:19:09 +01:00
|
|
|
|
/* 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. */
|
1995-04-12 20:35:15 +02:00
|
|
|
|
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
|
1993-09-24 21:55:19 +02:00
|
|
|
|
&& REGNO (XEXP (value, 0)) != HARD_FRAME_POINTER_REGNUM
|
1992-03-11 05:52:53 +01:00
|
|
|
|
&& 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);
|
|
|
|
|
}
|
|
|
|
|
|
1999-03-28 01:50:47 +01:00
|
|
|
|
/* 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
|
1994-01-04 19:43:51 +01:00
|
|
|
|
&& ((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
|
|
|
|
{
|
1994-01-04 19:43:51 +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);
|
|
|
|
|
}
|
1992-03-11 05:52:53 +01:00
|
|
|
|
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;
|
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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_toplevel_data (decl)
|
|
|
|
|
tree decl;
|
|
|
|
|
{
|
|
|
|
|
tree type = TREE_TYPE (decl);
|
|
|
|
|
|
1992-05-27 23:54:51 +02:00
|
|
|
|
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;
|
|
|
|
|
{
|
|
|
|
|
anonymous_types = saveable_tree_cons (NULL_TREE, type, anonymous_types);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
sdbout_dequeue_anonymous_types ()
|
|
|
|
|
{
|
|
|
|
|
register tree types, link;
|
|
|
|
|
|
|
|
|
|
while (anonymous_types)
|
|
|
|
|
{
|
|
|
|
|
types = nreverse (anonymous_types);
|
|
|
|
|
anonymous_types = NULL_TREE;
|
|
|
|
|
|
|
|
|
|
for (link = types; link; link = TREE_CHAIN (link))
|
|
|
|
|
{
|
|
|
|
|
register tree type = TREE_VALUE (link);
|
|
|
|
|
|
1992-03-22 00:23:49 +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)
|
|
|
|
|
register tree types;
|
|
|
|
|
{
|
|
|
|
|
register tree link;
|
|
|
|
|
|
|
|
|
|
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;
|
1998-04-04 15:32:39 +02:00
|
|
|
|
|
1991-12-23 23:45:25 +01:00
|
|
|
|
for (tail = TYPE_FIELDS (type); tail; tail = TREE_CHAIN (tail))
|
1998-09-24 20:54:38 +02:00
|
|
|
|
/* This condition should match the one for emitting the actual members
|
|
|
|
|
below. */
|
|
|
|
|
if (TREE_CODE (tail) == FIELD_DECL
|
|
|
|
|
&& DECL_NAME (tail) != 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
|
|
|
|
&& ! host_integerp (DECL_SIZE (tail), 1)
|
|
|
|
|
&& ! host_integerp (bit_position (tail), 0))
|
1998-09-24 20:54:38 +02:00
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
{
|
1995-05-02 01:50:11 +02:00
|
|
|
|
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:
|
1993-04-13 12:47:33 +02:00
|
|
|
|
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);
|
2000-01-04 17:29:41 +01:00
|
|
|
|
int member_scl = 0;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
tree tem;
|
1992-03-11 05:52:53 +01:00
|
|
|
|
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:
|
1993-04-13 12:47:33 +02:00
|
|
|
|
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;
|
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;
|
|
|
|
|
|
1992-03-11 05:52:53 +01:00
|
|
|
|
/* Print out the base class information with fields
|
|
|
|
|
named after the types they hold. */
|
1998-09-25 16:37:13 +02:00
|
|
|
|
/* This is only relevent 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)
|
1992-03-11 05:52:53 +01:00
|
|
|
|
{
|
1998-09-25 16:37:13 +02:00
|
|
|
|
if (TYPE_BINFO (type)
|
|
|
|
|
&& TYPE_BINFO_BASETYPES (type))
|
|
|
|
|
n_baseclasses = TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type));
|
|
|
|
|
for (i = 0; i < n_baseclasses; i++)
|
1994-06-18 22:48:02 +02:00
|
|
|
|
{
|
1998-09-25 16:37:13 +02:00
|
|
|
|
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));
|
1998-09-25 16:37:13 +02:00
|
|
|
|
PUT_SDB_SCL (member_scl);
|
|
|
|
|
sdbout_type (BINFO_TYPE (child));
|
|
|
|
|
PUT_SDB_ENDEF;
|
1994-06-18 22:48:02 +02:00
|
|
|
|
}
|
1992-03-11 05:52:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
1991-12-23 23:45:25 +01:00
|
|
|
|
/* output the individual fields */
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (type) == ENUMERAL_TYPE)
|
2000-03-21 00:42:47 +01:00
|
|
|
|
{
|
|
|
|
|
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) != 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
|
|
|
|
&& host_integerp (DECL_SIZE (tem), 1)
|
|
|
|
|
&& host_integerp (bit_position (tem), 0))
|
1991-12-23 23:45:25 +01:00
|
|
|
|
{
|
1994-06-18 22:42:18 +02:00
|
|
|
|
char *name;
|
|
|
|
|
|
1991-12-23 23:45:25 +01:00
|
|
|
|
CONTIN;
|
1995-04-12 20:35:15 +02:00
|
|
|
|
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (tem));
|
1994-06-18 22:42:18 +02:00
|
|
|
|
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;
|
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;
|
|
|
|
|
char *name = IDENTIFIER_POINTER (DECL_NAME (parms));
|
|
|
|
|
|
|
|
|
|
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. */
|
1997-05-07 01:05:54 +02:00
|
|
|
|
DECL_INCOMING_RTL (parms)
|
reload.h, [...]: Revert March 15 change.
* reload.h, reload1.c (eliminate_regs), caller-save.c, dbxout.c,
dwarfout.c, dwarf2out.c, reload.c, sdbout.c: Revert March 15 change.
* reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
SUBREG_REG if the word count is unchanged.
* reload1.c (eliminate_regs) [case SET]: If W_R_O, preserve
subregs of identical word size for push_reload.
From-SVN: r17105
1997-12-15 18:55:58 +01:00
|
|
|
|
= eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
|
|
|
|
|
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. */
|
1994-11-16 22:10:09 +01:00
|
|
|
|
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))));
|
1994-11-16 22:10:09 +01:00
|
|
|
|
|
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);
|
1996-05-19 18:25:37 +02:00
|
|
|
|
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);
|
1996-05-19 18:25:37 +02:00
|
|
|
|
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))
|
|
|
|
|
{
|
|
|
|
|
char *name = IDENTIFIER_POINTER (DECL_NAME (parms));
|
|
|
|
|
|
|
|
|
|
/* 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);
|
1996-05-19 18:25:37 +02:00
|
|
|
|
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. */
|
1994-11-16 22:10:09 +01:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_begin_block (file, line, n)
|
2000-01-09 15:23:35 +01:00
|
|
|
|
FILE *file ATTRIBUTE_UNUSED;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
int line;
|
|
|
|
|
int n;
|
|
|
|
|
{
|
|
|
|
|
tree decl = current_function_decl;
|
|
|
|
|
MAKE_LINE_SAFE (line);
|
1994-04-04 23:39:19 +02:00
|
|
|
|
|
|
|
|
|
/* 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. */
|
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. */
|
|
|
|
|
|
|
|
|
|
void
|
1994-04-04 23:39:19 +02:00
|
|
|
|
sdbout_end_block (file, line, n)
|
2000-01-09 15:23:35 +01:00
|
|
|
|
FILE *file ATTRIBUTE_UNUSED;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
int line;
|
1999-03-19 09:50:14 +01:00
|
|
|
|
int n ATTRIBUTE_UNUSED;
|
1991-12-23 23:45:25 +01:00
|
|
|
|
{
|
|
|
|
|
MAKE_LINE_SAFE (line);
|
1994-04-04 23:39:19 +02:00
|
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Output sdb info for the current function name.
|
|
|
|
|
Called from assemble_start_function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_mark_begin_function ()
|
|
|
|
|
{
|
|
|
|
|
sdbout_symbol (current_function_decl, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Called at beginning of function body (after prologue).
|
|
|
|
|
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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_begin_function (line)
|
|
|
|
|
int line;
|
|
|
|
|
{
|
|
|
|
|
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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_end_function (line)
|
|
|
|
|
int line;
|
|
|
|
|
{
|
|
|
|
|
#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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_end_epilogue ()
|
|
|
|
|
{
|
|
|
|
|
char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
|
|
|
|
|
PUT_SDB_EPILOGUE_END (name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Output sdb info for the given label. Called only if LABEL_NAME (insn)
|
|
|
|
|
is present. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_label (insn)
|
|
|
|
|
register rtx insn;
|
|
|
|
|
{
|
|
|
|
|
PUT_SDB_DEF (LABEL_NAME (insn));
|
|
|
|
|
PUT_SDB_VAL (insn);
|
|
|
|
|
PUT_SDB_SCL (C_LABEL);
|
|
|
|
|
PUT_SDB_TYPE (T_NULL);
|
|
|
|
|
PUT_SDB_ENDEF;
|
|
|
|
|
}
|
|
|
|
|
|
1996-11-15 23:37:40 +01:00
|
|
|
|
/* Change to reading from a new source file. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_start_new_source_file (filename)
|
2000-01-11 00:48:03 +01:00
|
|
|
|
char *filename ATTRIBUTE_UNUSED;
|
1996-11-15 23:37:40 +01:00
|
|
|
|
{
|
|
|
|
|
#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. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sdbout_resume_previous_source_file ()
|
|
|
|
|
{
|
|
|
|
|
#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
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-23 23:45:25 +01:00
|
|
|
|
#endif /* SDB_DEBUGGING_INFO */
|