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