On Sep 15, 2010, at 6:25 PM, Zhongxing Xu wrote:
> Modified: cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h?rev=114056&r1=114055&r2=114056&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h (original)
> +++ cfe/trunk/include/clang/Analysis/FlowSensitive/DataflowSolver.h Wed Sep 
> 15 20:25:47 2010
> @@ -273,8 +273,11 @@
>   void ProcessBlock(const CFGBlock* B, bool recordStmtValues,
>                     dataflow::forward_analysis_tag) {
> 
> -    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); 
> I!=E;++I)
> -      ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
> +    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); 
> I!=E;++I) {
> +      CFGElement E = *I;
> +      if (CFGStmt S = E.getAs<CFGStmt>())
> +        ProcessStmt(S, recordStmtValues, AnalysisDirTag());
> +    }
> 
>     TF.VisitTerminator(const_cast<CFGBlock*>(B));
>   }
> @@ -284,8 +287,11 @@
> 
>     TF.VisitTerminator(const_cast<CFGBlock*>(B));
> 
> -    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); 
> I!=E;++I)
> -      ProcessStmt(*I, recordStmtValues, AnalysisDirTag());
> +    for (StmtItr I=ItrTraits::StmtBegin(B), E=ItrTraits::StmtEnd(B); 
> I!=E;++I) {
> +      CFGElement E = *I;
> +      if (CFGStmt S = E.getAs<CFGStmt>())
> +        ProcessStmt(S, recordStmtValues, AnalysisDirTag());
> +    }
>   }

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.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to