comparison dmd/DeclarationExp.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 ad4792a1cfd6
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
33 { 33 {
34 super(loc, TOK.TOKdeclaration, DeclarationExp.sizeof); 34 super(loc, TOK.TOKdeclaration, DeclarationExp.sizeof);
35 this.declaration = declaration; 35 this.declaration = declaration;
36 } 36 }
37 37
38 Expression syntaxCopy() 38 override Expression syntaxCopy()
39 { 39 {
40 return new DeclarationExp(loc, declaration.syntaxCopy(null)); 40 return new DeclarationExp(loc, declaration.syntaxCopy(null));
41 } 41 }
42 42
43 Expression semantic(Scope sc) 43 override Expression semantic(Scope sc)
44 { 44 {
45 if (type) 45 if (type)
46 return this; 46 return this;
47 47
48 version (LOGSEMANTIC) { 48 version (LOGSEMANTIC) {
118 118
119 type = Type.tvoid; 119 type = Type.tvoid;
120 return this; 120 return this;
121 } 121 }
122 122
123 Expression interpret(InterState istate) 123 override Expression interpret(InterState istate)
124 { 124 {
125 version (LOG) { 125 version (LOG) {
126 printf("DeclarationExp.interpret() %s\n", toChars()); 126 printf("DeclarationExp.interpret() %s\n", toChars());
127 } 127 }
128 Expression e; 128 Expression e;
168 printf("-DeclarationExp.interpret(%.*s): %p\n", toChars(), e); 168 printf("-DeclarationExp.interpret(%.*s): %p\n", toChars(), e);
169 } 169 }
170 return e; 170 return e;
171 } 171 }
172 172
173 bool checkSideEffect(int flag) 173 override bool checkSideEffect(int flag)
174 { 174 {
175 return true; 175 return true;
176 } 176 }
177 177
178 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 178 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
179 { 179 {
180 declaration.toCBuffer(buf, hgs); 180 declaration.toCBuffer(buf, hgs);
181 } 181 }
182 182
183 elem* toElem(IRState* irs) 183 override elem* toElem(IRState* irs)
184 { 184 {
185 //printf("DeclarationExp::toElem() %s\n", toChars()); 185 //printf("DeclarationExp::toElem() %s\n", toChars());
186 elem* e = Dsymbol_toElem(declaration, irs); 186 elem* e = Dsymbol_toElem(declaration, irs);
187 return e; 187 return e;
188 } 188 }
189 189
190 void scanForNestedRef(Scope sc) 190 override void scanForNestedRef(Scope sc)
191 { 191 {
192 assert(false); 192 assert(false);
193 } 193 }
194 194
195 version (DMDV2) { 195 version (DMDV2) {
196 bool canThrow() 196 override bool canThrow()
197 { 197 {
198 VarDeclaration v = declaration.isVarDeclaration(); 198 VarDeclaration v = declaration.isVarDeclaration();
199 if (v && v.init) 199 if (v && v.init)
200 { 200 {
201 ExpInitializer ie = v.init.isExpInitializer(); 201 ExpInitializer ie = v.init.isExpInitializer();
203 } 203 }
204 204
205 return false; 205 return false;
206 } 206 }
207 } 207 }
208 int inlineCost(InlineCostState* ics) 208 override int inlineCost(InlineCostState* ics)
209 { 209 {
210 int cost = 0; 210 int cost = 0;
211 VarDeclaration vd; 211 VarDeclaration vd;
212 212
213 //printf("DeclarationExp.inlineCost()\n"); 213 //printf("DeclarationExp.inlineCost()\n");
262 262
263 //printf("DeclarationExp.inlineCost('%s')\n", toChars()); 263 //printf("DeclarationExp.inlineCost('%s')\n", toChars());
264 return cost; 264 return cost;
265 } 265 }
266 266
267 Expression doInline(InlineDoState ids) 267 override Expression doInline(InlineDoState ids)
268 { 268 {
269 DeclarationExp de = cast(DeclarationExp)copy(); 269 DeclarationExp de = cast(DeclarationExp)copy();
270 VarDeclaration vd; 270 VarDeclaration vd;
271 271
272 //printf("DeclarationExp.doInline(%s)\n", toChars()); 272 //printf("DeclarationExp.doInline(%s)\n", toChars());
325 * to handle TemplateMixin's. For now, we just don't inline them. 325 * to handle TemplateMixin's. For now, we just don't inline them.
326 */ 326 */
327 return de; 327 return de;
328 } 328 }
329 329
330 Expression inlineScan(InlineScanState* iss) 330 override Expression inlineScan(InlineScanState* iss)
331 { 331 {
332 //printf("DeclarationExp.inlineScan()\n"); 332 //printf("DeclarationExp.inlineScan()\n");
333 scanVar(declaration, iss); 333 scanVar(declaration, iss);
334 return this; 334 return this;
335 } 335 }