Mercurial > projects > ldc
comparison dmd/inline.c @ 92:70d6113eeb8c trunk
[svn r96] Updated to DMD 1.023.
Regular bugfixes.
author | lindquist |
---|---|
date | Thu, 08 Nov 2007 19:13:28 +0100 |
parents | c53b6e3fe49a |
children | aaade6ded589 |
comparison
equal
deleted
inserted
replaced
91:3f949c6e2e9d | 92:70d6113eeb8c |
---|---|
544 #endif | 544 #endif |
545 if (vd->isStatic() || vd->isConst()) | 545 if (vd->isStatic() || vd->isConst()) |
546 ; | 546 ; |
547 else | 547 else |
548 { | 548 { |
549 ExpInitializer *ie; | |
550 ExpInitializer *ieto; | |
551 VarDeclaration *vto; | 549 VarDeclaration *vto; |
552 | 550 |
553 vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init); | 551 vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init); |
554 *vto = *vd; | 552 *vto = *vd; |
555 vto->parent = ids->parent; | 553 vto->parent = ids->parent; |
557 vto->isym = NULL; | 555 vto->isym = NULL; |
558 | 556 |
559 ids->from.push(vd); | 557 ids->from.push(vd); |
560 ids->to.push(vto); | 558 ids->to.push(vto); |
561 | 559 |
562 if (vd->init->isVoidInitializer()) | 560 if (vd->init) |
563 { | 561 { |
564 vto->init = new VoidInitializer(vd->init->loc); | 562 if (vd->init->isVoidInitializer()) |
565 } | 563 { |
566 else | 564 vto->init = new VoidInitializer(vd->init->loc); |
567 { | 565 } |
568 ie = vd->init->isExpInitializer(); | 566 else |
569 assert(ie); | 567 { |
570 ieto = new ExpInitializer(ie->loc, ie->exp->doInline(ids)); | 568 ExpInitializer *ie = vd->init->isExpInitializer(); |
571 vto->init = ieto; | 569 assert(ie); |
570 vto->init = new ExpInitializer(ie->loc, ie->exp->doInline(ids)); | |
571 } | |
572 } | 572 } |
573 de->declaration = (Dsymbol *) (void *)vto; | 573 de->declaration = (Dsymbol *) (void *)vto; |
574 } | 574 } |
575 } | 575 } |
576 /* This needs work, like DeclarationExp::toElem(), if we are | 576 /* This needs work, like DeclarationExp::toElem(), if we are |
852 | 852 |
853 | 853 |
854 Statement *ForeachStatement::inlineScan(InlineScanState *iss) | 854 Statement *ForeachStatement::inlineScan(InlineScanState *iss) |
855 { | 855 { |
856 aggr = aggr->inlineScan(iss); | 856 aggr = aggr->inlineScan(iss); |
857 body = body->inlineScan(iss); | 857 if (body) |
858 body = body->inlineScan(iss); | |
858 return this; | 859 return this; |
859 } | 860 } |
860 | 861 |
861 | 862 |
862 #if V2 | 863 #if V2 |
863 Statement *ForeachRangeStatement::inlineScan(InlineScanState *iss) | 864 Statement *ForeachRangeStatement::inlineScan(InlineScanState *iss) |
864 { | 865 { |
865 lwr = lwr->inlineScan(iss); | 866 lwr = lwr->inlineScan(iss); |
866 upr = upr->inlineScan(iss); | 867 upr = upr->inlineScan(iss); |
867 body = body->inlineScan(iss); | 868 if (body) |
869 body = body->inlineScan(iss); | |
868 return this; | 870 return this; |
869 } | 871 } |
870 #endif | 872 #endif |
871 | 873 |
872 | 874 |
1286 // to: | 1288 // to: |
1287 // return this; | 1289 // return this; |
1288 #endif | 1290 #endif |
1289 isSynchronized() || | 1291 isSynchronized() || |
1290 isImportedSymbol() || | 1292 isImportedSymbol() || |
1293 #if V2 | |
1294 closureVars.dim || // no nested references to this frame | |
1295 #else | |
1291 nestedFrameRef || // no nested references to this frame | 1296 nestedFrameRef || // no nested references to this frame |
1297 #endif | |
1292 (isVirtual() && !isFinal()) | 1298 (isVirtual() && !isFinal()) |
1293 )) | 1299 )) |
1294 { | 1300 { |
1295 goto Lno; | 1301 goto Lno; |
1296 } | 1302 } |