comparison gen/toir.cpp @ 162:1856c62af24b trunk

[svn r178] Fixed codegen values for function arguments, the old approach was completely broken, amazing it even worked...
author lindquist
date Mon, 05 May 2008 00:56:53 +0200
parents ccd07d9f2ce9
children a8cd9bc1021a
comparison
equal deleted inserted replaced
161:3a891cfcd249 162:1856c62af24b
251 Type* sdecltype = DtoDType(sdecl->type); 251 Type* sdecltype = DtoDType(sdecl->type);
252 Logger::print("Sym: type=%s\n", sdecltype->toChars()); 252 Logger::print("Sym: type=%s\n", sdecltype->toChars());
253 assert(sdecltype->ty == Tstruct); 253 assert(sdecltype->ty == Tstruct);
254 TypeStruct* ts = (TypeStruct*)sdecltype; 254 TypeStruct* ts = (TypeStruct*)sdecltype;
255 assert(ts->sym); 255 assert(ts->sym);
256 DtoForceConstInitDsymbol(ts->sym);
256 assert(gIR->irDsymbol[ts->sym].irStruct->init); 257 assert(gIR->irDsymbol[ts->sym].irStruct->init);
257 return new DVarValue(type, gIR->irDsymbol[ts->sym].irStruct->init, true); 258 return new DVarValue(type, gIR->irDsymbol[ts->sym].irStruct->init, true);
258 } 259 }
259 else 260 else
260 { 261 {
2281 Type* t1 = DtoDType(e1->type); 2282 Type* t1 = DtoDType(e1->type);
2282 2283
2283 llvm::Value* eval = 0; 2284 llvm::Value* eval = 0;
2284 2285
2285 if (t1->ty == Tarray) { 2286 if (t1->ty == Tarray) {
2287 if (v->isNull()) {
2288 r = NULL;
2289 }
2290 else {
2291 assert(l->getType() == r->getType());
2292 }
2293 eval = DtoDynArrayIs(op,l,r);
2294 }
2295 else if (t1->ty == Tdelegate) {
2286 if (v->isNull()) { 2296 if (v->isNull()) {
2287 r = NULL; 2297 r = NULL;
2288 } 2298 }
2289 else { 2299 else {
2290 assert(l->getType() == r->getType()); 2300 assert(l->getType() == r->getType());