This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Access single_exit through accessor functions
- From: "Sebastian Pop" <sebastian dot pop at inria dot fr>
- To: "Zdenek Dvorak" <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Nov 2006 09:53:35 +0100
- Subject: Re: [patch] Access single_exit through accessor functions
- References: <20061121013106.GA6450@atrey.karlin.mff.cuni.cz>
On 11/21/06, Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
+
+ /* Returns the single exit edge of LOOP, or NULL if LOOP has either no exit
+ or more than one exit. */
+
+ edge
+ single_exit (const struct loop *loop)
+ {
+ return loop->single_exit_;
+ }
+
+ /* Records E as a single exit edge of LOOP. */
+
+ void
+ set_single_exit (struct loop *loop, edge e)
+ {
+ loop->single_exit_ = e;
+ }
Why not static inline for those two functions?
Index: cfgloop.h
===================================================================
*** cfgloop.h (revision 119039)
--- cfgloop.h (working copy)
*************** struct loop
*** 148,154 ****
/* If not NULL, loop has just single exit edge stored here (edges to the
EXIT_BLOCK_PTR do not count. */
! edge single_exit;
/* True when the loop does not carry data dependences, and
consequently the iterations can be executed in any order. False
--- 148,154 ----
/* If not NULL, loop has just single exit edge stored here (edges to the
EXIT_BLOCK_PTR do not count. */
! edge single_exit_;
I would have preferred a warning in the comment, something like:
"do not use this filed directly, use the access functions..."
Also a point on which I'm not sure, is it okay to have the name
of the field ending on _ ?
Nice cleanup, thanks,
Sebastian