0
|
1 module dmd.ShlAssignExp;
|
|
2
|
114
|
3 import dmd.common;
|
0
|
4 import dmd.BinExp;
|
|
5 import dmd.Loc;
|
|
6 import dmd.Expression;
|
|
7 import dmd.Scope;
|
|
8 import dmd.InterState;
|
|
9 import dmd.Identifier;
|
|
10 import dmd.IRState;
|
|
11 import dmd.TOK;
|
|
12 import dmd.Id;
|
|
13 import dmd.Type;
|
|
14 import dmd.backend.elem;
|
|
15 import dmd.backend.OPER;
|
117
|
16 import dmd.expression.Shl;
|
0
|
17 import dmd.expression.Util;
|
|
18
|
|
19 class ShlAssignExp : BinExp
|
|
20 {
|
|
21 this(Loc loc, Expression e1, Expression e2)
|
|
22 {
|
|
23 super(loc, TOK.TOKshlass, ShlAssignExp.sizeof, e1, e2);
|
|
24 }
|
|
25
|
72
|
26 override Expression semantic(Scope sc)
|
0
|
27 {
|
|
28 Expression e;
|
|
29
|
|
30 //printf("ShlAssignExp.semantic()\n");
|
|
31 BinExp.semantic(sc);
|
|
32 e2 = resolveProperties(sc, e2);
|
|
33
|
|
34 e = op_overload(sc);
|
|
35 if (e)
|
|
36 return e;
|
|
37
|
|
38 e1 = e1.modifiableLvalue(sc, e1);
|
|
39 e1.checkScalar();
|
|
40 e1.checkNoBool();
|
|
41 type = e1.type;
|
|
42 typeCombine(sc);
|
|
43 e1.checkIntegral();
|
|
44 e2 = e2.checkIntegral();
|
|
45 e2 = e2.castTo(sc, Type.tshiftcnt);
|
|
46 return this;
|
|
47 }
|
|
48
|
72
|
49 override Expression interpret(InterState istate)
|
0
|
50 {
|
117
|
51 return interpretAssignCommon(istate, &Shl);
|
0
|
52 }
|
|
53
|
72
|
54 override Identifier opId() /* For operator overloading */
|
0
|
55 {
|
|
56 return Id.shlass;
|
|
57 }
|
|
58
|
72
|
59 override elem* toElem(IRState* irs)
|
0
|
60 {
|
|
61 return toElemBin(irs,OPshlass);
|
|
62 }
|
72
|
63 }
|