Mercurial > projects > ldc
comparison dmd/statement.h @ 1587:def7a1d494fd
Merge DMD 1.051
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 06 Nov 2009 23:58:01 +0100 |
parents | 229e02867307 |
children | 207a8a438dea |
comparison
equal
deleted
inserted
replaced
1586:7f728c52e63c | 1587:def7a1d494fd |
---|---|
120 virtual int hasBreak(); | 120 virtual int hasBreak(); |
121 virtual int hasContinue(); | 121 virtual int hasContinue(); |
122 virtual int usesEH(); | 122 virtual int usesEH(); |
123 virtual int blockExit(); | 123 virtual int blockExit(); |
124 virtual int comeFrom(); | 124 virtual int comeFrom(); |
125 virtual void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally); | 125 virtual int isEmpty(); |
126 virtual void scopeCode(Scope *sc, Statement **sentry, Statement **sexit, Statement **sfinally); | |
126 virtual Statements *flatten(Scope *sc); | 127 virtual Statements *flatten(Scope *sc); |
127 virtual Expression *interpret(InterState *istate); | 128 virtual Expression *interpret(InterState *istate); |
128 | 129 |
129 virtual int inlineCost(InlineCostState *ics); | 130 virtual int inlineCost(InlineCostState *ics); |
130 virtual Expression *doInline(InlineDoState *ids); | 131 virtual Expression *doInline(InlineDoState *ids); |
143 // LDC | 144 // LDC |
144 virtual void toNakedIR(IRState *irs); | 145 virtual void toNakedIR(IRState *irs); |
145 virtual AsmBlockStatement* endsWithAsm(); | 146 virtual AsmBlockStatement* endsWithAsm(); |
146 }; | 147 }; |
147 | 148 |
149 struct PeelStatement : Statement | |
150 { | |
151 Statement *s; | |
152 | |
153 PeelStatement(Statement *s); | |
154 Statement *semantic(Scope *sc); | |
155 }; | |
156 | |
148 struct ExpStatement : Statement | 157 struct ExpStatement : Statement |
149 { | 158 { |
150 Expression *exp; | 159 Expression *exp; |
151 | 160 |
152 ExpStatement(Loc loc, Expression *exp); | 161 ExpStatement(Loc loc, Expression *exp); |
153 Statement *syntaxCopy(); | 162 Statement *syntaxCopy(); |
154 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 163 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
155 Statement *semantic(Scope *sc); | 164 Statement *semantic(Scope *sc); |
156 Expression *interpret(InterState *istate); | 165 Expression *interpret(InterState *istate); |
157 int blockExit(); | 166 int blockExit(); |
167 int isEmpty(); | |
158 | 168 |
159 int inlineCost(InlineCostState *ics); | 169 int inlineCost(InlineCostState *ics); |
160 Expression *doInline(InlineDoState *ids); | 170 Expression *doInline(InlineDoState *ids); |
161 Statement *inlineScan(InlineScanState *iss); | 171 Statement *inlineScan(InlineScanState *iss); |
162 | 172 |
184 | 194 |
185 DeclarationStatement(Loc loc, Dsymbol *s); | 195 DeclarationStatement(Loc loc, Dsymbol *s); |
186 DeclarationStatement(Loc loc, Expression *exp); | 196 DeclarationStatement(Loc loc, Expression *exp); |
187 Statement *syntaxCopy(); | 197 Statement *syntaxCopy(); |
188 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 198 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
189 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally); | 199 void scopeCode(Scope *sc, Statement **sentry, Statement **sexit, Statement **sfinally); |
190 | 200 |
191 DeclarationStatement *isDeclarationStatement() { return this; } | 201 DeclarationStatement *isDeclarationStatement() { return this; } |
192 }; | 202 }; |
193 | 203 |
194 struct CompoundStatement : Statement | 204 struct CompoundStatement : Statement |
201 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 211 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
202 virtual Statement *semantic(Scope *sc); | 212 virtual Statement *semantic(Scope *sc); |
203 int usesEH(); | 213 int usesEH(); |
204 int blockExit(); | 214 int blockExit(); |
205 int comeFrom(); | 215 int comeFrom(); |
216 int isEmpty(); | |
206 virtual Statements *flatten(Scope *sc); | 217 virtual Statements *flatten(Scope *sc); |
207 ReturnStatement *isReturnStatement(); | 218 ReturnStatement *isReturnStatement(); |
208 Expression *interpret(InterState *istate); | 219 Expression *interpret(InterState *istate); |
209 | 220 |
210 int inlineCost(InlineCostState *ics); | 221 int inlineCost(InlineCostState *ics); |
264 int hasBreak(); | 275 int hasBreak(); |
265 int hasContinue(); | 276 int hasContinue(); |
266 int usesEH(); | 277 int usesEH(); |
267 int blockExit(); | 278 int blockExit(); |
268 int comeFrom(); | 279 int comeFrom(); |
280 int isEmpty(); | |
269 Expression *interpret(InterState *istate); | 281 Expression *interpret(InterState *istate); |
270 | 282 |
271 Statement *inlineScan(InlineScanState *iss); | 283 Statement *inlineScan(InlineScanState *iss); |
272 | 284 |
273 void toIR(IRState *irs); | 285 void toIR(IRState *irs); |
323 Statement *body; | 335 Statement *body; |
324 | 336 |
325 ForStatement(Loc loc, Statement *init, Expression *condition, Expression *increment, Statement *body); | 337 ForStatement(Loc loc, Statement *init, Expression *condition, Expression *increment, Statement *body); |
326 Statement *syntaxCopy(); | 338 Statement *syntaxCopy(); |
327 Statement *semantic(Scope *sc); | 339 Statement *semantic(Scope *sc); |
328 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally); | 340 void scopeCode(Scope *sc, Statement **sentry, Statement **sexit, Statement **sfinally); |
329 int hasBreak(); | 341 int hasBreak(); |
330 int hasContinue(); | 342 int hasContinue(); |
331 int usesEH(); | 343 int usesEH(); |
332 int blockExit(); | 344 int blockExit(); |
333 int comeFrom(); | 345 int comeFrom(); |
460 StaticAssert *sa; | 472 StaticAssert *sa; |
461 | 473 |
462 StaticAssertStatement(StaticAssert *sa); | 474 StaticAssertStatement(StaticAssert *sa); |
463 Statement *syntaxCopy(); | 475 Statement *syntaxCopy(); |
464 Statement *semantic(Scope *sc); | 476 Statement *semantic(Scope *sc); |
477 int blockExit(); | |
465 | 478 |
466 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 479 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
467 }; | 480 }; |
468 | 481 |
469 struct SwitchStatement : Statement | 482 struct SwitchStatement : Statement |
496 | 509 |
497 struct CaseStatement : Statement | 510 struct CaseStatement : Statement |
498 { | 511 { |
499 Expression *exp; | 512 Expression *exp; |
500 Statement *statement; | 513 Statement *statement; |
514 | |
501 int index; // which case it is (since we sort this) | 515 int index; // which case it is (since we sort this) |
502 block *cblock; // back end: label for the block | 516 block *cblock; // back end: label for the block |
503 | 517 |
504 // LDC | 518 // LDC |
505 Statement *enclosingScopeExit; | 519 Statement *enclosingScopeExit; |
517 Statement *inlineScan(InlineScanState *iss); | 531 Statement *inlineScan(InlineScanState *iss); |
518 | 532 |
519 void toIR(IRState *irs); | 533 void toIR(IRState *irs); |
520 | 534 |
521 CaseStatement* isCaseStatement() { return this; } | 535 CaseStatement* isCaseStatement() { return this; } |
522 | 536 |
523 // LDC | 537 // LDC |
524 llvm::BasicBlock* bodyBB; | 538 llvm::BasicBlock* bodyBB; |
525 llvm::ConstantInt* llvmIdx; | 539 llvm::ConstantInt* llvmIdx; |
526 }; | 540 }; |
541 | |
542 #if DMDV2 | |
543 | |
544 struct CaseRangeStatement : Statement | |
545 { | |
546 Expression *first; | |
547 Expression *last; | |
548 Statement *statement; | |
549 | |
550 CaseRangeStatement(Loc loc, Expression *first, Expression *last, Statement *s); | |
551 Statement *syntaxCopy(); | |
552 Statement *semantic(Scope *sc); | |
553 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
554 }; | |
555 | |
556 #endif | |
527 | 557 |
528 struct DefaultStatement : Statement | 558 struct DefaultStatement : Statement |
529 { | 559 { |
530 Statement *statement; | 560 Statement *statement; |
531 #if IN_GCC | 561 #if IN_GCC |
748 Statement *syntaxCopy(); | 778 Statement *syntaxCopy(); |
749 int blockExit(); | 779 int blockExit(); |
750 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 780 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
751 Statement *semantic(Scope *sc); | 781 Statement *semantic(Scope *sc); |
752 int usesEH(); | 782 int usesEH(); |
753 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally); | 783 void scopeCode(Scope *sc, Statement **sentry, Statement **sexit, Statement **sfinally); |
754 | 784 |
755 void toIR(IRState *irs); | 785 void toIR(IRState *irs); |
756 }; | 786 }; |
757 | 787 |
758 struct ThrowStatement : Statement | 788 struct ThrowStatement : Statement |