[polly] r244459 - Make StmtSet a list.

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 10:07:54 PDT 2015


Thanks Craig!

I just read the part about "invalidated iterators" but ignored the "still
valid element pointers" part.

I think we only use emplace_back and that should not change, hence I
can actually revert this commit if there are no objections.

Cheers,
  Johannes

On 08/10, Craig Topper wrote:
> I don't know how StmtSet is populated, but deque is guaranteed to not
> invalidated references to elements if elements are only inserted at the
> ends.
> 
> On Mon, Aug 10, 2015 at 9:47 AM, Johannes Doerfert via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> 
> > Author: jdoerfert
> > Date: Mon Aug 10 11:47:20 2015
> > New Revision: 244459
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=244459&view=rev
> > Log:
> > Make StmtSet a list.
> >
> >   With a deque (or any other sequential container) it is not sound to
> >   take the address of the elements when the container is still under
> >   construction. With a pointer based container this is save.
> >
> >
> > Modified:
> >     polly/trunk/include/polly/ScopInfo.h
> >
> > Modified: polly/trunk/include/polly/ScopInfo.h
> > URL:
> > http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=244459&r1=244458&r2=244459&view=diff
> >
> > ==============================================================================
> > --- polly/trunk/include/polly/ScopInfo.h (original)
> > +++ polly/trunk/include/polly/ScopInfo.h Mon Aug 10 11:47:20 2015
> > @@ -25,6 +25,7 @@
> >  #include "llvm/Analysis/RegionPass.h"
> >  #include "isl/ctx.h"
> >
> > +#include <list>
> >  #include <forward_list>
> >  #include <deque>
> >
> > @@ -752,7 +753,7 @@ private:
> >    /// Max loop depth.
> >    unsigned MaxLoopDepth;
> >
> > -  typedef std::deque<ScopStmt> StmtSet;
> > +  typedef std::list<ScopStmt> StmtSet;
> >    /// The statements in this Scop.
> >    StmtSet Stmts;
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> >
> 
> 
> 
> -- 
> ~Craig

-- 

Johannes Doerfert
Researcher / PhD Student

Compiler Design Lab (Prof. Hack)
Saarland University, Computer Science
Building E1.3, Room 4.31

Tel. +49 (0)681 302-57521 : doerfert at cs.uni-saarland.de
Fax. +49 (0)681 302-3065  : http://www.cdl.uni-saarland.de/people/doerfert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150810/98664494/attachment.sig>


More information about the llvm-commits mailing list