annotate dmd/EqualExp.d @ 178:e3afd1303184

Many small bugs fixed Made all classes derive from TObject to detect memory leaks (functionality is disabled for now) Began work on overriding backend memory allocations (to avoid memory leaks)
author korDen
date Sun, 17 Oct 2010 07:42:00 +0400
parents 60bb0fe4563e
children b0d41ff5e0df
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 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 130
diff changeset
40 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 super(loc, op, EqualExp.sizeof, e1, e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 assert(op == TOK.TOKequal || op == TOK.TOKnotequal);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
45 override Expression semantic(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 Expression e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 //printf("EqualExp.semantic('%s')\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 if (type)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 return this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53 BinExp.semanticp(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 /* Before checking for operator overloading, check to see if we're
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 * comparing the addresses of two statics. If so, we can just see
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 * if they are the same symbol.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 if (e1.op == TOK.TOKaddress && e2.op == TOK.TOKaddress)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 AddrExp ae1 = cast(AddrExp)e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 AddrExp ae2 = cast(AddrExp)e2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 if (ae1.e1.op == TOK.TOKvar && ae2.e1.op == TOK.TOKvar)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 VarExp ve1 = cast(VarExp)ae1.e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 VarExp ve2 = cast(VarExp)ae2.e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 if (ve1.var == ve2.var /*|| ve1.var.toSymbol() == ve2.var.toSymbol()*/)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 // They are the same, result is 'true' for ==, 'false' for !=
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 e = new IntegerExp(loc, (op == TOK.TOKequal), Type.tboolean);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
77
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
78 Type t1 = e1.type.toBasetype();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
79 Type t2 = e2.type.toBasetype();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
80 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
81 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 error("use '%s' instead of '%s' when comparing with null",
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 Token.toChars(op == TOK.TOKequal ? TOK.TOKidentity : TOK.TOKnotidentity),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84 Token.toChars(op));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 //if (e2.op != TOKnull)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 e = op_overload(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90 if (e)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
91 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
92 if (op == TOK.TOKnotequal)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94 e = new NotExp(e.loc, e);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
95 e = e.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
99 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
100 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
101
79
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
102 // Disallow comparing T[]==T and T==T[]
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
103 if (e1.op == TOKslice && t1.ty == Tarray && e2.implicitConvTo(t1.nextOf()) ||
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
104 e2.op == TOKslice && t2.ty == Tarray && e1.implicitConvTo(t2.nextOf()))
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
105 {
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
106 incompatibleTypes();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
107 return new ErrorExp();
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
108 }
43073c7c7769 updated to 2.035
Trass3r
parents: 72
diff changeset
109
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 e = typeCombine(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111 type = Type.tboolean;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113 // Special handling for array comparisons
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 if (!arrayTypeCompatible(loc, e1.type, e2.type))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116 if (e1.type != e2.type && e1.type.isfloating() && e2.type.isfloating())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118 // Cast both to complex
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119 e1 = e1.castTo(sc, Type.tcomplex80);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 e2 = e2.castTo(sc, Type.tcomplex80);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
124 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
126
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
127 override Expression optimize(int result)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129 Expression e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131 //printf("EqualExp::optimize(result = %x) %s\n", result, toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 e1 = e1.optimize(WANTvalue | (result & WANTinterpret));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 e2 = e2.optimize(WANTvalue | (result & WANTinterpret));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136 Expression e1 = fromConstInitializer(result, this.e1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 Expression e2 = fromConstInitializer(result, this.e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 e = Equal(op, type, e1, e2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140 if (e is EXP_CANT_INTERPRET)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
141 e = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
144
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
145 override Expression interpret(InterState istate)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
146 {
115
6caaf0256da1 + interpretation of (non-assign) binary expressions
Trass3r
parents: 114
diff changeset
147 return interpretCommon2(istate, &Equal);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
149
115
6caaf0256da1 + interpretation of (non-assign) binary expressions
Trass3r
parents: 114
diff changeset
150 override bool isBit()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
151 {
115
6caaf0256da1 + interpretation of (non-assign) binary expressions
Trass3r
parents: 114
diff changeset
152 return true;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
154
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
155 override bool isCommutative()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
156 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 return true;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
159
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
160 override Identifier opId()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
161 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162 return Id.eq;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
165 override elem* toElem(IRState* irs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 //printf("EqualExp::toElem() %s\n", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168 elem* e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 OPER eop;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170 Type t1 = e1.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
171 Type t2 = e2.type.toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 switch (op)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175 case TOKequal: eop = OPeqeq; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
176 case TOKnotequal: eop = OPne; break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 default:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 dump(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 assert(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
182 //printf("EqualExp::toElem()\n");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 if (t1.ty == Tstruct)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
184 { // Do bit compare of struct's
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
185
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
186 auto es1 = e1.toElem(irs);
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
187 auto es2 = e2.toElem(irs);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
188 es1 = addressElem(es1, t1);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
189 es2 = addressElem(es2, t2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
190 e = el_param(es1, es2);
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
191 auto ecount = el_long(TYint, t1.size());
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
192 e = el_bin(OPmemcmp, TYint, e, ecount);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
193 e = el_bin(eop, TYint, e, el_long(TYint, 0));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
194 el_setLoc(e,loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
195 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
196 /// static if (false) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
197 /// else if (t1.ty == Tclass && t2.ty == Tclass)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 /// {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 /// elem *ec1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
200 /// elem *ec2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
201 ///
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
202 /// ec1 = e1.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
203 /// ec2 = e2.toElem(irs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
204 /// e = el_bin(OPcall,TYint,el_var(rtlsym[RTLSYM_OBJ_EQ]),el_param(ec1, ec2));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
205 /// }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
206 /// }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
207 else if ((t1.ty == Tarray || t1.ty == Tsarray) &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
208 (t2.ty == Tarray || t2.ty == Tsarray))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
209 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
210 Type telement = t1.nextOf().toBasetype();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
211
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
212 auto ea1 = e1.toElem(irs);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
213 ea1 = array_toDarray(t1, ea1);
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
214 auto ea2 = e2.toElem(irs);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
215 ea2 = array_toDarray(t2, ea2);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
216
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
217 version (DMDV2) {
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
218 auto ep = el_params(telement.arrayOf().getInternalTypeInfo(null).toElem(irs),
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
219 ea2, ea1, null);
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
220 int rtlfunc = RTLSYM_ARRAYEQ2;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
221 } else {
130
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
222 auto ep = el_params(telement.getInternalTypeInfo(null).toElem(irs), ea2, ea1, null);
60bb0fe4563e dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 115
diff changeset
223 int rtlfunc = RTLSYM_ARRAYEQ;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
224 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225 e = el_bin(OPcall, TYint, el_var(rtlsym[rtlfunc]), ep);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 if (op == TOKnotequal)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
227 e = el_bin(OPxor, TYint, e, el_long(TYint, 1));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
228 el_setLoc(e,loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
229 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
230 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
231 e = toElemBin(irs, eop);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
232
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
233 return e;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
234 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
235 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
236