Mercurial > projects > ddmd
comparison dmd/IndexExp.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 | ef02e2e203c2 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
53 { | 53 { |
54 super(loc, TOK.TOKindex, IndexExp.sizeof, e1, e2); | 54 super(loc, TOK.TOKindex, IndexExp.sizeof, e1, e2); |
55 //printf("IndexExp.IndexExp('%s')\n", toChars()); | 55 //printf("IndexExp.IndexExp('%s')\n", toChars()); |
56 } | 56 } |
57 | 57 |
58 Expression semantic(Scope sc) | 58 override Expression semantic(Scope sc) |
59 { | 59 { |
60 Expression e; | 60 Expression e; |
61 BinExp b; | 61 BinExp b; |
62 UnaExp u; | 62 UnaExp u; |
63 Type t1; | 63 Type t1; |
182 } | 182 } |
183 | 183 |
184 return e; | 184 return e; |
185 } | 185 } |
186 | 186 |
187 int isLvalue() | 187 override int isLvalue() |
188 { | 188 { |
189 assert(false); | 189 assert(false); |
190 } | 190 } |
191 | 191 |
192 Expression toLvalue(Scope sc, Expression e) | 192 override Expression toLvalue(Scope sc, Expression e) |
193 { | 193 { |
194 // if (type && type.toBasetype().ty == Tvoid) | 194 // if (type && type.toBasetype().ty == Tvoid) |
195 // error("voids have no value"); | 195 // error("voids have no value"); |
196 return this; | 196 return this; |
197 } | 197 } |
198 | 198 |
199 Expression modifiableLvalue(Scope sc, Expression e) | 199 override Expression modifiableLvalue(Scope sc, Expression e) |
200 { | 200 { |
201 //printf("IndexExp::modifiableLvalue(%s)\n", toChars()); | 201 //printf("IndexExp::modifiableLvalue(%s)\n", toChars()); |
202 modifiable = 1; | 202 modifiable = 1; |
203 if (e1.op == TOKstring) | 203 if (e1.op == TOKstring) |
204 error("string literals are immutable"); | 204 error("string literals are immutable"); |
207 if (e1.type.toBasetype().ty == Taarray) | 207 if (e1.type.toBasetype().ty == Taarray) |
208 e1 = e1.modifiableLvalue(sc, e1); | 208 e1 = e1.modifiableLvalue(sc, e1); |
209 return toLvalue(sc, e); | 209 return toLvalue(sc, e); |
210 } | 210 } |
211 | 211 |
212 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 212 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
213 { | 213 { |
214 assert(false); | 214 assert(false); |
215 } | 215 } |
216 | 216 |
217 Expression optimize(int result) | 217 override Expression optimize(int result) |
218 { | 218 { |
219 Expression e; | 219 Expression e; |
220 | 220 |
221 //printf("IndexExp::optimize(result = %d) %s\n", result, toChars()); | 221 //printf("IndexExp::optimize(result = %d) %s\n", result, toChars()); |
222 Expression e1 = this.e1.optimize(WANTvalue | (result & WANTinterpret)); | 222 Expression e1 = this.e1.optimize(WANTvalue | (result & WANTinterpret)); |
240 e = this; | 240 e = this; |
241 | 241 |
242 return e; | 242 return e; |
243 } | 243 } |
244 | 244 |
245 Expression interpret(InterState istate) | 245 override Expression interpret(InterState istate) |
246 { | 246 { |
247 assert(false); | 247 assert(false); |
248 } | 248 } |
249 | 249 |
250 Expression doInline(InlineDoState ids) | 250 override Expression doInline(InlineDoState ids) |
251 { | 251 { |
252 IndexExp are = cast(IndexExp)copy(); | 252 IndexExp are = cast(IndexExp)copy(); |
253 | 253 |
254 are.e1 = e1.doInline(ids); | 254 are.e1 = e1.doInline(ids); |
255 | 255 |
282 } | 282 } |
283 are.e2 = e2.doInline(ids); | 283 are.e2 = e2.doInline(ids); |
284 return are; | 284 return are; |
285 } | 285 } |
286 | 286 |
287 void scanForNestedRef(Scope sc) | 287 override void scanForNestedRef(Scope sc) |
288 { | 288 { |
289 assert(false); | 289 assert(false); |
290 } | 290 } |
291 | 291 |
292 elem* toElem(IRState* irs) | 292 override elem* toElem(IRState* irs) |
293 { | 293 { |
294 elem* e; | 294 elem* e; |
295 elem* n1 = e1.toElem(irs); | 295 elem* n1 = e1.toElem(irs); |
296 elem* n2; | 296 elem* n2; |
297 elem* eb = null; | 297 elem* eb = null; |