<br><br><div class="gmail_quote">On Thu, Sep 16, 2010 at 11:28 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Sep 15, 2010, at 6:25 PM, Zhongxing Xu wrote:<br>
> Modified: cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h?rev=114056&r1=114055&r2=114056&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h?rev=114056&r1=114055&r2=114056&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h (original)<br>
> +++ cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h Wed Sep 15 20:25:47 2010<br>
> @@ -273,8 +273,11 @@<br>
>   void ProcessBlock(const CFGBlock* B, bool recordStmtValues,<br>
>                     dataflow::forward_analysis_tag) {<br>
><br>
> -    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)<br>
> -      ProcessStmt(*I, recordStmtValues, AnalysisDirTag());<br>
> +    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I) {<br>
> +      CFGElement E = *I;<br>
> +      if (CFGStmt S = E.getAs<CFGStmt>())<br>
> +        ProcessStmt(S, recordStmtValues, AnalysisDirTag());<br>
> +    }<br>
><br>
>     TF.VisitTerminator(const_cast<CFGBlock*>(B));<br>
>   }<br>
> @@ -284,8 +287,11 @@<br>
><br>
>     TF.VisitTerminator(const_cast<CFGBlock*>(B));<br>
><br>
> -    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I)<br>
> -      ProcessStmt(*I, recordStmtValues, AnalysisDirTag());<br>
> +    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); I!=E;++I) {<br>
> +      CFGElement E = *I;<br>
> +      if (CFGStmt S = E.getAs<CFGStmt>())<br>
> +        ProcessStmt(S, recordStmtValues, AnalysisDirTag());<br>
> +    }<br>
>   }<br>
<br>
</div>C++ forbids this sort of immediate redeclaration of names that were introduced in a 'for' scope ("E" in both cases);  basically, it's all treated as the same scope according to the standard.  This was causing build failures, which I fixed for you in r114059, but please watch out for this in the future.<br>

<font color="#888888"><br>
John.</font></blockquote></div><br>Yes. This was my bug. Thanks for reminding.<br>