aboutsummaryrefslogtreecommitdiff
path: root/gcc/dbxout.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-03-17 17:31:58 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-03-17 12:31:58 -0500
commit665f250366b2cd1528c32b0d7d2fea6aae006e85 (patch)
tree0d31e5a8b4d8432cfb9d20e84ce3b4a97056fdf0 /gcc/dbxout.c
parent63f034bfe3afe558171d79c95166e3e86ee2c515 (diff)
downloadgcc-665f250366b2cd1528c32b0d7d2fea6aae006e85.zip
gcc-665f250366b2cd1528c32b0d7d2fea6aae006e85.tar.gz
gcc-665f250366b2cd1528c32b0d7d2fea6aae006e85.tar.bz2
* 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
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r--gcc/dbxout.c91
1 files changed, 48 insertions, 43 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index b97be4d..2d43dbb 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -623,29 +623,28 @@ dbxout_type_fields (type)
tree type;
{
tree tem;
+
/* Output the name, type, position (in bits), size (in bits) of each
- field. */
+ field that we can support. */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
{
/* Omit here local type decls until we know how to support them. */
- if (TREE_CODE (tem) == TYPE_DECL)
- continue;
- /* Omit fields whose position or size are variable. */
- else if (TREE_CODE (tem) == FIELD_DECL
- && (TREE_CODE (DECL_FIELD_BITPOS (tem)) != INTEGER_CST
- || TREE_CODE (DECL_SIZE (tem)) != INTEGER_CST))
- continue;
- /* Omit here the nameless fields that are used to skip bits. */
- else if (DECL_IGNORED_P (tem))
+ if (TREE_CODE (tem) == TYPE_DECL
+ /* Omit fields whose position or size are variable or too large to
+ represent. */
+ || (TREE_CODE (tem) == FIELD_DECL
+ && (! host_integerp (bit_position (tem), 0)
+ || ! host_integerp (DECL_SIZE (tem), 1)))
+ /* Omit here the nameless fields that are used to skip bits. */
+ || DECL_IGNORED_P (tem))
continue;
+
else if (TREE_CODE (tem) != CONST_DECL)
{
/* Continue the line if necessary,
but not before the first field. */
if (tem != TYPE_FIELDS (type))
- {
- CONTIN;
- }
+ CONTIN;
if (use_gnu_debug_info_extensions
&& flag_minimal_debug
@@ -661,7 +660,7 @@ dbxout_type_fields (type)
dbxout_type (TREE_TYPE (tem), 0, 0);
fputc (',', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (DECL_FIELD_BITPOS (tem)));
+ int_bit_position (tem));
fputc (';', asmfile);
continue;
}
@@ -691,8 +690,7 @@ dbxout_type_fields (type)
dbxout_type ((TREE_CODE (tem) == FIELD_DECL
&& DECL_BIT_FIELD_TYPE (tem))
- ? DECL_BIT_FIELD_TYPE (tem)
- : TREE_TYPE (tem), 0, 0);
+ ? DECL_BIT_FIELD_TYPE (tem) : TREE_TYPE (tem), 0, 0);
if (TREE_CODE (tem) == VAR_DECL)
{
@@ -705,22 +703,20 @@ dbxout_type_fields (type)
CHARS (strlen (name));
}
else
- {
- /* If TEM is non-static, GDB won't understand it. */
- fprintf (asmfile, ",0,0;");
- }
+ /* If TEM is non-static, GDB won't understand it. */
+ fprintf (asmfile, ",0,0;");
}
- else if (TREE_CODE (DECL_FIELD_BITPOS (tem)) == INTEGER_CST)
+ else
{
fputc (',', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (DECL_FIELD_BITPOS (tem)));
+ int_bit_position (tem));
fputc (',', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (DECL_SIZE (tem)));
+ tree_low_cst (DECL_SIZE (tem), 1));
fputc (';', asmfile);
+ CHARS (23);
}
- CHARS (23);
}
}
}
@@ -758,13 +754,15 @@ dbxout_type_method_1 (decl, debug_name)
}
fprintf (asmfile, ":%s;%c%c%c", debug_name,
- TREE_PRIVATE (decl) ? '0' : TREE_PROTECTED (decl) ? '1' : '2', c1, c2);
+ TREE_PRIVATE (decl) ? '0'
+ : TREE_PROTECTED (decl) ? '1' : '2', c1, c2);
CHARS (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (decl)) + 6
- (debug_name - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))));
- if (DECL_VINDEX (decl))
+
+ if (DECL_VINDEX (decl) && host_integerp (DECL_VINDEX (decl), 0))
{
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (DECL_VINDEX (decl)));
+ tree_low_cst (DECL_VINDEX (decl), 0));
fputc (';', asmfile);
dbxout_type (DECL_CONTEXT (decl), 0, 0);
fprintf (asmfile, ";");
@@ -959,20 +957,23 @@ dbxout_range_type (type)
else
dbxout_type_index (integer_type_node);
}
- if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
+
+ if (TYPE_MIN_VALUE (type) != 0
+ && host_integerp (TYPE_MIN_VALUE (type), 0))
{
fputc (';', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (TYPE_MIN_VALUE (type)));
+ tree_low_cst (TYPE_MIN_VALUE (type), 0));
}
else
fprintf (asmfile, ";0");
- if (TYPE_MAX_VALUE (type)
- && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST)
+
+ if (TYPE_MAX_VALUE (type) != 0
+ && host_integerp (TYPE_MAX_VALUE (type), 0))
{
fputc (';', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (TYPE_MAX_VALUE (type)));
+ tree_low_cst (TYPE_MAX_VALUE (type), 0));
fputc (';', asmfile);
}
else
@@ -1407,17 +1408,15 @@ dbxout_type (type, full, show_arg_types)
for (i = 0; i < n_baseclasses; i++)
{
tree child = TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (type)), i);
+
if (use_gnu_debug_info_extensions)
{
have_used_extensions = 1;
- putc (TREE_VIA_VIRTUAL (child) ? '1'
- : '0',
- asmfile);
- putc (TREE_VIA_PUBLIC (child) ? '2'
- : '0',
- asmfile);
+ putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
+ putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (BINFO_OFFSET (child)) * BITS_PER_UNIT);
+ (tree_low_cst (BINFO_OFFSET (child), 0)
+ * BITS_PER_UNIT));
fputc (',', asmfile);
CHARS (15);
dbxout_type (BINFO_TYPE (child), 0, 0);
@@ -1432,10 +1431,13 @@ dbxout_type (type, full, show_arg_types)
dbxout_type (BINFO_TYPE (child), full, 0);
fputc (',', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (BINFO_OFFSET (child)) * BITS_PER_UNIT);
+ tree_low_cst (BINFO_OFFSET (child), 0)
+ * BITS_PER_UNIT);
fputc (',', asmfile);
fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (DECL_SIZE (TYPE_NAME (BINFO_TYPE (child)))) * BITS_PER_UNIT);
+ (tree_low_cst (DECL_SIZE (TYPE_NAME
+ (BINFO_TYPE (child))), 0)
+ * BITS_PER_UNIT));
fputc (';', asmfile);
CHARS (20);
}
@@ -1451,6 +1453,7 @@ dbxout_type (type, full, show_arg_types)
have_used_extensions = 1;
dbxout_type_methods (type);
}
+
putc (';', asmfile);
if (use_gnu_debug_info_extensions && TREE_CODE (type) == RECORD_TYPE
@@ -1615,7 +1618,7 @@ print_int_cst_octal (c)
unsigned HOST_WIDE_INT high = TREE_INT_CST_HIGH (c);
unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (c);
int excess = (3 - (HOST_BITS_PER_WIDE_INT % 3));
- int width = TYPE_PRECISION (TREE_TYPE (c));
+ unsigned int width = TYPE_PRECISION (TREE_TYPE (c));
/* GDB wants constants with no extra leading "1" bits, so
we need to remove any sign-extension that might be
@@ -1928,6 +1931,7 @@ dbxout_symbol (decl, local)
and not written in memory, inform the debugger. */
if (TREE_STATIC (decl) && TREE_READONLY (decl)
&& DECL_INITIAL (decl) != 0
+ && host_integerp (DECL_INITIAL (decl), 0)
&& ! TREE_ASM_WRITTEN (decl)
&& (DECL_FIELD_CONTEXT (decl) == NULL_TREE
|| TREE_CODE (DECL_FIELD_CONTEXT (decl)) == BLOCK))
@@ -1936,10 +1940,11 @@ dbxout_symbol (decl, local)
{
/* The sun4 assembler does not grok this. */
const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
+
if (TREE_CODE (TREE_TYPE (decl)) == INTEGER_TYPE
|| TREE_CODE (TREE_TYPE (decl)) == ENUMERAL_TYPE)
{
- HOST_WIDE_INT ival = TREE_INT_CST_LOW (DECL_INITIAL (decl));
+ HOST_WIDE_INT ival = tree_low_cst (DECL_INITIAL (decl), 0);
#ifdef DBX_OUTPUT_CONSTANT_SYMBOL
DBX_OUTPUT_CONSTANT_SYMBOL (asmfile, name, ival);
#else