aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-11-18 14:52:03 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2013-11-18 14:52:03 +0000
commit9439e9a1a4aed9382d459eab247958671ea5a30d (patch)
treebbf1b784a6f03f045b5a0765d5dccfb9df0eab5a /gcc/cp
parent7c5efc1206d99472b0a1615b9da8f31cd849014b (diff)
downloadgcc-9439e9a1a4aed9382d459eab247958671ea5a30d.zip
gcc-9439e9a1a4aed9382d459eab247958671ea5a30d.tar.gz
gcc-9439e9a1a4aed9382d459eab247958671ea5a30d.tar.bz2
c-common.c, [...]: Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
gcc/c-family/ * c-common.c, c-format.c, c-omp.c, c-pretty-print.c: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. gcc/c/ * c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. gcc/cp/ * class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. gcc/go/ * gofrontend/expressions.cc: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. gcc/java/ * class.c, expr.c: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. gcc/objc/ * objc-next-runtime-abi-02.c: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. gcc/ * builtins.c, cilk-common.c, config/aarch64/aarch64.c, config/alpha/alpha.c, config/arm/arm.c, config/c6x/predicates.md, config/i386/i386.c, config/ia64/predicates.md, config/s390/s390.c, coverage.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c, expr.h, fold-const.c, gimple-fold.c, godump.c, ipa-prop.c, omp-low.c, predict.c, rtlanal.c, sdbout.c, stmt.c, stor-layout.c, targhooks.c, tree-cfg.c, tree-data-ref.c, tree-inline.c, tree-ssa-forwprop.c, tree-ssa-loop-prefetch.c, tree-ssa-phiopt.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-stdarg.c, tree-vect-data-refs.c, tree-vect-patterns.c, tree.c, tree.h, var-tracking.c, varasm.c: Replace tree_low_cst (..., 0) with tree_to_shwi throughout. From-SVN: r204959
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c12
-rw-r--r--gcc/cp/dump.c2
-rw-r--r--gcc/cp/error.c4
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/method.c4
-rw-r--r--gcc/cp/parser.c4
-rw-r--r--gcc/cp/semantics.c16
8 files changed, 27 insertions, 22 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e7a2014..c15f42c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+ * class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c:
+ Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
+
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
* decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
throughout.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 1df16d4..4fc65da 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -8041,7 +8041,7 @@ dump_class_hierarchy_r (FILE *stream,
igo = TREE_CHAIN (binfo);
fprintf (stream, HOST_WIDE_INT_PRINT_DEC,
- tree_low_cst (BINFO_OFFSET (binfo), 0));
+ tree_to_shwi (BINFO_OFFSET (binfo)));
if (is_empty_class (BINFO_TYPE (binfo)))
fprintf (stream, " empty");
else if (CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (binfo)))
@@ -8117,10 +8117,10 @@ dump_class_hierarchy_1 (FILE *stream, int flags, tree t)
{
fprintf (stream, "Class %s\n", type_as_string (t, TFF_PLAIN_IDENTIFIER));
fprintf (stream, " size=%lu align=%lu\n",
- (unsigned long)(tree_low_cst (TYPE_SIZE (t), 0) / BITS_PER_UNIT),
+ (unsigned long)(tree_to_shwi (TYPE_SIZE (t)) / BITS_PER_UNIT),
(unsigned long)(TYPE_ALIGN (t) / BITS_PER_UNIT));
fprintf (stream, " base size=%lu base align=%lu\n",
- (unsigned long)(tree_low_cst (TYPE_SIZE (CLASSTYPE_AS_BASE (t)), 0)
+ (unsigned long)(tree_to_shwi (TYPE_SIZE (CLASSTYPE_AS_BASE (t)))
/ BITS_PER_UNIT),
(unsigned long)(TYPE_ALIGN (CLASSTYPE_AS_BASE (t))
/ BITS_PER_UNIT));
@@ -8157,7 +8157,7 @@ dump_array (FILE * stream, tree decl)
HOST_WIDE_INT elt;
tree size = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (decl)));
- elt = (tree_low_cst (TYPE_SIZE (TREE_TYPE (TREE_TYPE (decl))), 0)
+ elt = (tree_to_shwi (TYPE_SIZE (TREE_TYPE (TREE_TYPE (decl))))
/ BITS_PER_UNIT);
fprintf (stream, "%s:", decl_as_string (decl, TFF_PLAIN_IDENTIFIER));
fprintf (stream, " %s entries",
@@ -8246,10 +8246,10 @@ dump_thunk (FILE *stream, int indent, tree thunk)
/*NOP*/;
else if (DECL_THIS_THUNK_P (thunk))
fprintf (stream, " vcall=" HOST_WIDE_INT_PRINT_DEC,
- tree_low_cst (virtual_adjust, 0));
+ tree_to_shwi (virtual_adjust));
else
fprintf (stream, " vbase=" HOST_WIDE_INT_PRINT_DEC "(%s)",
- tree_low_cst (BINFO_VPTR_FIELD (virtual_adjust), 0),
+ tree_to_shwi (BINFO_VPTR_FIELD (virtual_adjust)),
type_as_string (BINFO_TYPE (virtual_adjust), TFF_SCOPE));
if (THUNK_ALIAS (thunk))
fprintf (stream, " alias to %p", (void *)THUNK_ALIAS (thunk));
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index 4aa3935..cc88833 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -346,7 +346,7 @@ cp_dump_tree (void* dump_info, tree t)
}
dump_int (di, "fixd", THUNK_FIXED_OFFSET (t));
if (virt)
- dump_int (di, "virt", tree_low_cst (virt, 0));
+ dump_int (di, "virt", tree_to_shwi (virt));
dump_child ("fn", DECL_INITIAL (t));
}
break;
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 7f86077..d5b42e7 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -852,7 +852,7 @@ dump_type_suffix (cxx_pretty_printer *pp, tree t, int flags)
if (integer_all_onesp (max))
pp_character (pp, '0');
else if (tree_fits_shwi_p (max))
- pp_wide_integer (pp, tree_low_cst (max, 0) + 1);
+ pp_wide_integer (pp, tree_to_shwi (max) + 1);
else
{
STRIP_NOPS (max);
@@ -2294,7 +2294,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
t = TYPE_METHOD_BASETYPE (t);
virtuals = BINFO_VIRTUALS (TYPE_BINFO (TYPE_MAIN_VARIANT (t)));
- n = tree_low_cst (idx, 0);
+ n = tree_to_shwi (idx);
/* Map vtable index back one, to allow for the null pointer to
member. */
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index c37423c..7eac6f5 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3664,7 +3664,7 @@ build_vec_init (tree base, tree maxindex, tree init,
|| ((type_build_ctor_call (type) || init || explicit_value_init_p)
&& ! (tree_fits_shwi_p (maxindex)
&& (num_initialized_elts
- == tree_low_cst (maxindex, 0) + 1))))
+ == tree_to_shwi (maxindex) + 1))))
{
/* If the ITERATOR is equal to -1, then we don't have to loop;
we've already initialized all the elements. */
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 272ef42..d15d0a4 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -95,7 +95,7 @@ make_thunk (tree function, bool this_adjusting,
convert (ssizetype,
TYPE_SIZE_UNIT (vtable_entry_type)));
- d = tree_low_cst (fixed_offset, 0);
+ d = tree_to_shwi (fixed_offset);
/* See if we already have the thunk in question. For this_adjusting
thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it
@@ -323,7 +323,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
{
if (!this_adjusting)
virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
- virtual_value = tree_low_cst (virtual_offset, /*pos=*/0);
+ virtual_value = tree_to_shwi (virtual_offset);
gcc_assert (virtual_value);
}
else
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 72fbd02..d379248 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -26963,7 +26963,7 @@ cp_parser_omp_clause_collapse (cp_parser *parser, tree list, location_t location
num = fold_non_dependent_expr (num);
if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
|| !tree_fits_shwi_p (num)
- || (n = tree_low_cst (num, 0)) <= 0
+ || (n = tree_to_shwi (num)) <= 0
|| (int) n != n)
{
error_at (loc, "collapse argument needs positive constant integer expression");
@@ -28929,7 +28929,7 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
for (cl = clauses; cl; cl = OMP_CLAUSE_CHAIN (cl))
if (OMP_CLAUSE_CODE (cl) == OMP_CLAUSE_COLLAPSE)
- collapse = tree_low_cst (OMP_CLAUSE_COLLAPSE_EXPR (cl), 0);
+ collapse = tree_to_shwi (OMP_CLAUSE_COLLAPSE_EXPR (cl));
gcc_assert (collapse >= 1);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 781d373..dce2b37 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -8611,7 +8611,7 @@ cxx_eval_array_reference (const constexpr_call *call, tree t,
*non_constant_p = true;
return t;
}
- i = tree_low_cst (index, 0);
+ i = tree_to_shwi (index);
if (TREE_CODE (ary) == CONSTRUCTOR)
return (*CONSTRUCTOR_ELTS (ary))[i].value;
else if (elem_nchars == 1)
@@ -8726,8 +8726,8 @@ cxx_eval_bit_field_ref (const constexpr_call *call, tree t,
TREE_OPERAND (t, 1), TREE_OPERAND (t, 2));
start = TREE_OPERAND (t, 2);
- istart = tree_low_cst (start, 0);
- isize = tree_low_cst (TREE_OPERAND (t, 1), 0);
+ istart = tree_to_shwi (start);
+ isize = tree_to_shwi (TREE_OPERAND (t, 1));
utype = TREE_TYPE (t);
if (!TYPE_UNSIGNED (utype))
utype = build_nonstandard_integer_type (TYPE_PRECISION (utype), 1);
@@ -8742,8 +8742,8 @@ cxx_eval_bit_field_ref (const constexpr_call *call, tree t,
&& tree_fits_shwi_p (bitpos)
&& tree_fits_shwi_p (DECL_SIZE (field)))
{
- HOST_WIDE_INT bit = tree_low_cst (bitpos, 0);
- HOST_WIDE_INT sz = tree_low_cst (DECL_SIZE (field), 0);
+ HOST_WIDE_INT bit = tree_to_shwi (bitpos);
+ HOST_WIDE_INT sz = tree_to_shwi (DECL_SIZE (field));
HOST_WIDE_INT shift;
if (bit >= istart && bit + sz <= istart + isize)
{
@@ -8900,7 +8900,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
bool *non_constant_p, bool *overflow_p)
{
tree elttype = TREE_TYPE (atype);
- int max = tree_low_cst (array_type_nelts (atype), 0);
+ int max = tree_to_shwi (array_type_nelts (atype));
vec<constructor_elt, va_gc> *n;
vec_alloc (n, max + 1);
bool pre_init = false;
@@ -9119,9 +9119,9 @@ cxx_fold_indirect_ref (location_t loc, tree type, tree op0, bool *empty_base)
&& (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (op00type))))
{
- HOST_WIDE_INT offset = tree_low_cst (op01, 0);
+ HOST_WIDE_INT offset = tree_to_shwi (op01);
tree part_width = TYPE_SIZE (type);
- unsigned HOST_WIDE_INT part_widthi = tree_low_cst (part_width, 0)/BITS_PER_UNIT;
+ unsigned HOST_WIDE_INT part_widthi = tree_to_shwi (part_width)/BITS_PER_UNIT;
unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
tree index = bitsize_int (indexi);