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