[PATCH] Proposal on how to fix temporary dtors.

Manuel Klimek klimek at google.com
Mon Jul 7 10:28:41 PDT 2014


On Mon, Jul 7, 2014 at 6:48 PM, Jordan Rose <jordan_rose at apple.com> wrote:

> Can you add an assertion at the end of a block that there are no
> outstanding temporary destructors in the current stack frame? That seems
> useful.
>

Do you mean at the end of a VisitBlockDecl?


>
> ================
> Comment at: lib/Analysis/CFG.cpp:3583
> @@ -3512,4 +3582,3 @@
>      if (Stmt *Child = *I)
> -      if (CFGBlock *R = VisitForTemporaryDtors(Child))
> -        B = R;
> +      if (CFGBlock *R = VisitForTemporaryDtors(Child, false, Context)) B
> = R;
>    }
> ----------------
> Lost a newline here.
>
> ================
> Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:681-686
> @@ -663,1 +680,8 @@
>    QualType varType = D.getBindTemporaryExpr()->getSubExpr()->getType();
> +  for (ExplodedNode *Node : CleanDtorState) {
> +    // FIXME: Inlining of temporary destructors is not supported yet
> anyway, so
> +    // we just put a NULL region for now. This will need to be changed
> later.
> +    VisitCXXDestructor(varType, nullptr, D.getBindTemporaryExpr(),
> +                       /*IsBase=*/false, Node, Dst);
> +  }
> +}
> ----------------
> I'm not sure you're supposed to reuse `Dst` with multiple builders.
> However, you know there's only one node in `CleanDtorState`, so you should
> be able to just skip the loop.
>
> http://reviews.llvm.org/D3627
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140707/dece5941/attachment.html>


More information about the cfe-commits mailing list