comparison gen/typinf.cpp @ 1147:dbe4af57b240

Changed use of toObjFile to a new codegen method. More versioning of DMD specific codegen code.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Fri, 27 Mar 2009 17:54:27 +0100
parents 1860414bf3b7
children 3d1b16dabd25
comparison
equal deleted inserted replaced
1146:1860414bf3b7 1147:dbe4af57b240
136 Module *m = sc->module->importedFrom; 136 Module *m = sc->module->importedFrom;
137 m->members->push(t->vtinfo); 137 m->members->push(t->vtinfo);
138 } 138 }
139 else // if in obj generation pass 139 else // if in obj generation pass
140 { 140 {
141 #if IN_DMD
141 t->vtinfo->toObjFile(0); // TODO: multiobj 142 t->vtinfo->toObjFile(0); // TODO: multiobj
143 #else
144 t->vtinfo->codegen(sir);
145 #endif
142 } 146 }
143 } 147 }
144 } 148 }
145 e = new VarExp(0, t->vtinfo); 149 e = new VarExp(0, t->vtinfo);
146 //e = e->addressOf(sc); 150 e = e->addressOf(sc);
147 //e->type = t->vtinfo->type; // do this so we don't get redundant dereference 151 e->type = t->vtinfo->type; // do this so we don't get redundant dereference
148 return e; 152 return e;
149 } 153 }
150 154
151 enum RET TypeFunction::retStyle() 155 enum RET TypeFunction::retStyle()
152 { 156 {
265 269
266 ////////////////////////////////////////////////////////////////////////////// 270 //////////////////////////////////////////////////////////////////////////////
267 // MAGIC PLACE 271 // MAGIC PLACE
268 ////////////////////////////////////////////////////////////////////////////// 272 //////////////////////////////////////////////////////////////////////////////
269 273
270 void TypeInfoDeclaration::toObjFile(int multiobj)
271 {
272 gIR->resolveList.push_back(this);
273 }
274
275 void DtoResolveTypeInfo(TypeInfoDeclaration* tid) 274 void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
276 { 275 {
277 if (tid->ir.resolved) return; 276 if (tid->ir.resolved) return;
278 tid->ir.resolved = true; 277 tid->ir.resolved = true;
279 278
281 LOG_SCOPE; 280 LOG_SCOPE;
282 281
283 tid->ir.irGlobal = new IrGlobal(tid); 282 tid->ir.irGlobal = new IrGlobal(tid);
284 283
285 gIR->declareList.push_back(tid); 284 gIR->declareList.push_back(tid);
285 }
286
287 void TypeInfoDeclaration::codegen(Ir*)
288 {
289 DtoResolveTypeInfo(this);
286 } 290 }
287 291
288 void DtoDeclareTypeInfo(TypeInfoDeclaration* tid) 292 void DtoDeclareTypeInfo(TypeInfoDeclaration* tid)
289 { 293 {
290 if (tid->ir.declared) return; 294 if (tid->ir.declared) return;