Mercurial > projects > ddmd
comparison dmd/CommaExp.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | cab4c37afb89 |
children | e28b18c23469 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
20 this(Loc loc, Expression e1, Expression e2) | 20 this(Loc loc, Expression e1, Expression e2) |
21 { | 21 { |
22 super(loc, TOK.TOKcomma, CommaExp.sizeof, e1, e2); | 22 super(loc, TOK.TOKcomma, CommaExp.sizeof, e1, e2); |
23 } | 23 } |
24 | 24 |
25 Expression semantic(Scope sc) | 25 override Expression semantic(Scope sc) |
26 { | 26 { |
27 if (!type) | 27 if (!type) |
28 { | 28 { |
29 BinExp.semanticp(sc); | 29 BinExp.semanticp(sc); |
30 type = e2.type; | 30 type = e2.type; |
31 } | 31 } |
32 return this; | 32 return this; |
33 } | 33 } |
34 | 34 |
35 void checkEscape() | 35 override void checkEscape() |
36 { | 36 { |
37 e2.checkEscape(); | 37 e2.checkEscape(); |
38 } | 38 } |
39 | 39 |
40 IntRange getIntRange() | 40 override IntRange getIntRange() |
41 { | 41 { |
42 assert(false); | 42 assert(false); |
43 } | 43 } |
44 | 44 |
45 version (DMDV2) { | 45 version (DMDV2) { |
46 int isLvalue() | 46 override int isLvalue() |
47 { | 47 { |
48 return e2.isLvalue(); | 48 return e2.isLvalue(); |
49 } | 49 } |
50 } | 50 } |
51 Expression toLvalue(Scope sc, Expression e) | 51 override Expression toLvalue(Scope sc, Expression e) |
52 { | 52 { |
53 e2 = e2.toLvalue(sc, null); | 53 e2 = e2.toLvalue(sc, null); |
54 return this; | 54 return this; |
55 } | 55 } |
56 | 56 |
57 Expression modifiableLvalue(Scope sc, Expression e) | 57 override Expression modifiableLvalue(Scope sc, Expression e) |
58 { | 58 { |
59 e2 = e2.modifiableLvalue(sc, e); | 59 e2 = e2.modifiableLvalue(sc, e); |
60 return this; | 60 return this; |
61 } | 61 } |
62 | 62 |
63 bool isBool(bool result) | 63 override bool isBool(bool result) |
64 { | 64 { |
65 return e2.isBool(result); | 65 return e2.isBool(result); |
66 } | 66 } |
67 | 67 |
68 bool checkSideEffect(int flag) | 68 override bool checkSideEffect(int flag) |
69 { | 69 { |
70 if (flag == 2) | 70 if (flag == 2) |
71 return e1.checkSideEffect(2) || e2.checkSideEffect(2); | 71 return e1.checkSideEffect(2) || e2.checkSideEffect(2); |
72 else | 72 else |
73 { | 73 { |
74 // Don't check e1 until we cast(void) the a,b code generation | 74 // Don't check e1 until we cast(void) the a,b code generation |
75 return e2.checkSideEffect(flag); | 75 return e2.checkSideEffect(flag); |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 MATCH implicitConvTo(Type t) | 79 override MATCH implicitConvTo(Type t) |
80 { | 80 { |
81 return e2.implicitConvTo(t); | 81 return e2.implicitConvTo(t); |
82 } | 82 } |
83 | 83 |
84 Expression castTo(Scope sc, Type t) | 84 override Expression castTo(Scope sc, Type t) |
85 { | 85 { |
86 Expression e2c = e2.castTo(sc, t); | 86 Expression e2c = e2.castTo(sc, t); |
87 Expression e; | 87 Expression e; |
88 | 88 |
89 if (e2c != e2) | 89 if (e2c != e2) |
97 e.type = e2.type; | 97 e.type = e2.type; |
98 } | 98 } |
99 return e; | 99 return e; |
100 } | 100 } |
101 | 101 |
102 Expression optimize(int result) | 102 override Expression optimize(int result) |
103 { | 103 { |
104 Expression e; | 104 Expression e; |
105 | 105 |
106 //printf("CommaExp.optimize(result = %d) %s\n", result, toChars()); | 106 //printf("CommaExp.optimize(result = %d) %s\n", result, toChars()); |
107 e1 = e1.optimize(result & WANTinterpret); | 107 e1 = e1.optimize(result & WANTinterpret); |
116 e = this; | 116 e = this; |
117 //printf("-CommaExp.optimize(result = %d) %s\n", result, e.toChars()); | 117 //printf("-CommaExp.optimize(result = %d) %s\n", result, e.toChars()); |
118 return e; | 118 return e; |
119 } | 119 } |
120 | 120 |
121 Expression interpret(InterState istate) | 121 override Expression interpret(InterState istate) |
122 { | 122 { |
123 assert(false); | 123 assert(false); |
124 } | 124 } |
125 | 125 |
126 elem* toElem(IRState* irs) | 126 override elem* toElem(IRState* irs) |
127 { | 127 { |
128 assert(e1 && e2); | 128 assert(e1 && e2); |
129 elem* eleft = e1.toElem(irs); | 129 elem* eleft = e1.toElem(irs); |
130 elem* eright = e2.toElem(irs); | 130 elem* eright = e2.toElem(irs); |
131 elem* e = el_combine(eleft, eright); | 131 elem* e = el_combine(eleft, eright); |