This is the mail archive of the gcc-patches@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: [lno] Some functions for the loop structure


On Tue, Jan 06, 2004 at 08:12:26PM +0100, Falk Hueffner wrote:
> Pop Sébastian <pop@gauvain.u-strasbg.fr> writes:
> 
> > +/* Returns the exit edges of the loop.  */
> > +
> > +static inline edge *
> > +loop_exit_edges (struct loop *loop)
> > +{
> > +  return loop->exit_edges;
> > +}
> > +
> > +/* Returns the n-th exit edge of the loop.  */
> > +
> > +static inline edge 
> > +loop_exit_edge (struct loop *loop, unsigned n)
> > +{
> > +  return loop->exit_edges[n];
> > +}
> 
> I think this "half-abstraction" is a bit confusing. Either you want to
> hide the fact that exit_edges is an array; then there should be no
> loop_exit_edges. Or you don't want to hide it, then loop_exit_edge is
> pointless.
> 

I use both versions in the following code:

  if (loop_exit_edges (loop))
    {
      edge exit_edge;
      tree expr;
      
      exit_edge = loop_exit_edge (loop, 0);

maybe loop_exit_edges have to be renamed loop_exit_edges_p.


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