Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 1 | //==- UninitializedValues.cpp - Find Unintialized Values --------*- C++ --*-==// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Ted Kremenek and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements Uninitialized Values analysis for source-level CFGs. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/Analysis/UninitializedValues.h" |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 15 | #include "clang/Analysis/CFGStmtVisitor.h" |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 16 | #include "clang/Analysis/LocalCheckers.h" |
| 17 | #include "clang/Basic/Diagnostic.h" |
| 18 | #include "clang/AST/ASTContext.h" |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 19 | #include "DataflowSolver.h" |
| 20 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 21 | #include "llvm/ADT/SmallPtrSet.h" |
| 22 | |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 23 | using namespace clang; |
| 24 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 25 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 26 | // Dataflow initialization logic. |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 27 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 28 | |
| 29 | namespace { |
| 30 | |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 31 | class RegisterDeclsAndExprs : public CFGStmtVisitor<RegisterDeclsAndExprs> { |
Ted Kremenek | 3e03975 | 2007-09-17 17:14:52 +0000 | [diff] [blame] | 32 | UninitializedValues::AnalysisDataTy& AD; |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 33 | public: |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 34 | RegisterDeclsAndExprs(UninitializedValues::AnalysisDataTy& ad) : AD(ad) {} |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 35 | |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 36 | void VisitBlockVarDecl(BlockVarDecl* VD) { |
| 37 | if (AD.VMap.find(VD) == AD.VMap.end()) |
| 38 | AD.VMap[VD] = AD.NumDecls++; |
| 39 | } |
| 40 | |
| 41 | void VisitDeclChain(ScopedDecl* D) { |
| 42 | for (; D != NULL; D = D->getNextDeclarator()) |
| 43 | if (BlockVarDecl* VD = dyn_cast<BlockVarDecl>(D)) |
| 44 | VisitBlockVarDecl(VD); |
Ted Kremenek | 3e03975 | 2007-09-17 17:14:52 +0000 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | void BlockStmt_VisitExpr(Expr* E) { |
| 48 | if (AD.EMap.find(E) == AD.EMap.end()) |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 49 | AD.EMap[E] = AD.NumBlockExprs++; |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 50 | |
| 51 | Visit(E); |
| 52 | } |
| 53 | |
| 54 | void VisitDeclRefExpr(DeclRefExpr* DR) { |
| 55 | VisitDeclChain(DR->getDecl()); |
| 56 | } |
| 57 | |
| 58 | void VisitDeclStmt(DeclStmt* S) { |
| 59 | VisitDeclChain(S->getDecl()); |
| 60 | } |
| 61 | |
| 62 | void VisitStmt(Stmt* S) { |
| 63 | VisitChildren(S); |
| 64 | } |
| 65 | |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | } // end anonymous namespace |
| 69 | |
| 70 | void UninitializedValues::InitializeValues(const CFG& cfg) { |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 71 | RegisterDeclsAndExprs R(this->getAnalysisData()); |
| 72 | |
| 73 | for (CFG::const_iterator I=cfg.begin(), E=cfg.end(); I!=E; ++I) |
| 74 | for (CFGBlock::const_iterator BI=I->begin(), BE=I->end(); BI!=BE; ++BI) |
| 75 | R.BlockStmt_Visit(*BI); |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 78 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 79 | // Transfer functions. |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 80 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 81 | |
| 82 | namespace { |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 83 | |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 84 | class TransferFuncs : public CFGStmtVisitor<TransferFuncs,bool> { |
| 85 | UninitializedValues::ValTy V; |
Ted Kremenek | 3e03975 | 2007-09-17 17:14:52 +0000 | [diff] [blame] | 86 | UninitializedValues::AnalysisDataTy& AD; |
Ted Kremenek | e6148f3 | 2007-09-17 21:59:08 +0000 | [diff] [blame] | 87 | bool InitWithAssigns; |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 88 | public: |
Ted Kremenek | e6148f3 | 2007-09-17 21:59:08 +0000 | [diff] [blame] | 89 | TransferFuncs(UninitializedValues::AnalysisDataTy& ad, |
| 90 | bool init_with_assigns=true) : |
| 91 | AD(ad), InitWithAssigns(init_with_assigns) { |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 92 | V.resetValues(AD); |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | UninitializedValues::ValTy& getVal() { return V; } |
Ted Kremenek | 3e03975 | 2007-09-17 17:14:52 +0000 | [diff] [blame] | 96 | |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 97 | bool VisitDeclRefExpr(DeclRefExpr* DR); |
| 98 | bool VisitBinaryOperator(BinaryOperator* B); |
| 99 | bool VisitUnaryOperator(UnaryOperator* U); |
| 100 | bool VisitStmt(Stmt* S); |
| 101 | bool VisitCallExpr(CallExpr* C); |
| 102 | bool BlockStmt_VisitExpr(Expr* E); |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 103 | bool VisitDeclStmt(DeclStmt* D); |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 104 | |
| 105 | static inline bool Initialized() { return true; } |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 106 | static inline bool Uninitialized() { return false; } |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 107 | }; |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 108 | |
| 109 | |
| 110 | bool TransferFuncs::VisitDeclRefExpr(DeclRefExpr* DR) { |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 111 | if (BlockVarDecl* VD = dyn_cast<BlockVarDecl>(DR->getDecl())) { |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 112 | assert ( AD.VMap.find(VD) != AD.VMap.end() && "Unknown VarDecl."); |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 113 | if (AD.Observer) |
| 114 | AD.Observer->ObserveDeclRefExpr(V,AD,DR,VD); |
| 115 | |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 116 | return V.DeclBV[ AD.VMap[VD] ]; |
| 117 | } |
| 118 | else |
| 119 | return Initialized(); |
| 120 | } |
| 121 | |
| 122 | bool TransferFuncs::VisitBinaryOperator(BinaryOperator* B) { |
| 123 | if (CFG::hasImplicitControlFlow(B)) { |
| 124 | assert ( AD.EMap.find(B) != AD.EMap.end() && "Unknown block-level expr."); |
| 125 | return V.ExprBV[ AD.EMap[B] ]; |
| 126 | } |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 127 | |
| 128 | if (B->isAssignmentOp()) { |
| 129 | // Get the Decl for the LHS, if any |
| 130 | for (Stmt* S = B->getLHS() ;; ) { |
| 131 | if (ParenExpr* P = dyn_cast<ParenExpr>(S)) |
| 132 | S = P->getSubExpr(); |
| 133 | else if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(S)) |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 134 | if (BlockVarDecl* VD = dyn_cast<BlockVarDecl>(DR->getDecl())) { |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 135 | assert ( AD.VMap.find(VD) != AD.VMap.end() && "Unknown VarDecl."); |
Ted Kremenek | e6148f3 | 2007-09-17 21:59:08 +0000 | [diff] [blame] | 136 | |
| 137 | if(InitWithAssigns) { |
| 138 | // Pseudo-hack to prevent cascade of warnings. If the RHS uses |
| 139 | // an uninitialized value, then we are already going to flag a warning |
| 140 | // related to the "cause". Thus, propogating uninitialized doesn't |
| 141 | // make sense, since we are just adding extra messages that don't |
| 142 | // contribute to diagnosing the bug. In InitWithAssigns mode |
| 143 | // we unconditionally set the assigned variable to Initialized to |
| 144 | // prevent Uninitialized propogation. |
| 145 | return V.DeclBV[AD.VMap[VD]] = Initialized(); |
| 146 | } |
| 147 | else |
| 148 | return V.DeclBV[ AD.VMap[VD] ] = Visit(B->getRHS()); |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 149 | } |
Ted Kremenek | e6148f3 | 2007-09-17 21:59:08 +0000 | [diff] [blame] | 150 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 151 | break; |
| 152 | } |
| 153 | } |
| 154 | |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 155 | return VisitStmt(B); |
| 156 | } |
| 157 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 158 | bool TransferFuncs::VisitDeclStmt(DeclStmt* S) { |
| 159 | bool x = Initialized(); |
| 160 | |
| 161 | for (ScopedDecl* D = S->getDecl(); D != NULL; D = D->getNextDeclarator()) |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 162 | if (BlockVarDecl* VD = dyn_cast<BlockVarDecl>(D)) |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 163 | if (Stmt* I = VD->getInit()) { |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 164 | assert ( AD.EMap.find(cast<Expr>(I)) != |
| 165 | AD.EMap.end() && "Unknown Expr."); |
| 166 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 167 | assert ( AD.VMap.find(VD) != AD.VMap.end() && "Unknown VarDecl."); |
Ted Kremenek | e6148f3 | 2007-09-17 21:59:08 +0000 | [diff] [blame] | 168 | x = V.ExprBV[ AD.EMap[cast<Expr>(I)] ]; |
| 169 | V.DeclBV[ AD.VMap[VD] ] = x; |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | return x; |
| 173 | } |
| 174 | |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 175 | bool TransferFuncs::VisitCallExpr(CallExpr* C) { |
| 176 | VisitStmt(C); |
| 177 | return Initialized(); |
| 178 | } |
| 179 | |
| 180 | bool TransferFuncs::VisitUnaryOperator(UnaryOperator* U) { |
| 181 | switch (U->getOpcode()) { |
| 182 | case UnaryOperator::AddrOf: { |
| 183 | // Blast through parentheses and find the decl (if any). Treat it |
| 184 | // as initialized from this point forward. |
| 185 | for (Stmt* S = U->getSubExpr() ;; ) |
| 186 | if (ParenExpr* P = dyn_cast<ParenExpr>(S)) |
| 187 | S = P->getSubExpr(); |
| 188 | else if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(S)) { |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 189 | if (BlockVarDecl* VD = dyn_cast<BlockVarDecl>(DR->getDecl())) { |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 190 | assert ( AD.VMap.find(VD) != AD.VMap.end() && "Unknown VarDecl."); |
| 191 | V.DeclBV[ AD.VMap[VD] ] = Initialized(); |
| 192 | } |
| 193 | break; |
| 194 | } |
| 195 | else { |
| 196 | // Evaluate the transfer function for subexpressions, even |
| 197 | // if we cannot reason more deeply about the &-expression. |
| 198 | return Visit(U->getSubExpr()); |
| 199 | } |
| 200 | |
| 201 | return Initialized(); |
| 202 | } |
| 203 | |
| 204 | default: |
| 205 | return Visit(U->getSubExpr()); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | bool TransferFuncs::VisitStmt(Stmt* S) { |
| 210 | bool x = Initialized(); |
| 211 | |
| 212 | // We don't stop at the first subexpression that is Uninitialized because |
| 213 | // evaluating some subexpressions may result in propogating "Uninitialized" |
| 214 | // or "Initialized" to variables referenced in the other subexpressions. |
| 215 | for (Stmt::child_iterator I=S->child_begin(), E=S->child_end(); I!=E; ++I) |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 216 | if (Visit(*I) == Uninitialized()) |
| 217 | x = Uninitialized(); |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 218 | |
| 219 | return x; |
| 220 | } |
| 221 | |
| 222 | bool TransferFuncs::BlockStmt_VisitExpr(Expr* E) { |
| 223 | assert ( AD.EMap.find(E) != AD.EMap.end() ); |
| 224 | return V.ExprBV[ AD.EMap[E] ] = Visit(E); |
| 225 | } |
| 226 | |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 227 | } // end anonymous namespace |
| 228 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 229 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 230 | // Merge operator. |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 231 | // |
| 232 | // In our transfer functions we take the approach that any |
| 233 | // combination of unintialized values, e.g. Unitialized + ___ = Unitialized. |
| 234 | // |
| 235 | // Merges take the opposite approach. |
| 236 | // |
| 237 | // In the merge of dataflow values (for Decls) we prefer unsoundness, and |
| 238 | // prefer false negatives to false positives. At merges, if a value for a |
| 239 | // tracked Decl is EVER initialized in any of the predecessors we treat it as |
| 240 | // initialized at the confluence point. |
| 241 | // |
| 242 | // For tracked CFGBlock-level expressions (such as the result of |
| 243 | // short-circuit), we do the opposite merge: if a value is EVER uninitialized |
| 244 | // in a predecessor we treat it as uninitalized at the confluence point. |
| 245 | // The reason we do this is because dataflow values for tracked Exprs are |
| 246 | // not as control-dependent as dataflow values for tracked Decls. |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 247 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 248 | |
| 249 | namespace { |
| 250 | struct Merge { |
| 251 | void operator()(UninitializedValues::ValTy& Dst, |
| 252 | UninitializedValues::ValTy& Src) { |
Ted Kremenek | 334b30a | 2007-09-17 18:31:23 +0000 | [diff] [blame] | 253 | assert (Dst.DeclBV.size() == Src.DeclBV.size() |
| 254 | && "Bitvector sizes do not match."); |
| 255 | |
| 256 | Dst.DeclBV |= Src.DeclBV; |
| 257 | |
| 258 | assert (Dst.ExprBV.size() == Src.ExprBV.size() |
| 259 | && "Bitvector sizes do not match."); |
| 260 | |
Ted Kremenek | e6148f3 | 2007-09-17 21:59:08 +0000 | [diff] [blame] | 261 | Dst.ExprBV &= Src.ExprBV; |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 262 | } |
| 263 | }; |
| 264 | } // end anonymous namespace |
| 265 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 266 | //===----------------------------------------------------------------------===// |
| 267 | // Unitialized values checker. Scan an AST and flag variable uses |
| 268 | //===----------------------------------------------------------------------===// |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 269 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 270 | UninitializedValues_ValueTypes::ObserverTy::~ObserverTy() {} |
| 271 | |
| 272 | namespace { |
| 273 | |
| 274 | class UninitializedValuesChecker : public UninitializedValues::ObserverTy { |
| 275 | ASTContext &Ctx; |
| 276 | Diagnostic &Diags; |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 277 | llvm::SmallPtrSet<BlockVarDecl*,10> AlreadyWarned; |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 278 | |
| 279 | public: |
| 280 | UninitializedValuesChecker(ASTContext &ctx, Diagnostic &diags) |
| 281 | : Ctx(ctx), Diags(diags) {} |
| 282 | |
| 283 | virtual void ObserveDeclRefExpr(UninitializedValues::ValTy& V, |
| 284 | UninitializedValues::AnalysisDataTy& AD, |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 285 | DeclRefExpr* DR, BlockVarDecl* VD) { |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 286 | |
| 287 | assert ( AD.VMap.find(VD) != AD.VMap.end() && "Unknown VarDecl."); |
| 288 | if (V.DeclBV[ AD.VMap[VD] ] == TransferFuncs::Uninitialized()) |
| 289 | if (AlreadyWarned.insert(VD)) |
| 290 | Diags.Report(DR->getSourceRange().Begin(), diag::warn_uninit_val); |
| 291 | } |
| 292 | }; |
| 293 | |
| 294 | } // end anonymous namespace |
| 295 | |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 296 | namespace clang { |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 297 | |
| 298 | void CheckUninitializedValues(CFG& cfg, ASTContext &Ctx, Diagnostic &Diags) { |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 299 | |
| 300 | typedef DataflowSolver<UninitializedValues,TransferFuncs,Merge> Solver; |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 301 | |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 302 | // Compute the unitialized values information. |
| 303 | UninitializedValues U; |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 304 | Solver S(U); |
Ted Kremenek | 3871d8e | 2007-09-17 19:59:27 +0000 | [diff] [blame] | 305 | S.runOnCFG(cfg); |
| 306 | |
| 307 | // Scan for DeclRefExprs that use uninitialized values. |
| 308 | UninitializedValuesChecker Observer(Ctx,Diags); |
| 309 | U.getAnalysisData().Observer = &Observer; |
| 310 | |
| 311 | for (CFG::iterator I=cfg.begin(), E=cfg.end(); I!=E; ++I) |
Ted Kremenek | 7f49f50 | 2007-09-14 22:49:21 +0000 | [diff] [blame] | 312 | S.runOnBlock(&*I); |
| 313 | } |
Ted Kremenek | 0a03ce6 | 2007-09-17 20:49:30 +0000 | [diff] [blame] | 314 | |
| 315 | } |