Mercurial > projects > ddmd
diff dmd/UnrolledLoopStatement.d @ 123:9e39c7de8438
Make dmd test suite compile
author | korDen |
---|---|
date | Fri, 03 Sep 2010 20:46:58 +0400 |
parents | c77e9f4f1793 |
children | fe932c1a9563 |
line wrap: on
line diff
--- a/dmd/UnrolledLoopStatement.d Thu Sep 02 23:37:49 2010 +0100 +++ b/dmd/UnrolledLoopStatement.d Fri Sep 03 20:46:58 2010 +0400 @@ -103,7 +103,18 @@ override int inlineCost(InlineCostState* ics) { - assert(false); + int cost = 0; + + foreach (Statement s; statements) + { + if (s) + { + cost += s.inlineCost(ics); + if (cost >= COST_MAX) + break; + } + } + return cost; } override Expression doInline(InlineDoState ids) @@ -113,7 +124,12 @@ override Statement inlineScan(InlineScanState* iss) { - assert(false); + foreach (ref Statement s; statements) + { + if (s) + s = s.inlineScan(iss); + } + return this; } override void toIR(IRState* irs)