comparison dmd/SymOffExp.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 4290d870944a
children ef02e2e203c2
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
36 VarDeclaration v = var.isVarDeclaration(); 36 VarDeclaration v = var.isVarDeclaration();
37 if (v && v.needThis()) 37 if (v && v.needThis())
38 error("need 'this' for address of %s", v.toChars()); 38 error("need 'this' for address of %s", v.toChars());
39 } 39 }
40 40
41 Expression semantic(Scope sc) 41 override Expression semantic(Scope sc)
42 { 42 {
43 version(LOGSEMANTIC) { 43 version(LOGSEMANTIC) {
44 printf("SymOffExp::semantic('%s')\n", toChars()); 44 printf("SymOffExp::semantic('%s')\n", toChars());
45 } 45 }
46 //var.semantic(sc); 46 //var.semantic(sc);
50 if (v) 50 if (v)
51 v.checkNestedReference(sc, loc); 51 v.checkNestedReference(sc, loc);
52 return this; 52 return this;
53 } 53 }
54 54
55 void checkEscape() 55 override void checkEscape()
56 { 56 {
57 VarDeclaration v = var.isVarDeclaration(); 57 VarDeclaration v = var.isVarDeclaration();
58 if (v) 58 if (v)
59 { 59 {
60 if (!v.isDataseg()) 60 if (!v.isDataseg())
61 error("escaping reference to local variable %s", v.toChars()); 61 error("escaping reference to local variable %s", v.toChars());
62 } 62 }
63 } 63 }
64 64
65 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 65 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
66 { 66 {
67 assert(false); 67 assert(false);
68 } 68 }
69 69
70 int isConst() 70 override int isConst()
71 { 71 {
72 return 2; 72 return 2;
73 } 73 }
74 74
75 bool isBool(bool result) 75 override bool isBool(bool result)
76 { 76 {
77 assert(false); 77 assert(false);
78 } 78 }
79 79
80 Expression doInline(InlineDoState ids) 80 override Expression doInline(InlineDoState ids)
81 { 81 {
82 int i; 82 int i;
83 83
84 //printf("SymOffExp.doInline(%s)\n", toChars()); 84 //printf("SymOffExp.doInline(%s)\n", toChars());
85 for (i = 0; i < ids.from.dim; i++) 85 for (i = 0; i < ids.from.dim; i++)
93 } 93 }
94 } 94 }
95 return this; 95 return this;
96 } 96 }
97 97
98 MATCH implicitConvTo(Type t) 98 override MATCH implicitConvTo(Type t)
99 { 99 {
100 static if (false) { 100 static if (false) {
101 printf("SymOffExp::implicitConvTo(this=%s, type=%s, t=%s)\n", toChars(), type.toChars(), t.toChars()); 101 printf("SymOffExp::implicitConvTo(this=%s, type=%s, t=%s)\n", toChars(), type.toChars(), t.toChars());
102 } 102 }
103 MATCH result = type.implicitConvTo(t); 103 MATCH result = type.implicitConvTo(t);
129 } 129 }
130 //printf("\tresult = %d\n", result); 130 //printf("\tresult = %d\n", result);
131 return result; 131 return result;
132 } 132 }
133 133
134 Expression castTo(Scope sc, Type t) 134 override Expression castTo(Scope sc, Type t)
135 { 135 {
136 static if (false) { 136 static if (false) {
137 printf("SymOffExp::castTo(this=%s, type=%s, t=%s)\n", toChars(), type.toChars(), t.toChars()); 137 printf("SymOffExp::castTo(this=%s, type=%s, t=%s)\n", toChars(), type.toChars(), t.toChars());
138 } 138 }
139 if (type == t && hasOverloads == 0) 139 if (type == t && hasOverloads == 0)
202 (cast(SymOffExp)e).hasOverloads = 0; 202 (cast(SymOffExp)e).hasOverloads = 0;
203 } 203 }
204 return e; 204 return e;
205 } 205 }
206 206
207 void scanForNestedRef(Scope sc) 207 override void scanForNestedRef(Scope sc)
208 { 208 {
209 //printf("SymOffExp.scanForNestedRef(%s)\n", toChars()); 209 //printf("SymOffExp.scanForNestedRef(%s)\n", toChars());
210 VarDeclaration v = var.isVarDeclaration(); 210 VarDeclaration v = var.isVarDeclaration();
211 if (v) 211 if (v)
212 v.checkNestedReference(sc, Loc(0)); 212 v.checkNestedReference(sc, Loc(0));
213 } 213 }
214 214
215 dt_t** toDt(dt_t** pdt) 215 override dt_t** toDt(dt_t** pdt)
216 { 216 {
217 //printf("SymOffExp.toDt('%s')\n", var.toChars()); 217 //printf("SymOffExp.toDt('%s')\n", var.toChars());
218 assert(var); 218 assert(var);
219 if (!(var.isDataseg() || var.isCodeseg()) || 219 if (!(var.isDataseg() || var.isCodeseg()) ||
220 var.needThis() || 220 var.needThis() ||