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: [tuples] gimple statement iterators


> Since you have an end of list pointer, you could simply do one
> comparison:
>   return i.ptr == &GS_SEQ_LAST (i.seq);

Thanks.  Fixed and committed.

	* gimple-iterator.h (gsi_one_before_end_p): Use GS_SEQ_LAST.

Index: gimple-iterator.h
===================================================================
--- gimple-iterator.h	(revision 124150)
+++ gimple-iterator.h	(working copy)
@@ -68,7 +68,7 @@ gsi_end_p (gimple_stmt_iterator i)
 static inline bool
 gsi_one_before_end_p (gimple_stmt_iterator i)
 {
-  return *i.ptr != NULL && GS_NEXT (*i.ptr) == NULL;
+  return i.ptr == &GS_SEQ_LAST (i.seq);
 }
 
 /* Return the next gimple statement in I.  */


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