[cfe-commits] r74522 - /cfe/trunk/lib/Analysis/LiveVariables.cpp
Ted Kremenek
kremenek at apple.com
Tue Jun 30 12:37:13 PDT 2009
Thanks for reverting this patch. This certainly wasn't the correct
behavior, as it would cause the subexpressions of a block-level
expression to be visited multiple times.
On Jun 30, 2009, at 5:12 AM, Zhongxing Xu wrote:
> Author: zhongxingxu
> Date: Tue Jun 30 07:11:58 2009
> New Revision: 74522
>
> URL: http://llvm.org/viewvc/llvm-project?rev=74522&view=rev
> Log:
> Block level expr should be visited. Otherwise variables in init expr
> of
> DeclStmt would be dead before the DeclStmt.
> For example:
> int x = 0;
> int y = x;
> 'x' would be dead before 'int y = x'.
>
> Modified:
> cfe/trunk/lib/Analysis/LiveVariables.cpp
>
> Modified: cfe/trunk/lib/Analysis/LiveVariables.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=74522&r1=74521&r2=74522&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Analysis/LiveVariables.cpp (original)
> +++ cfe/trunk/lib/Analysis/LiveVariables.cpp Tue Jun 30 07:11:58 2009
> @@ -135,9 +135,11 @@
> StmtVisitor<TransferFuncs,void>::Visit(S);
>
> }
> - else
> + else {
> // For block-level expressions, mark that they are live.
> LiveState(S,AD) = Alive;
> + StmtVisitor<TransferFuncs,void>::Visit(S);
> + }
> }
>
> void TransferFuncs::VisitTerminator(CFGBlock* B) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list