annotate dmd/EqualExp.d @ 115:6caaf0256da1

+ interpretation of (non-assign) binary expressions + BinExp.isunsigned + EqualExp.isBit
author Trass3r
date Thu, 02 Sep 2010 01:29:29 +0200
parents e28b18c23469
children 60bb0fe4563e
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.EqualExp;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 79
diff changeset
3 import dmd.common;
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
4 import dmd.ErrorExp;
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
5 import dmd.Expression;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.Id;
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
7 import dmd.Identifier;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
8 import dmd.InterState;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
9 import dmd.Loc;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
10 import dmd.Scope;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
11 import dmd.IRState;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
12 import dmd.BinExp;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.TOK;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 import dmd.Type;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import dmd.AddrExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 import dmd.VarExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 import dmd.IntegerExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 import dmd.TY;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 import dmd.Token;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 import dmd.NotExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 import dmd.WANT;
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
22 import dmd.GlobalExpressions;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
23
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 import dmd.backend.elem;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 import dmd.backend.OPER;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 import dmd.backend.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 import dmd.backend.TYM;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 import dmd.backend.RTLSYM;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 import dmd.codegen.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 import dmd.expression.util.arrayTypeCompatible;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 import dmd.expression.Util;
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
34 import dmd.expression.Equal;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
35
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 class EqualExp : BinExp
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 this(TOK op, Loc loc, Expression e1, Expression e2)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 super(loc, op, EqualExp.sizeof, e1, e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 assert(op == TOK.TOKequal || op == TOK.TOKnotequal);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
44 override Expression semantic(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 Expression e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 //printf("EqualExp.semantic('%s')\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 if (type)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 return this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52 BinExp.semanticp(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 /* Before checking for operator overloading, check to see if we're
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 * comparing the addresses of two statics. If so, we can just see
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 * if they are the same symbol.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 if (e1.op == TOK.TOKaddress && e2.op == TOK.TOKaddress)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 AddrExp ae1 = cast(AddrExp)e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 AddrExp ae2 = cast(AddrExp)e2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63 if (ae1.e1.op == TOK.TOKvar && ae2.e1.op == TOK.TOKvar)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 VarExp ve1 = cast(VarExp)ae1.e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 VarExp ve2 = cast(VarExp)ae2.e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 if (ve1.var == ve2.var /*|| ve1.var.toSymbol() == ve2.var.toSymbol()*/)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 // They are the same, result is 'true' for ==, 'false' for !=
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 e = new IntegerExp(loc, (op == TOK.TOKequal), Type.tboolean);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
77 Type t1 = e1.type.toBasetype();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
78 Type t2 = e2.type.toBasetype();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
79 if (t1.ty == TY.Tclass && e2.op == TOK.TOKnull || t2.ty == TY.Tclass && e1.op == TOK.TOKnull)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
80 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
81 error("use '%s' instead of '%s' when comparing with null",
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 Token.toChars(op == TOK.TOKequal ? TOK.TOKidentity : TOK.TOKnotidentity),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 Token.toChars(op));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 //if (e2.op != TOKnull)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88 e = op_overload(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 if (e)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
91 if (op == TOK.TOKnotequal)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
92 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 e = new NotExp(e.loc, e);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94 e = e.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
95 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
99 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
100
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
101 // Disallow comparing T[]==T and T==T[]
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
102 if (e1.op == TOKslice && t1.ty == Tarray && e2.implicitConvTo(t1.nextOf()) ||
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
103 e2.op == TOKslice && t2.ty == Tarray && e1.implicitConvTo(t2.nextOf()))
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
104 {
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
105 incompatibleTypes();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
106 return new ErrorExp();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
107 }
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
108
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
109 e = typeCombine(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 type = Type.tboolean;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112 // Special handling for array comparisons
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113 if (!arrayTypeCompatible(loc, e1.type, e2.type))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115 if (e1.type != e2.type && e1.type.isfloating() && e2.type.isfloating())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 // Cast both to complex
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118 e1 = e1.castTo(sc, Type.tcomplex80);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119 e2 = e2.castTo(sc, Type.tcomplex80);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
124 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
126 override Expression optimize(int result)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 Expression e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130 //printf("EqualExp::optimize(result = %x) %s\n", result, toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131 e1 = e1.optimize(WANTvalue | (result & WANTinterpret));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 e2 = e2.optimize(WANTvalue | (result & WANTinterpret));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135 Expression e1 = fromConstInitializer(result, this.e1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136 Expression e2 = fromConstInitializer(result, this.e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138 e = Equal(op, type, e1, e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 if (e is EXP_CANT_INTERPRET)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
141 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
144 override Expression interpret(InterState istate)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
145 {
115
6caaf0256da1 + interpretation of (non-assign) binary expressions
Trass3r
parents: 114
diff changeset
146 return interpretCommon2(istate, &Equal);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
147 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148
115
6caaf0256da1 + interpretation of (non-assign) binary expressions
Trass3r
parents: 114
diff changeset
149 override bool isBit()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
150 {
115
6caaf0256da1 + interpretation of (non-assign) binary expressions
Trass3r
parents: 114
diff changeset
151 return true;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
152 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
154 override bool isCommutative()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
155 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
156 return true;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
159 override Identifier opId()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
160 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
161 return Id.eq;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
164 override elem* toElem(IRState* irs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166 //printf("EqualExp::toElem() %s\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 elem* e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168 OPER eop;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 Type t1 = e1.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170 Type t2 = e2.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
171
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 switch (op)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 {
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 default:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 dump(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 assert(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181 //printf("EqualExp::toElem()\n");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
182 if (t1.ty == Tstruct)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 { // Do bit compare of struct's
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
184 elem* es1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
185 elem* es2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
186 elem* ecount;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
187
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
188 es1 = e1.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
189 es2 = e2.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
190 static if (true) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
191 es1 = addressElem(es1, t1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
192 es2 = addressElem(es2, t2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
193 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
194 es1 = el_una(OPaddr, TYnptr, es1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
195 es2 = el_una(OPaddr, TYnptr, es2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
196 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
197 e = el_param(es1, es2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 ecount = el_long(TYint, t1.size());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 e = el_bin(OPmemcmp, TYint, e, ecount);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
200 e = el_bin(eop, TYint, e, el_long(TYint, 0));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
201 el_setLoc(e,loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
202 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
203 /// static if (false) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
204 /// else if (t1.ty == Tclass && t2.ty == Tclass)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
205 /// {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
206 /// elem *ec1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
207 /// elem *ec2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
208 ///
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
209 /// ec1 = e1.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
210 /// ec2 = e2.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
211 /// e = el_bin(OPcall,TYint,el_var(rtlsym[RTLSYM_OBJ_EQ]),el_param(ec1, ec2));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
212 /// }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
213 /// }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
214 else if ((t1.ty == Tarray || t1.ty == Tsarray) &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
215 (t2.ty == Tarray || t2.ty == Tsarray))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
216 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
217 elem* ea1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
218 elem* ea2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
219 elem* ep;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
220 Type telement = t1.nextOf().toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
221 int rtlfunc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
222
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
223 ea1 = e1.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
224 ea1 = array_toDarray(t1, ea1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225 ea2 = e2.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 ea2 = array_toDarray(t2, ea2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
227
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
228 version (DMDV2) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
229 ep = el_params(telement.arrayOf().getInternalTypeInfo(null).toElem(irs),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
230 ea2, ea1, null);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
231 rtlfunc = RTLSYM_ARRAYEQ2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
232 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
233 ep = el_params(telement.getInternalTypeInfo(null).toElem(irs), ea2, ea1, null);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
234 rtlfunc = RTLSYM_ARRAYEQ;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
235 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
236 e = el_bin(OPcall, TYint, el_var(rtlsym[rtlfunc]), ep);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
237 if (op == TOKnotequal)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
238 e = el_bin(OPxor, TYint, e, el_long(TYint, 1));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
239 el_setLoc(e,loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
240 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
241 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
242 e = toElemBin(irs, eop);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
243
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
244 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
245 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
246 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
247