summaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 14:52:03 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 14:52:03 +0000
commitfcb97e84adcb5693684d9cfa7b2a97af32ba7a45 (patch)
treebbf1b784a6f03f045b5a0765d5dccfb9df0eab5a /gcc/c-family
parentb633e10e4ec216b6c9e7c05800ae85829c4282a0 (diff)
downloadgcc-fcb97e84adcb5693684d9cfa7b2a97af32ba7a45.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204959 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-common.c6
-rw-r--r--gcc/c-family/c-format.c4
-rw-r--r--gcc/c-family/c-omp.c6
-rw-r--r--gcc/c-family/c-pretty-print.c6
5 files changed, 16 insertions, 11 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 2f7d02f52b9..6a5c401461b 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,10 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+ * c-common.c, c-format.c, c-omp.c, c-pretty-print.c: Replace
+ tree_low_cst (..., 0) with tree_to_shwi throughout.
+
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
* c-ada-spec.c, c-common.c, c-pretty-print.c: Replace
host_integerp (..., 1) with tree_fits_uhwi_p throughout.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 3ffefec9a2a..b3995bef7b5 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -7003,7 +7003,7 @@ get_priority (tree args, bool is_destructor)
|| !INTEGRAL_TYPE_P (TREE_TYPE (arg)))
goto invalid;
- pri = tree_low_cst (arg, /*pos=*/0);
+ pri = tree_to_shwi (arg);
if (pri < 0 || pri > MAX_INIT_PRIORITY)
goto invalid;
@@ -11254,13 +11254,13 @@ warn_for_sign_compare (location_t location,
{
primop = op1;
unsignedp = unsignedp1;
- constant = tree_low_cst (op0, 0);
+ constant = tree_to_shwi (op0);
}
else
{
primop = op0;
unsignedp = unsignedp0;
- constant = tree_low_cst (op1, 0);
+ constant = tree_to_shwi (op1);
}
bits = TYPE_PRECISION (TREE_TYPE (primop));
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index d0c07e41354..b3e1e399353 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -1460,7 +1460,7 @@ check_format_arg (void *ctx, tree format_tree,
return;
}
if (!tree_fits_shwi_p (arg1)
- || (offset = tree_low_cst (arg1, 0)) < 0)
+ || (offset = tree_to_shwi (arg1)) < 0)
{
res->number_non_literal++;
return;
@@ -1507,7 +1507,7 @@ check_format_arg (void *ctx, tree format_tree,
}
if (TREE_CODE (format_tree) == ARRAY_REF
&& tree_fits_shwi_p (TREE_OPERAND (format_tree, 1))
- && (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0)
+ && (offset += tree_to_shwi (TREE_OPERAND (format_tree, 1))) >= 0)
format_tree = TREE_OPERAND (format_tree, 0);
if (TREE_CODE (format_tree) == VAR_DECL
&& TREE_CODE (TREE_TYPE (format_tree)) == ARRAY_TYPE
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index 921b40628c3..3ccf8f91521 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -921,8 +921,8 @@ c_omp_declare_simd_clause_cmp (const void *p, const void *q)
&& OMP_CLAUSE_CODE (a) != OMP_CLAUSE_INBRANCH
&& OMP_CLAUSE_CODE (a) != OMP_CLAUSE_NOTINBRANCH)
{
- int c = tree_low_cst (OMP_CLAUSE_DECL (a), 0);
- int d = tree_low_cst (OMP_CLAUSE_DECL (b), 0);
+ int c = tree_to_shwi (OMP_CLAUSE_DECL (a));
+ int d = tree_to_shwi (OMP_CLAUSE_DECL (b));
if (c < d)
return 1;
if (c > d)
@@ -987,7 +987,7 @@ c_omp_declare_simd_clauses_to_decls (tree fndecl, tree clauses)
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE_INBRANCH
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE_NOTINBRANCH)
{
- int idx = tree_low_cst (OMP_CLAUSE_DECL (c), 0), i;
+ int idx = tree_to_shwi (OMP_CLAUSE_DECL (c)), i;
tree arg;
for (arg = DECL_ARGUMENTS (fndecl), i = 0; arg;
arg = TREE_CHAIN (arg), i++)
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 5f538c559f9..7898f13172c 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -587,7 +587,7 @@ c_pretty_printer::direct_abstract_declarator (tree t)
tree type = TREE_TYPE (maxval);
if (tree_fits_shwi_p (maxval))
- pp_wide_integer (this, tree_low_cst (maxval, 0) + 1);
+ pp_wide_integer (this, tree_to_shwi (maxval) + 1);
else
expression (fold_build2 (PLUS_EXPR, type, maxval,
build_int_cst (type, 1)));
@@ -1599,8 +1599,8 @@ c_pretty_printer::postfix_expression (tree e)
if (type
&& tree_int_cst_equal (TYPE_SIZE (type), TREE_OPERAND (e, 1)))
{
- HOST_WIDE_INT bitpos = tree_low_cst (TREE_OPERAND (e, 2), 0);
- HOST_WIDE_INT size = tree_low_cst (TYPE_SIZE (type), 0);
+ HOST_WIDE_INT bitpos = tree_to_shwi (TREE_OPERAND (e, 2));
+ HOST_WIDE_INT size = tree_to_shwi (TYPE_SIZE (type));
if ((bitpos % size) == 0)
{
pp_c_left_paren (this);