[PATCH][1/n] Merge from match-and-simplify, public API
Jakub Jelinek
jakub@redhat.com
Fri Oct 17 12:30:00 GMT 2014
On Wed, Oct 15, 2014 at 01:40:07PM +0200, Richard Biener wrote:
> 2014-10-15 Richard Biener <rguenther@suse.de>
>
> * gimple-fold.h (gimple_build): Declare various overloads.
> (gimple_simplify): Likewise.
> (gimple_convert): Re-implement in terms of gimple_build.
> * gimple-fold.c (gimple_convert): Remove.
> (gimple_build): New functions.
>
> --- 45,141 ----
> extern bool arith_code_with_undefined_signed_overflow (tree_code);
> extern gimple_seq rewrite_to_defined_overflow (gimple);
>
> ! /* gimple_build, functionally matching fold_buildN, outputs stmts
> ! int the provided sequence, matching and simplifying them on-the-fly.
> ! Supposed to replace force_gimple_operand (fold_buildN (...), ...). */
> ! tree gimple_build (gimple_seq *, location_t,
> ! enum tree_code, tree, tree,
> ! tree (*valueize) (tree) = NULL);
I find mixing prototypes with and without extern keyword weird,
most of the prototypes in headers use extern, I think it would be cleaner
to use it everywhere.
> *** gcc/gimple-fold.c.orig 2014-10-14 15:49:30.634356179 +0200
> --- gcc/gimple-fold.c 2014-10-15 13:02:08.158099055 +0200
> *************** along with GCC; see the file COPYING3.
> *** 56,61 ****
> --- 56,62 ----
> #include "builtins.h"
> #include "output.h"
>
> +
> /* Return true when DECL can be referenced from current unit.
> FROM_DECL (if non-null) specify constructor of variable DECL was taken from.
> We can get declarations that are not possible to reference for various
Why the whitespace change?
>
> tree
> ! gimple_convert (gimple_seq *seq, location_t loc, tree type, tree op)
> {
> ! if (useless_type_conversion_p (type, TREE_TYPE (op)))
> ! return op;
> ! op = fold_convert_loc (loc, type, op);
> ! gimple_seq stmts = NULL;
> ! op = force_gimple_operand (op, &stmts, true, NULL_TREE);
> ! gimple_seq_add_seq_without_update (seq, stmts);
> ! return op;
> }
> --- 5297,5487 ----
> return stmts;
> }
>
> !
> !
3 lines of vertical space too much?
Otherwise, LGTM.
Jakub
More information about the Gcc-patches
mailing list