comparison dmd/ShrAssignExp.d @ 130:60bb0fe4563e

dmdfe 2.037 first main iteration
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Thu, 09 Sep 2010 22:51:44 +0100
parents fe941d774f4a
children 206db751bd4c
comparison
equal deleted inserted replaced
129:010eb8f0e18d 130:60bb0fe4563e
34 34
35 e = op_overload(sc); 35 e = op_overload(sc);
36 if (e) 36 if (e)
37 return e; 37 return e;
38 38
39 if (e1.op == TOK.TOKarraylength)
40 {
41 e = ArrayLengthExp.rewriteOpAssign(this);
42 e = e.semantic(sc);
43 return e;
44 }
45
39 e1 = e1.modifiableLvalue(sc, e1); 46 e1 = e1.modifiableLvalue(sc, e1);
40 e1.checkScalar(); 47 e1.checkScalar();
41 e1.checkNoBool(); 48 e1.checkNoBool();
42 type = e1.type; 49 type = e1.type;
43 typeCombine(sc); 50 typeCombine(sc);
58 return Id.shrass; 65 return Id.shrass;
59 } 66 }
60 67
61 override elem* toElem(IRState* irs) 68 override elem* toElem(IRState* irs)
62 { 69 {
63 return toElemBin(irs, OPshrass); 70 //printf("ShrAssignExp::toElem() %s, %s\n", e1->type->toChars(), e1->toChars());
71 Type t1 = e1.type;
72 if (e1.op == TOK.TOKcast)
73 {
74 // Use the type before it was integrally promoted to int
75 auto ce = cast(CastExp)e1;
76 t1 = ce.e1.type;
77 }
78 return toElemBin(irs, t1.isunsigned() ? OPER.OPshrass : OPER.OPashrass);
79
64 } 80 }
65 } 81 }