Mercurial > projects > ddmd
comparison dmd/AndAndExp.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 |
---|---|
24 this(Loc loc, Expression e1, Expression e2) | 24 this(Loc loc, Expression e1, Expression e2) |
25 { | 25 { |
26 super(loc, TOK.TOKandand, AndAndExp.sizeof, e1, e2); | 26 super(loc, TOK.TOKandand, AndAndExp.sizeof, e1, e2); |
27 } | 27 } |
28 | 28 |
29 Expression semantic(Scope sc) | 29 override Expression semantic(Scope sc) |
30 { | 30 { |
31 uint cs1; | 31 uint cs1; |
32 | 32 |
33 // same as for OrOr | 33 // same as for OrOr |
34 e1 = e1.semantic(sc); | 34 e1 = e1.semantic(sc); |
59 if (e2.op == TOKtype || e2.op == TOKimport) | 59 if (e2.op == TOKtype || e2.op == TOKimport) |
60 error("%s is not an expression", e2.toChars()); | 60 error("%s is not an expression", e2.toChars()); |
61 return this; | 61 return this; |
62 } | 62 } |
63 | 63 |
64 Expression checkToBoolean() | 64 override Expression checkToBoolean() |
65 { | 65 { |
66 e2 = e2.checkToBoolean(); | 66 e2 = e2.checkToBoolean(); |
67 return this; | 67 return this; |
68 } | 68 } |
69 | 69 |
70 int isBit() | 70 override int isBit() |
71 { | 71 { |
72 assert(false); | 72 assert(false); |
73 } | 73 } |
74 | 74 |
75 Expression optimize(int result) | 75 override Expression optimize(int result) |
76 { | 76 { |
77 //printf("AndAndExp::optimize(%d) %s\n", result, toChars()); | 77 //printf("AndAndExp::optimize(%d) %s\n", result, toChars()); |
78 e1 = e1.optimize(WANTflags | (result & WANTinterpret)); | 78 e1 = e1.optimize(WANTflags | (result & WANTinterpret)); |
79 Expression e = this; | 79 Expression e = this; |
80 if (e1.isBool(false)) | 80 if (e1.isBool(false)) |
103 } | 103 } |
104 } | 104 } |
105 return e; | 105 return e; |
106 } | 106 } |
107 | 107 |
108 Expression interpret(InterState istate) | 108 override Expression interpret(InterState istate) |
109 { | 109 { |
110 assert(false); | 110 assert(false); |
111 } | 111 } |
112 | 112 |
113 bool checkSideEffect(int flag) | 113 override bool checkSideEffect(int flag) |
114 { | 114 { |
115 assert(false); | 115 assert(false); |
116 } | 116 } |
117 | 117 |
118 elem* toElem(IRState* irs) | 118 override elem* toElem(IRState* irs) |
119 { | 119 { |
120 elem* e = toElemBin(irs, OPandand); | 120 elem* e = toElemBin(irs, OPandand); |
121 if (global.params.cov && e2.loc.linnum) | 121 if (global.params.cov && e2.loc.linnum) |
122 e.E2() = el_combine(incUsageElem(irs, e2.loc), e.E2); | 122 e.E2() = el_combine(incUsageElem(irs, e2.loc), e.E2); |
123 return e; | 123 return e; |