annotate dmd/CmpExp.d @ 79:43073c7c7769

updated to 2.035 also implemented a few missing functions still crashes in Import.importAll though
author Trass3r
date Mon, 30 Aug 2010 03:57:51 +0200
parents 2e2a5c3f943a
children e28b18c23469
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
1 module dmd.CmpExp;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
2
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
3 import dmd.Expression;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
4 import dmd.Identifier;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
5 import dmd.backend.elem;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
6 import dmd.InterState;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
7 import dmd.Loc;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
8 import dmd.TOK;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
9 import dmd.Scope;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
10 import dmd.IRState;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 import dmd.Type;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 import dmd.Id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.TY;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 import dmd.ErrorExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import dmd.IntegerExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 import dmd.MATCH;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 import dmd.BinExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 import dmd.WANT;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 import dmd.GlobalExpressions;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 import dmd.expression.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 import dmd.codegen.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 import dmd.expression.Cmp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 import dmd.backend.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 import dmd.backend.RTLSYM;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 import dmd.backend.TYM;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 import dmd.backend.OPER;
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
29 import dmd.backend.rel;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
30
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 class CmpExp : BinExp
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 this(TOK op, Loc loc, Expression e1, Expression e2)
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
34 {
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 super(loc, op, CmpExp.sizeof, e1, e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
38 override Expression semantic(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 Expression e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 version (LOGSEMANTIC) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43 printf("CmpExp.semantic('%s')\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 if (type)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 return this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 BinExp.semanticp(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
50 Type t1 = e1.type.toBasetype();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
51 Type t2 = e2.type.toBasetype();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
52 if (t1.ty == Tclass && e2.op == TOKnull ||
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
53 t2.ty == Tclass && e1.op == TOKnull)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 error("do not use null when comparing class types");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 e = op_overload(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 if (e)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 if (!e.type.isscalar() && e.type.equals(e1.type))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63 error("recursive opCmp expansion");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 e = new ErrorExp();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 e = new CmpExp(op, loc, e, new IntegerExp(loc, 0, Type.tint32));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 e = e.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
74 // Disallow comparing T[]==T and T==T[]
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
75 if (e1.op == TOKslice && t1.ty == Tarray && e2.implicitConvTo(t1.nextOf()) ||
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
76 e2.op == TOKslice && t2.ty == Tarray && e1.implicitConvTo(t2.nextOf()))
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
77 {
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
78 incompatibleTypes();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
79 return new ErrorExp();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
80 }
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
81
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 typeCombine(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 type = Type.tboolean;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85 // Special handling for array comparisons
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 t1 = e1.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 t2 = e2.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88 if ((t1.ty == Tarray || t1.ty == Tsarray || t1.ty == Tpointer) &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 (t2.ty == Tarray || t2.ty == Tsarray || t2.ty == Tpointer))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
91 if (t1.nextOf().implicitConvTo(t2.nextOf()) < MATCHconst &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
92 t2.nextOf().implicitConvTo(t1.nextOf()) < MATCHconst &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 (t1.nextOf().ty != Tvoid && t2.nextOf().ty != Tvoid))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94 error("array comparison type mismatch, %s vs %s", t1.nextOf().toChars(), t2.nextOf().toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
95 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97 else if (t1.ty == Tstruct || t2.ty == Tstruct ||
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98 (t1.ty == Tclass && t2.ty == Tclass))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
99 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
100 if (t2.ty == Tstruct)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
101 error("need member function opCmp() for %s %s to compare", t2.toDsymbol(sc).kind(), t2.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
102 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
103 error("need member function opCmp() for %s %s to compare", t1.toDsymbol(sc).kind(), t1.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
104 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
105 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
106 /// static if (true) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
107 else if (t1.iscomplex() || t2.iscomplex())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
108 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
109 error("compare not defined for complex operands");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 e = new ErrorExp();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112 /// }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115 e1.rvalue();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116 e2.rvalue();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 //printf("CmpExp: %s, type = %s\n", e.toChars(), e.type.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
124 override Expression optimize(int result)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
126 Expression e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 //printf("CmpExp::optimize() %s\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129 e1 = e1.optimize(WANTvalue | (result & WANTinterpret));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130 e2 = e2.optimize(WANTvalue | (result & WANTinterpret));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 Expression e1 = fromConstInitializer(result, this.e1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 Expression e2 = fromConstInitializer(result, this.e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135 e = Cmp(op, type, e1, e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136 if (e is EXP_CANT_INTERPRET)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
141 override Expression interpret(InterState istate)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
144 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
145
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
146 override int isBit()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
147 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
149 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
150
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
151 override bool isCommutative()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
152 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153 return true;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
154 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
155
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
156 override Identifier opId()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158 return Id.cmp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
159 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
160
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
161 override elem* toElem(IRState* irs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163 elem *e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164 OPER eop;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165 Type t1 = e1.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166 Type t2 = e2.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168 switch (op)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170 case TOKlt: eop = OPlt; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
171 case TOKgt: eop = OPgt; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 case TOKle: eop = OPle; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 case TOKge: eop = OPge; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 case TOKequal: eop = OPeqeq; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175 case TOKnotequal: eop = OPne; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
176
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 // NCEG floating point compares
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 case TOKunord: eop = OPunord; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 case TOKlg: eop = OPlg; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180 case TOKleg: eop = OPleg; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181 case TOKule: eop = OPule; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
182 case TOKul: eop = OPul; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 case TOKuge: eop = OPuge; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
184 case TOKug: eop = OPug; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
185 case TOKue: eop = OPue; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
186 default:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
187 dump(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
188 assert(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
189 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
190 if (!t1.isfloating())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
191 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
192 // Convert from floating point compare to equivalent
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
193 // integral compare
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
194 eop = cast(OPER)rel_integral(eop);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
195 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
196 if (cast(int)eop > 1 && t1.ty == Tclass && t2.ty == Tclass)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
197 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 static if (true) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 assert(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
200 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
201 elem *ec1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
202 elem *ec2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
203
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
204 ec1 = e1.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
205 ec2 = e2.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
206 e = el_bin(OPcall,TYint,el_var(rtlsym[RTLSYM_OBJ_CMP]),el_param(ec1, ec2));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
207 e = el_bin(eop, TYint, e, el_long(TYint, 0));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
208 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
209 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
210 else if (cast(int)eop > 1 &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
211 (t1.ty == Tarray || t1.ty == Tsarray) &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
212 (t2.ty == Tarray || t2.ty == Tsarray))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
213 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
214 elem* ea1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
215 elem* ea2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
216 elem* ep;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
217 Type telement = t1.nextOf().toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
218 int rtlfunc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
219
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
220 ea1 = e1.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
221 ea1 = array_toDarray(t1, ea1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
222 ea2 = e2.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
223 ea2 = array_toDarray(t2, ea2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
224
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225 version (DMDV2) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 ep = el_params(telement.arrayOf().getInternalTypeInfo(null).toElem(irs),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
227 ea2, ea1, null);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
228 rtlfunc = RTLSYM_ARRAYCMP2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
229 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
230 ep = el_params(telement.getInternalTypeInfo(null).toElem(irs), ea2, ea1, null);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
231 rtlfunc = RTLSYM_ARRAYCMP;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
232 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
233 e = el_bin(OPcall, TYint, el_var(rtlsym[rtlfunc]), ep);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
234 e = el_bin(eop, TYint, e, el_long(TYint, 0));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
235 el_setLoc(e,loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
236 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
237 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
238 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
239 if (cast(int)eop <= 1)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
240 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
241 /* The result is determinate, create:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
242 * (e1 , e2) , eop
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
243 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
244 e = toElemBin(irs,OPcomma);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
245 e = el_bin(OPcomma,e.Ety,e,el_long(e.Ety,cast(int)eop));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
246 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
247 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
248 e = toElemBin(irs,eop);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
249 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
250 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
251 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
252 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
253