0
|
1 module dmd.UnrolledLoopStatement;
|
|
2
|
|
3 import dmd.Expression;
|
|
4 import dmd.Statement;
|
|
5 import dmd.InterState;
|
|
6 import dmd.ArrayTypes;
|
|
7 import dmd.OutBuffer;
|
|
8 import dmd.Loc;
|
|
9 import dmd.Scope;
|
|
10 import dmd.InlineCostState;
|
|
11 import dmd.InlineDoState;
|
|
12 import dmd.IRState;
|
|
13 import dmd.HdrGenState;
|
|
14 import dmd.InlineScanState;
|
|
15 import dmd.BE;
|
|
16
|
|
17 class UnrolledLoopStatement : Statement
|
|
18 {
|
|
19 Statements statements;
|
|
20
|
56
|
21 this(Loc loc, Statements s)
|
0
|
22 {
|
56
|
23 super(loc);
|
|
24 statements = s;
|
0
|
25 }
|
|
26
|
|
27 Statement syntaxCopy()
|
|
28 {
|
|
29 assert(false);
|
|
30 }
|
|
31
|
|
32 Statement semantic(Scope sc)
|
|
33 {
|
56
|
34 //printf("UnrolledLoopStatement.semantic(this = %p, sc = %p)\n", this, sc);
|
|
35
|
|
36 sc.noctor++;
|
|
37 Scope scd = sc.push();
|
|
38 scd.sbreak = this;
|
|
39 scd.scontinue = this;
|
|
40
|
|
41 for (size_t i = 0; i < statements.dim; i++)
|
|
42 {
|
|
43 Statement s = cast(Statement) statements.data[i];
|
|
44 if (s)
|
|
45 {
|
|
46 s = s.semantic(scd);
|
|
47 statements.data[i] = cast(void*)s;
|
|
48 }
|
|
49 }
|
|
50
|
|
51 scd.pop();
|
|
52 sc.noctor--;
|
|
53 return this;
|
0
|
54 }
|
|
55
|
|
56 bool hasBreak()
|
|
57 {
|
|
58 assert(false);
|
|
59 }
|
|
60
|
|
61 bool hasContinue()
|
|
62 {
|
|
63 assert(false);
|
|
64 }
|
|
65
|
|
66 bool usesEH()
|
|
67 {
|
|
68 assert(false);
|
|
69 }
|
|
70
|
|
71 BE blockExit()
|
|
72 {
|
56
|
73 BE result = BEfallthru;
|
|
74 for (size_t i = 0; i < statements.dim; i++)
|
|
75 {
|
|
76 Statement s = cast(Statement) statements.data[i];
|
|
77 if (s)
|
|
78 {
|
|
79 int r = s.blockExit();
|
|
80 result |= r & ~(BEbreak | BEcontinue);
|
|
81 }
|
|
82 }
|
|
83 return result;
|
0
|
84 }
|
|
85
|
|
86 bool comeFrom()
|
|
87 {
|
|
88 assert(false);
|
|
89 }
|
|
90
|
63
|
91 Expression interpret(InterState istate)
|
0
|
92 {
|
|
93 assert(false);
|
|
94 }
|
|
95
|
|
96 void toCBuffer(OutBuffer buf, HdrGenState* hgs)
|
|
97 {
|
|
98 assert(false);
|
|
99 }
|
|
100
|
|
101 int inlineCost(InlineCostState* ics)
|
|
102 {
|
|
103 assert(false);
|
|
104 }
|
|
105
|
|
106 Expression doInline(InlineDoState ids)
|
|
107 {
|
|
108 assert(false);
|
|
109 }
|
|
110
|
|
111 Statement inlineScan(InlineScanState* iss)
|
|
112 {
|
|
113 assert(false);
|
|
114 }
|
|
115
|
|
116 void toIR(IRState* irs)
|
|
117 {
|
|
118 assert(false);
|
|
119 }
|
|
120 }
|
|
121
|