diff options
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/Analysis/CFGVarDeclVisitor.h | 5 | ||||
| -rw-r--r-- | clang/include/clang/Analysis/UninitializedValues.h | 45 |
2 files changed, 25 insertions, 25 deletions
diff --git a/clang/include/clang/Analysis/CFGVarDeclVisitor.h b/clang/include/clang/Analysis/CFGVarDeclVisitor.h index 7e806dde5ed..cd8073c84d5 100644 --- a/clang/include/clang/Analysis/CFGVarDeclVisitor.h +++ b/clang/include/clang/Analysis/CFGVarDeclVisitor.h @@ -29,8 +29,7 @@ public: CFGVarDeclVisitor(const CFG& c) : cfg(c) {} void VisitStmt(Stmt* S) { - for (Stmt::child_iterator I=S->child_begin(), E=S->child_end(); I!=E; ++I) - static_cast<ImplClass*>(this)->Visit(*I); + static_cast<ImplClass*>(this)->VisitChildren(S); } void VisitDeclRefExpr(DeclRefExpr* DR) { @@ -56,7 +55,7 @@ public: void VisitAllDecls() { for (CFG::const_iterator BI = cfg.begin(), BE = cfg.end(); BI != BE; ++BI) for (CFGBlock::const_iterator SI=BI->begin(),SE = BI->end();SI != SE;++SI) - static_cast<ImplClass*>(this)->Visit(const_cast<Stmt*>(*SI)); + static_cast<ImplClass*>(this)->BlockStmt_Visit(const_cast<Stmt*>(*SI)); } }; diff --git a/clang/include/clang/Analysis/UninitializedValues.h b/clang/include/clang/Analysis/UninitializedValues.h index 3fe1e17250f..6fcee2dbf4c 100644 --- a/clang/include/clang/Analysis/UninitializedValues.h +++ b/clang/include/clang/Analysis/UninitializedValues.h @@ -20,7 +20,7 @@ namespace clang { - class VarDecl; + class BlockVarDecl; class Expr; class DeclRefExpr; @@ -31,6 +31,23 @@ class UninitializedValues_ValueTypes { public: //===--------------------------------------------------------------------===// + // AnalysisDataTy - Whole-function meta data used by the transfer function + // logic. + //===--------------------------------------------------------------------===// + + struct ObserverTy; + + struct AnalysisDataTy { + llvm::DenseMap<const BlockVarDecl*, unsigned > VMap; + llvm::DenseMap<const Expr*, unsigned > EMap; + unsigned NumDecls; + unsigned NumBlockExprs; + ObserverTy* Observer; + + AnalysisDataTy() : NumDecls(0), NumBlockExprs(0), Observer(NULL) {} + }; + + //===--------------------------------------------------------------------===// // ValTy - Dataflow value. //===--------------------------------------------------------------------===// @@ -38,9 +55,10 @@ public: llvm::BitVector DeclBV; llvm::BitVector ExprBV; - // Used by the solver. - void resetValues() { + void resetValues(AnalysisDataTy& AD) { + DeclBV.resize(AD.NumDecls); DeclBV.reset(); + ExprBV.resize(AD.NumBlockExprs); ExprBV.reset(); } @@ -52,24 +70,7 @@ public: DeclBV = RHS.DeclBV; ExprBV = RHS.ExprBV; } - }; - - //===--------------------------------------------------------------------===// - // AnalysisDataTy - Whole-function meta data used by the transfer function - // logic. - //===--------------------------------------------------------------------===// - - struct ObserverTy; - - struct AnalysisDataTy { - llvm::DenseMap<const VarDecl*, unsigned > VMap; - llvm::DenseMap<const Expr*, unsigned > EMap; - unsigned NumDecls; - unsigned NumBlockExprs; - ObserverTy* Observer; - - AnalysisDataTy() : NumDecls(0), NumBlockExprs(0), Observer(NULL) {} - }; + }; //===--------------------------------------------------------------------===// // ObserverTy - Observer for querying DeclRefExprs that use an uninitalized @@ -79,7 +80,7 @@ public: struct ObserverTy { virtual ~ObserverTy(); virtual void ObserveDeclRefExpr(ValTy& Val, AnalysisDataTy& AD, - DeclRefExpr* DR, VarDecl* VD) = 0; + DeclRefExpr* DR, BlockVarDecl* VD) = 0; }; }; |

