annotate dmd/EqualExp.d @ 187:b0d41ff5e0df

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