comparison dmd/InlineDoState.d @ 0:10317f0c89a5

Initial commit
author korDen
date Sat, 24 Oct 2009 08:42:06 +0400
parents
children be2ab491772e
comparison
equal deleted inserted replaced
-1:000000000000 0:10317f0c89a5
1 module dmd.InlineDoState;
2
3 import dmd.Array;
4 import dmd.Dsymbol;
5 import dmd.VarDeclaration;
6 import dmd.Expression;
7 import dmd.ArrayTypes;
8
9 class InlineDoState
10 {
11 VarDeclaration vthis;
12 Array from; // old Dsymbols
13 Array to; // parallel array of new Dsymbols
14 Dsymbol parent; // new parent
15
16 this()
17 {
18 from = new Array();
19 to = new Array();
20 }
21 }
22
23 /******************************
24 * Perform doInline() on an array of Expressions.
25 */
26
27 Expressions arrayExpressiondoInline(Expressions a, InlineDoState ids)
28 {
29 Expressions newa = null;
30
31 if (a)
32 {
33 newa = new Expressions();
34 newa.setDim(a.dim);
35
36 for (int i = 0; i < a.dim; i++)
37 {
38 Expression e = cast(Expression)a.data[i];
39
40 if (e)
41 {
42 e = e.doInline(ids);
43 newa.data[i] = cast(void*)e;
44 }
45 }
46 }
47 return newa;
48 }