Mercurial > projects > ddmd
annotate dmd/InlineCostState.d @ 192:eb38fdcb3e62 default tip
updated to compile with dmd2.062
author | korDen |
---|---|
date | Sat, 02 Mar 2013 01:25:52 -0800 |
parents | e28b18c23469 |
children |
rev | line source |
---|---|
0 | 1 module dmd.InlineCostState; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.FuncDeclaration; |
5 import dmd.Expression; | |
6 | |
7 struct InlineCostState | |
8 { | |
9 int nested; | |
10 int hasthis; | |
11 int hdrscan; // !=0 if inline scan for 'header' content | |
12 FuncDeclaration fd; | |
13 } | |
14 | |
15 const int COST_MAX = 250; | |
16 | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
0
diff
changeset
|
17 int arrayInlineCost(InlineCostState* ics, Expressions arguments) |
0 | 18 { |
19 int cost = 0; | |
20 | |
21 if (arguments) | |
22 { | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
0
diff
changeset
|
23 foreach (e; arguments) |
0 | 24 { |
25 if (e) | |
26 cost += e.inlineCost(ics); | |
27 } | |
28 } | |
29 return cost; | |
30 } |