[polly] r244459 - Make StmtSet a list.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 10:03:08 PDT 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150810/59a02986/attachment.html>


More information about the llvm-commits mailing list