[tuples] [patch] refactoring of tree_expr_nonzero_warnv_p

Diego Novillo dnovillo@google.com
Tue Mar 4 13:21:00 GMT 2008


On 3/4/08 5:38 AM, Richard Guenther wrote:

> Please use context diffs when posting patches, and do them inline
> rather than with attachments.  Thanks.

Ironically, I'd rather have attached unified diffs.  I guess it's a 
matter of taste.

> I find the _expr bits in the function names redundant,
> tree_unary_nonzero_warnv_p is shorter and as explicit.  It also
> matches
> fold_unary and friends.

Yeah, that's probably a good idea.

> IMHO all this mixing of GIMPLE concepts inside fold-const.c is ugly,
> can't we just cp fold-const.c gimple-fold-const.c and only fix the duplicate?
> (Yeah, I hope we can trim down both sides and finally get the FEs only
> fold what they really need).

Yes, but the gimple counterparts will need the basic functionality in 
fold-const.c.  There will be a gimple-fold.c soon.  We are implementing 
GIMPLE folders in terms of public functions in fold-const.c, which is 
shared by the FEs and the ME.

So, in this case I propose moving the tree_*_nonzero_warnv_p() functions 
to fold-const.c and gimple_nonzero_warnv_p() in gimple-fold.c. 
Similarly, for other functions that we have in tree-ssa-ccp.c and 
tree-ssa.c.  Thoughts?


Diego.



More information about the Gcc-patches mailing list