diff options
author | Tom Tromey <tromey@adacore.com> | 2020-05-13 13:15:13 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-05-13 13:15:13 -0600 |
commit | a89febbd83b48439bc447d0b1699e30a70f56936 (patch) | |
tree | b02a70d86d3206b083e1ab19b2f758032b501ddc /gdb | |
parent | f7e23710fcb7133a3bbe7795ad0ddd2defca358a (diff) | |
download | fsf-binutils-gdb-a89febbd83b48439bc447d0b1699e30a70f56936.zip fsf-binutils-gdb-a89febbd83b48439bc447d0b1699e30a70f56936.tar.gz fsf-binutils-gdb-a89febbd83b48439bc447d0b1699e30a70f56936.tar.bz2 |
Remove ada-lang.c:align_value
I recently noticed the align_value function in ada-lang.c. This can
be removed, in favor of align_up from gdbsupport.
gdb/ChangeLog
2020-05-13 Tom Tromey <tromey@adacore.com>
* ada-lang.c (align_value): Remove.
(ada_template_to_fixed_record_type_1): Use align_up.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ada-lang.c | 19 |
2 files changed, 10 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d77e7c..4f948d5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-05-13 Tom Tromey <tromey@adacore.com> + + * ada-lang.c (align_value): Remove. + (ada_template_to_fixed_record_type_1): Use align_up. + 2020-05-13 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * async-event.c: Update the copyright year. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index db6f606..bce0bb6 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -7746,15 +7746,6 @@ ada_coerce_ref (struct value *val0) return val0; } -/* Return OFF rounded upward if necessary to a multiple of - ALIGNMENT (a power of 2). */ - -static unsigned int -align_value (unsigned int off, unsigned int alignment) -{ - return (off + alignment - 1) & ~(alignment - 1); -} - /* Return the bit alignment required for field #F of template type TYPE. */ static unsigned int @@ -8107,7 +8098,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, for (f = 0; f < nfields; f += 1) { - off = align_value (off, field_alignment (type, f)) + off = align_up (off, field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f); SET_FIELD_BITPOS (TYPE_FIELD (rtype, f), off); TYPE_FIELD_BITSIZE (rtype, f) = 0; @@ -8228,7 +8219,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, bit_len = off + fld_bit_len; off += fld_bit_len; TYPE_LENGTH (rtype) = - align_value (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT; + align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT; } /* We handle the variant part, if any, at the end because of certain @@ -8274,7 +8265,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (off + fld_bit_len > bit_len) bit_len = off + fld_bit_len; TYPE_LENGTH (rtype) = - align_value (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT; + align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT; } } @@ -8295,8 +8286,8 @@ ada_template_to_fixed_record_type_1 (struct type *type, } else { - TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype), - TYPE_LENGTH (type)); + TYPE_LENGTH (rtype) = align_up (TYPE_LENGTH (rtype), + TYPE_LENGTH (type)); } value_free_to_mark (mark); |