This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Use of build_binary_op


On Wed, Sep 25, 2002 at 01:57:08PM +0100, Jason Merrill wrote:
> On Wed, 25 Sep 2002 01:55:53 +0200, Pop Sébastian <pop@gauvain.u-strasbg.fr> wrote:
> 
> > I think we'll need an interface for building GIMPLE trees instead of
> > using generic functions as build or build1 ...
> 
> What do you have in mind?
> 

It is possible to provide functions like:

tree gimple_build_if (tree cond, tree then_clause, tree else_clause)
tree gimple_build_loop (tree stop_cond, tree)
tree gimple_build_fortran_do (tree low_bound, tree up_bound, tree step, tree body)
tree gimple_build_array_ref (tree ref, tree access_vector)
tree gimple_build_modify_expr (tree lhs, tree rhs)
tree gimple_build_int (int value)
...

All these functions guarantee that the result belongs to GIMPLE.
Instead of verifying that a tree is under its simple form (is_simple_* interface), 
you just build the correct simple form.  

I don't say that we have to switch from the lowering of C/C++ trees to 
this translation point of view, but I just say that this interface could be useful
- for other front-ends that cannot lower their initial AST into GIMPLE,
- for GIMPLE to GIMPLE transformations.


Sebastian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]