Mercurial > projects > ddmd
comparison dmd/TupleExp.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 | be2ab491772e |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
111 error("%s is not an expression", o.toString()); | 111 error("%s is not an expression", o.toString()); |
112 } | 112 } |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 Expression syntaxCopy() | 116 override Expression syntaxCopy() |
117 { | 117 { |
118 return new TupleExp(loc, arraySyntaxCopy(exps)); | 118 return new TupleExp(loc, arraySyntaxCopy(exps)); |
119 } | 119 } |
120 | 120 |
121 bool equals(Object o) | 121 override bool equals(Object o) |
122 { | 122 { |
123 TupleExp ne; | 123 TupleExp ne; |
124 | 124 |
125 if (this == o) | 125 if (this == o) |
126 return 1; | 126 return 1; |
139 return 1; | 139 return 1; |
140 } | 140 } |
141 return 0; | 141 return 0; |
142 } | 142 } |
143 | 143 |
144 Expression semantic(Scope sc) | 144 override Expression semantic(Scope sc) |
145 { | 145 { |
146 version (LOGSEMANTIC) { | 146 version (LOGSEMANTIC) { |
147 printf("+TupleExp::semantic(%s)\n", toChars()); | 147 printf("+TupleExp::semantic(%s)\n", toChars()); |
148 } | 148 } |
149 if (type) | 149 if (type) |
170 type = type.semantic(loc, sc); | 170 type = type.semantic(loc, sc); |
171 //printf("-TupleExp::semantic(%s)\n", toChars()); | 171 //printf("-TupleExp::semantic(%s)\n", toChars()); |
172 return this; | 172 return this; |
173 } | 173 } |
174 | 174 |
175 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 175 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
176 { | 176 { |
177 buf.writestring("tuple("); | 177 buf.writestring("tuple("); |
178 argsToCBuffer(buf, exps, hgs); | 178 argsToCBuffer(buf, exps, hgs); |
179 buf.writeByte(')'); | 179 buf.writeByte(')'); |
180 } | 180 } |
181 | 181 |
182 void scanForNestedRef(Scope sc) | 182 override void scanForNestedRef(Scope sc) |
183 { | 183 { |
184 assert(false); | 184 assert(false); |
185 } | 185 } |
186 | 186 |
187 void checkEscape() | 187 override void checkEscape() |
188 { | 188 { |
189 for (size_t i = 0; i < exps.dim; i++) | 189 for (size_t i = 0; i < exps.dim; i++) |
190 { Expression e = cast(Expression)exps.data[i]; | 190 { Expression e = cast(Expression)exps.data[i]; |
191 e.checkEscape(); | 191 e.checkEscape(); |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 bool checkSideEffect(int flag) | 195 override bool checkSideEffect(int flag) |
196 { | 196 { |
197 bool f = false; | 197 bool f = false; |
198 | 198 |
199 for (int i = 0; i < exps.dim; i++) | 199 for (int i = 0; i < exps.dim; i++) |
200 { Expression e = cast(Expression)exps.data[i]; | 200 { Expression e = cast(Expression)exps.data[i]; |
204 if (flag == 0 && f == 0) | 204 if (flag == 0 && f == 0) |
205 Expression.checkSideEffect(0); | 205 Expression.checkSideEffect(0); |
206 return f; | 206 return f; |
207 } | 207 } |
208 | 208 |
209 Expression optimize(int result) | 209 override Expression optimize(int result) |
210 { | 210 { |
211 for (size_t i = 0; i < exps.dim; i++) | 211 for (size_t i = 0; i < exps.dim; i++) |
212 { | 212 { |
213 Expression e = cast(Expression)exps.data[i]; | 213 Expression e = cast(Expression)exps.data[i]; |
214 | 214 |
216 exps.data[i] = cast(void*)e; | 216 exps.data[i] = cast(void*)e; |
217 } | 217 } |
218 return this; | 218 return this; |
219 } | 219 } |
220 | 220 |
221 Expression interpret(InterState istate) | 221 override Expression interpret(InterState istate) |
222 { | 222 { |
223 assert(false); | 223 assert(false); |
224 } | 224 } |
225 | 225 |
226 Expression castTo(Scope sc, Type t) | 226 override Expression castTo(Scope sc, Type t) |
227 { | 227 { |
228 assert(false); | 228 assert(false); |
229 } | 229 } |
230 | 230 |
231 elem* toElem(IRState* irs) | 231 override elem* toElem(IRState* irs) |
232 { | 232 { |
233 assert(false); | 233 assert(false); |
234 } | 234 } |
235 | 235 |
236 bool canThrow() | 236 override bool canThrow() |
237 { | 237 { |
238 return arrayExpressionCanThrow(exps); | 238 return arrayExpressionCanThrow(exps); |
239 } | 239 } |
240 | 240 |
241 int inlineCost(InlineCostState* ics) | 241 override int inlineCost(InlineCostState* ics) |
242 { | 242 { |
243 assert(false); | 243 assert(false); |
244 } | 244 } |
245 | 245 |
246 Expression doInline(InlineDoState ids) | 246 override Expression doInline(InlineDoState ids) |
247 { | 247 { |
248 assert(false); | 248 assert(false); |
249 } | 249 } |
250 | 250 |
251 Expression inlineScan(InlineScanState* iss) | 251 override Expression inlineScan(InlineScanState* iss) |
252 { | 252 { |
253 assert(false); | 253 assert(false); |
254 } | 254 } |
255 } | 255 } |
256 | 256 |