Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- Stmt.cpp - Statement AST Node Implementation ---------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 0bc735f | 2007-12-29 19:59:25 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the Stmt class and statement subclasses. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/AST/Stmt.h" |
| 15 | #include "clang/AST/ExprCXX.h" |
Steve Naroff | f494b57 | 2008-05-29 21:12:08 +0000 | [diff] [blame] | 16 | #include "clang/AST/ExprObjC.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 17 | #include "clang/AST/StmtVisitor.h" |
Chris Lattner | c7229c3 | 2007-10-07 08:58:51 +0000 | [diff] [blame] | 18 | #include "clang/Basic/IdentifierTable.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 19 | using namespace clang; |
| 20 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 21 | static struct StmtClassNameTable { |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 22 | const char *Name; |
| 23 | unsigned Counter; |
| 24 | unsigned Size; |
Chris Lattner | 1f683e9 | 2007-08-25 01:55:00 +0000 | [diff] [blame] | 25 | } StmtClassInfo[Stmt::lastExprConstant+1]; |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 26 | |
| 27 | static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) { |
| 28 | static bool Initialized = false; |
| 29 | if (Initialized) |
| 30 | return StmtClassInfo[E]; |
| 31 | |
| 32 | // Intialize the table on the first use. |
| 33 | Initialized = true; |
| 34 | #define STMT(N, CLASS, PARENT) \ |
| 35 | StmtClassInfo[N].Name = #CLASS; \ |
| 36 | StmtClassInfo[N].Size = sizeof(CLASS); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 37 | #include "clang/AST/StmtNodes.def" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 38 | |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 39 | return StmtClassInfo[E]; |
| 40 | } |
| 41 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 42 | const char *Stmt::getStmtClassName() const { |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 43 | return getStmtInfoTableEntry(sClass).Name; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 44 | } |
| 45 | |
Ted Kremenek | 27f8a28 | 2008-05-20 00:43:19 +0000 | [diff] [blame] | 46 | void Stmt::DestroyChildren(ASTContext& C) { |
Ted Kremenek | 9c1863e | 2008-05-19 22:02:12 +0000 | [diff] [blame] | 47 | for (child_iterator I = child_begin(), E = child_end(); I !=E; ++I) |
Ted Kremenek | 27f8a28 | 2008-05-20 00:43:19 +0000 | [diff] [blame] | 48 | if (Stmt* Child = *I) Child->Destroy(C); |
| 49 | } |
| 50 | |
| 51 | void Stmt::Destroy(ASTContext& C) { |
| 52 | DestroyChildren(C); |
Ted Kremenek | f809e3b | 2008-05-20 04:10:52 +0000 | [diff] [blame] | 53 | // FIXME: Eventually all Stmts should be allocated with the allocator |
| 54 | // in ASTContext, just like with Decls. |
| 55 | // this->~Stmt(); |
| 56 | delete this; |
Ted Kremenek | 9c1863e | 2008-05-19 22:02:12 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Ted Kremenek | 8e355f2 | 2008-05-21 15:53:55 +0000 | [diff] [blame] | 59 | void DeclStmt::Destroy(ASTContext& C) { |
| 60 | TheDecl->Destroy(C); |
Ted Kremenek | 936ff13 | 2008-05-21 16:00:02 +0000 | [diff] [blame] | 61 | delete this; |
Ted Kremenek | 8e355f2 | 2008-05-21 15:53:55 +0000 | [diff] [blame] | 62 | } |
| 63 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 64 | void Stmt::PrintStats() { |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 65 | // Ensure the table is primed. |
| 66 | getStmtInfoTableEntry(Stmt::NullStmtClass); |
| 67 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 68 | unsigned sum = 0; |
| 69 | fprintf(stderr, "*** Stmt/Expr Stats:\n"); |
Chris Lattner | 1f683e9 | 2007-08-25 01:55:00 +0000 | [diff] [blame] | 70 | for (int i = 0; i != Stmt::lastExprConstant+1; i++) { |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 71 | if (StmtClassInfo[i].Name == 0) continue; |
| 72 | sum += StmtClassInfo[i].Counter; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 73 | } |
| 74 | fprintf(stderr, " %d stmts/exprs total.\n", sum); |
| 75 | sum = 0; |
Chris Lattner | 1f683e9 | 2007-08-25 01:55:00 +0000 | [diff] [blame] | 76 | for (int i = 0; i != Stmt::lastExprConstant+1; i++) { |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 77 | if (StmtClassInfo[i].Name == 0) continue; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 78 | fprintf(stderr, " %d %s, %d each (%d bytes)\n", |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 79 | StmtClassInfo[i].Counter, StmtClassInfo[i].Name, |
| 80 | StmtClassInfo[i].Size, |
| 81 | StmtClassInfo[i].Counter*StmtClassInfo[i].Size); |
| 82 | sum += StmtClassInfo[i].Counter*StmtClassInfo[i].Size; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 83 | } |
| 84 | fprintf(stderr, "Total bytes = %d\n", sum); |
| 85 | } |
| 86 | |
| 87 | void Stmt::addStmtClass(StmtClass s) { |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 88 | ++getStmtInfoTableEntry(s).Counter; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | static bool StatSwitch = false; |
| 92 | |
| 93 | bool Stmt::CollectingStats(bool enable) { |
| 94 | if (enable) StatSwitch = true; |
Chris Lattner | 6338135 | 2007-08-25 01:42:24 +0000 | [diff] [blame] | 95 | return StatSwitch; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 99 | const char *LabelStmt::getName() const { |
| 100 | return getID()->getName(); |
| 101 | } |
| 102 | |
Steve Naroff | 507f2d5 | 2007-08-31 23:49:30 +0000 | [diff] [blame] | 103 | // This is defined here to avoid polluting Stmt.h with importing Expr.h |
| 104 | SourceRange ReturnStmt::getSourceRange() const { |
| 105 | if (RetExpr) |
| 106 | return SourceRange(RetLoc, RetExpr->getLocEnd()); |
| 107 | else |
| 108 | return SourceRange(RetLoc); |
| 109 | } |
| 110 | |
Ted Kremenek | d48ade6 | 2007-10-01 16:34:52 +0000 | [diff] [blame] | 111 | bool Stmt::hasImplicitControlFlow() const { |
| 112 | switch (sClass) { |
| 113 | default: |
| 114 | return false; |
| 115 | |
| 116 | case CallExprClass: |
| 117 | case ConditionalOperatorClass: |
| 118 | case ChooseExprClass: |
| 119 | case StmtExprClass: |
| 120 | case DeclStmtClass: |
| 121 | return true; |
| 122 | |
| 123 | case Stmt::BinaryOperatorClass: { |
| 124 | const BinaryOperator* B = cast<BinaryOperator>(this); |
| 125 | if (B->isLogicalOp() || B->getOpcode() == BinaryOperator::Comma) |
| 126 | return true; |
| 127 | else |
| 128 | return false; |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | |
Chris Lattner | db6ed17 | 2008-01-30 05:01:46 +0000 | [diff] [blame] | 133 | //===----------------------------------------------------------------------===// |
| 134 | // Constructors |
| 135 | //===----------------------------------------------------------------------===// |
| 136 | |
Anders Carlsson | dfab34a | 2008-02-05 23:03:50 +0000 | [diff] [blame] | 137 | AsmStmt::AsmStmt(SourceLocation asmloc, bool issimple, bool isvolatile, |
Chris Lattner | db6ed17 | 2008-01-30 05:01:46 +0000 | [diff] [blame] | 138 | unsigned numoutputs, unsigned numinputs, |
| 139 | std::string *names, StringLiteral **constraints, |
| 140 | Expr **exprs, StringLiteral *asmstr, unsigned numclobbers, |
| 141 | StringLiteral **clobbers, SourceLocation rparenloc) |
Anders Carlsson | b235fc2 | 2007-11-22 01:36:19 +0000 | [diff] [blame] | 142 | : Stmt(AsmStmtClass), AsmLoc(asmloc), RParenLoc(rparenloc), AsmStr(asmstr) |
Anders Carlsson | dfab34a | 2008-02-05 23:03:50 +0000 | [diff] [blame] | 143 | , IsSimple(issimple), IsVolatile(isvolatile) |
| 144 | , NumOutputs(numoutputs), NumInputs(numinputs) { |
Anders Carlsson | b235fc2 | 2007-11-22 01:36:19 +0000 | [diff] [blame] | 145 | for (unsigned i = 0, e = numinputs + numoutputs; i != e; i++) { |
| 146 | Names.push_back(names[i]); |
| 147 | Exprs.push_back(exprs[i]); |
| 148 | Constraints.push_back(constraints[i]); |
| 149 | } |
| 150 | |
| 151 | for (unsigned i = 0; i != numclobbers; i++) |
| 152 | Clobbers.push_back(clobbers[i]); |
| 153 | } |
| 154 | |
Chris Lattner | db6ed17 | 2008-01-30 05:01:46 +0000 | [diff] [blame] | 155 | ObjCForCollectionStmt::ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, |
| 156 | Stmt *Body, SourceLocation FCL, |
| 157 | SourceLocation RPL) |
| 158 | : Stmt(ObjCForCollectionStmtClass) { |
| 159 | SubExprs[ELEM] = Elem; |
| 160 | SubExprs[COLLECTION] = reinterpret_cast<Stmt*>(Collect); |
| 161 | SubExprs[BODY] = Body; |
| 162 | ForLoc = FCL; |
| 163 | RParenLoc = RPL; |
| 164 | } |
| 165 | |
| 166 | |
| 167 | ObjCAtCatchStmt::ObjCAtCatchStmt(SourceLocation atCatchLoc, |
| 168 | SourceLocation rparenloc, |
| 169 | Stmt *catchVarStmtDecl, Stmt *atCatchStmt, |
| 170 | Stmt *atCatchList) |
| 171 | : Stmt(ObjCAtCatchStmtClass) { |
| 172 | SubExprs[SELECTOR] = catchVarStmtDecl; |
| 173 | SubExprs[BODY] = atCatchStmt; |
Eli Friedman | 0613c37 | 2008-05-25 04:34:57 +0000 | [diff] [blame] | 174 | SubExprs[NEXT_CATCH] = NULL; |
| 175 | if (atCatchList) { |
Ted Kremenek | ff98102 | 2008-02-01 21:28:59 +0000 | [diff] [blame] | 176 | ObjCAtCatchStmt *AtCatchList = static_cast<ObjCAtCatchStmt*>(atCatchList); |
| 177 | |
| 178 | while (ObjCAtCatchStmt* NextCatch = AtCatchList->getNextCatchStmt()) |
| 179 | AtCatchList = NextCatch; |
| 180 | |
| 181 | AtCatchList->SubExprs[NEXT_CATCH] = this; |
Chris Lattner | db6ed17 | 2008-01-30 05:01:46 +0000 | [diff] [blame] | 182 | } |
| 183 | AtCatchLoc = atCatchLoc; |
| 184 | RParenLoc = rparenloc; |
| 185 | } |
| 186 | |
| 187 | |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 188 | //===----------------------------------------------------------------------===// |
| 189 | // Child Iterators for iterating over subexpressions/substatements |
| 190 | //===----------------------------------------------------------------------===// |
| 191 | |
| 192 | // DeclStmt |
Ted Kremenek | 9ac5928 | 2007-10-18 23:28:49 +0000 | [diff] [blame] | 193 | Stmt::child_iterator DeclStmt::child_begin() { return getDecl(); } |
| 194 | Stmt::child_iterator DeclStmt::child_end() { return child_iterator(); } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 195 | |
| 196 | // NullStmt |
Ted Kremenek | 9ac5928 | 2007-10-18 23:28:49 +0000 | [diff] [blame] | 197 | Stmt::child_iterator NullStmt::child_begin() { return child_iterator(); } |
| 198 | Stmt::child_iterator NullStmt::child_end() { return child_iterator(); } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 199 | |
| 200 | // CompoundStmt |
| 201 | Stmt::child_iterator CompoundStmt::child_begin() { return &Body[0]; } |
| 202 | Stmt::child_iterator CompoundStmt::child_end() { return &Body[0]+Body.size(); } |
| 203 | |
Ted Kremenek | d97bb6c | 2007-08-30 16:50:46 +0000 | [diff] [blame] | 204 | // CaseStmt |
| 205 | Stmt::child_iterator CaseStmt::child_begin() { return &SubExprs[0]; } |
| 206 | Stmt::child_iterator CaseStmt::child_end() { return &SubExprs[END_EXPR]; } |
| 207 | |
| 208 | // DefaultStmt |
| 209 | Stmt::child_iterator DefaultStmt::child_begin() { return &SubStmt; } |
| 210 | Stmt::child_iterator DefaultStmt::child_end() { return &SubStmt+1; } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 211 | |
| 212 | // LabelStmt |
| 213 | Stmt::child_iterator LabelStmt::child_begin() { return &SubStmt; } |
Chris Lattner | b393879 | 2007-08-30 00:53:54 +0000 | [diff] [blame] | 214 | Stmt::child_iterator LabelStmt::child_end() { return &SubStmt+1; } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 215 | |
| 216 | // IfStmt |
| 217 | Stmt::child_iterator IfStmt::child_begin() { return &SubExprs[0]; } |
| 218 | Stmt::child_iterator IfStmt::child_end() { return &SubExprs[0]+END_EXPR; } |
| 219 | |
| 220 | // SwitchStmt |
| 221 | Stmt::child_iterator SwitchStmt::child_begin() { return &SubExprs[0]; } |
| 222 | Stmt::child_iterator SwitchStmt::child_end() { return &SubExprs[0]+END_EXPR; } |
| 223 | |
| 224 | // WhileStmt |
| 225 | Stmt::child_iterator WhileStmt::child_begin() { return &SubExprs[0]; } |
| 226 | Stmt::child_iterator WhileStmt::child_end() { return &SubExprs[0]+END_EXPR; } |
| 227 | |
| 228 | // DoStmt |
| 229 | Stmt::child_iterator DoStmt::child_begin() { return &SubExprs[0]; } |
| 230 | Stmt::child_iterator DoStmt::child_end() { return &SubExprs[0]+END_EXPR; } |
| 231 | |
| 232 | // ForStmt |
| 233 | Stmt::child_iterator ForStmt::child_begin() { return &SubExprs[0]; } |
| 234 | Stmt::child_iterator ForStmt::child_end() { return &SubExprs[0]+END_EXPR; } |
| 235 | |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 236 | // ObjCForCollectionStmt |
| 237 | Stmt::child_iterator ObjCForCollectionStmt::child_begin() { |
Fariborz Jahanian | 0196cab | 2008-01-02 22:54:34 +0000 | [diff] [blame] | 238 | return &SubExprs[0]; |
| 239 | } |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 240 | Stmt::child_iterator ObjCForCollectionStmt::child_end() { |
Fariborz Jahanian | 0196cab | 2008-01-02 22:54:34 +0000 | [diff] [blame] | 241 | return &SubExprs[0]+END_EXPR; |
| 242 | } |
| 243 | |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 244 | // GotoStmt |
Ted Kremenek | 9ac5928 | 2007-10-18 23:28:49 +0000 | [diff] [blame] | 245 | Stmt::child_iterator GotoStmt::child_begin() { return child_iterator(); } |
| 246 | Stmt::child_iterator GotoStmt::child_end() { return child_iterator(); } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 247 | |
| 248 | // IndirectGotoStmt |
Ted Kremenek | 1060aff | 2008-06-17 03:11:08 +0000 | [diff] [blame] | 249 | Expr* IndirectGotoStmt::getTarget() { return cast<Expr>(Target); } |
| 250 | const Expr* IndirectGotoStmt::getTarget() const { return cast<Expr>(Target); } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 251 | |
Ted Kremenek | 1060aff | 2008-06-17 03:11:08 +0000 | [diff] [blame] | 252 | Stmt::child_iterator IndirectGotoStmt::child_begin() { return &Target; } |
| 253 | Stmt::child_iterator IndirectGotoStmt::child_end() { return &Target+1; } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 254 | |
| 255 | // ContinueStmt |
Ted Kremenek | 9ac5928 | 2007-10-18 23:28:49 +0000 | [diff] [blame] | 256 | Stmt::child_iterator ContinueStmt::child_begin() { return child_iterator(); } |
| 257 | Stmt::child_iterator ContinueStmt::child_end() { return child_iterator(); } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 258 | |
| 259 | // BreakStmt |
Ted Kremenek | 9ac5928 | 2007-10-18 23:28:49 +0000 | [diff] [blame] | 260 | Stmt::child_iterator BreakStmt::child_begin() { return child_iterator(); } |
| 261 | Stmt::child_iterator BreakStmt::child_end() { return child_iterator(); } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 262 | |
| 263 | // ReturnStmt |
Ted Kremenek | 1060aff | 2008-06-17 03:11:08 +0000 | [diff] [blame] | 264 | const Expr* ReturnStmt::getRetValue() const { |
| 265 | return cast_or_null<Expr>(RetExpr); |
| 266 | } |
| 267 | Expr* ReturnStmt::getRetValue() { |
| 268 | return cast_or_null<Expr>(RetExpr); |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 269 | } |
| 270 | |
Ted Kremenek | 1060aff | 2008-06-17 03:11:08 +0000 | [diff] [blame] | 271 | Stmt::child_iterator ReturnStmt::child_begin() { |
| 272 | return &RetExpr; |
| 273 | } |
| 274 | Stmt::child_iterator ReturnStmt::child_end() { |
| 275 | return RetExpr ? &RetExpr+1 : &RetExpr; |
Ted Kremenek | 2298f91 | 2007-08-27 20:58:16 +0000 | [diff] [blame] | 276 | } |
Ted Kremenek | 8297777 | 2007-08-24 21:09:09 +0000 | [diff] [blame] | 277 | |
Chris Lattner | fe79595 | 2007-10-29 04:04:16 +0000 | [diff] [blame] | 278 | // AsmStmt |
| 279 | Stmt::child_iterator AsmStmt::child_begin() { return child_iterator(); } |
| 280 | Stmt::child_iterator AsmStmt::child_end() { return child_iterator(); } |
| 281 | |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 282 | // ObjCAtCatchStmt |
| 283 | Stmt::child_iterator ObjCAtCatchStmt::child_begin() { return &SubExprs[0]; } |
| 284 | Stmt::child_iterator ObjCAtCatchStmt::child_end() { |
Fariborz Jahanian | 3b1191d | 2007-11-01 23:59:59 +0000 | [diff] [blame] | 285 | return &SubExprs[0]+END_EXPR; |
| 286 | } |
Fariborz Jahanian | b210bd0 | 2007-11-01 21:12:44 +0000 | [diff] [blame] | 287 | |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 288 | // ObjCAtFinallyStmt |
| 289 | Stmt::child_iterator ObjCAtFinallyStmt::child_begin() { return &AtFinallyStmt; } |
| 290 | Stmt::child_iterator ObjCAtFinallyStmt::child_end() { return &AtFinallyStmt+1; } |
Fariborz Jahanian | b210bd0 | 2007-11-01 21:12:44 +0000 | [diff] [blame] | 291 | |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 292 | // ObjCAtTryStmt |
| 293 | Stmt::child_iterator ObjCAtTryStmt::child_begin() { return &SubStmts[0]; } |
| 294 | Stmt::child_iterator ObjCAtTryStmt::child_end() { |
Fariborz Jahanian | 89079ea | 2007-11-07 17:43:16 +0000 | [diff] [blame] | 295 | return &SubStmts[0]+END_EXPR; |
Fariborz Jahanian | 3b1191d | 2007-11-01 23:59:59 +0000 | [diff] [blame] | 296 | } |
Fariborz Jahanian | b210bd0 | 2007-11-01 21:12:44 +0000 | [diff] [blame] | 297 | |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 298 | // ObjCAtThrowStmt |
| 299 | Stmt::child_iterator ObjCAtThrowStmt::child_begin() { |
Fariborz Jahanian | 39f8f15 | 2007-11-07 02:00:49 +0000 | [diff] [blame] | 300 | return &Throw; |
| 301 | } |
| 302 | |
Ted Kremenek | a526c5c | 2008-01-07 19:49:32 +0000 | [diff] [blame] | 303 | Stmt::child_iterator ObjCAtThrowStmt::child_end() { |
Fariborz Jahanian | 39f8f15 | 2007-11-07 02:00:49 +0000 | [diff] [blame] | 304 | return &Throw+1; |
| 305 | } |
Fariborz Jahanian | fa3ee8e | 2008-01-29 19:14:59 +0000 | [diff] [blame] | 306 | |
| 307 | // ObjCAtSynchronizedStmt |
| 308 | Stmt::child_iterator ObjCAtSynchronizedStmt::child_begin() { |
Fariborz Jahanian | a0f5579 | 2008-01-29 22:59:37 +0000 | [diff] [blame] | 309 | return &SubStmts[0]; |
Fariborz Jahanian | fa3ee8e | 2008-01-29 19:14:59 +0000 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | Stmt::child_iterator ObjCAtSynchronizedStmt::child_end() { |
Fariborz Jahanian | a0f5579 | 2008-01-29 22:59:37 +0000 | [diff] [blame] | 313 | return &SubStmts[0]+END_EXPR; |
Fariborz Jahanian | fa3ee8e | 2008-01-29 19:14:59 +0000 | [diff] [blame] | 314 | } |
| 315 | |