comparison dmd/ArrayLengthExp.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
23 this(Loc loc, Expression e1) 23 this(Loc loc, Expression e1)
24 { 24 {
25 super(loc, TOK.TOKarraylength, ArrayLengthExp.sizeof, e1); 25 super(loc, TOK.TOKarraylength, ArrayLengthExp.sizeof, e1);
26 } 26 }
27 27
28 Expression semantic(Scope sc) 28 override Expression semantic(Scope sc)
29 { 29 {
30 Expression e; 30 Expression e;
31 31
32 version (LOGSEMANTIC) { 32 version (LOGSEMANTIC) {
33 printf("ArrayLengthExp::semantic('%s')\n", toChars()); 33 printf("ArrayLengthExp::semantic('%s')\n", toChars());
40 type = Type.tsize_t; 40 type = Type.tsize_t;
41 } 41 }
42 return this; 42 return this;
43 } 43 }
44 44
45 Expression optimize(int result) 45 override Expression optimize(int result)
46 { 46 {
47 //printf("ArrayLengthExp::optimize(result = %d) %s\n", result, toChars()); 47 //printf("ArrayLengthExp::optimize(result = %d) %s\n", result, toChars());
48 e1 = e1.optimize(WANTvalue | (result & WANTinterpret)); 48 e1 = e1.optimize(WANTvalue | (result & WANTinterpret));
49 Expression e = this; 49 Expression e = this;
50 if (e1.op == TOKstring || e1.op == TOKarrayliteral || e1.op == TOKassocarrayliteral) 50 if (e1.op == TOKstring || e1.op == TOKarrayliteral || e1.op == TOKassocarrayliteral)
52 e = ArrayLength(type, e1); 52 e = ArrayLength(type, e1);
53 } 53 }
54 return e; 54 return e;
55 } 55 }
56 56
57 Expression interpret(InterState istate) 57 override Expression interpret(InterState istate)
58 { 58 {
59 assert(false); 59 assert(false);
60 } 60 }
61 61
62 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 62 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
63 { 63 {
64 assert(false); 64 assert(false);
65 } 65 }
66 66
67 elem* toElem(IRState* irs) 67 override elem* toElem(IRState* irs)
68 { 68 {
69 elem *e = e1.toElem(irs); 69 elem *e = e1.toElem(irs);
70 e = el_una(OP64_32, type.totym(), e); 70 e = el_una(OP64_32, type.totym(), e);
71 el_setLoc(e,loc); 71 el_setLoc(e,loc);
72 return e; 72 return e;