# HG changeset patch # User lindquist # Date 1210625065 -7200 # Node ID 8f9191180c7af104e21f16071fcb3b73738c6028 # Parent e937752e4541b376b6ab065257d193910f229196 [svn r217] Updated: the rebuild profiles. Fixed: way to find class data fields was too strict type wise. Fixed: foreach resulting in an implicit delegate could fail. diff -r e937752e4541 -r 8f9191180c7a gen/classes.cpp --- a/gen/classes.cpp Mon May 12 22:27:05 2008 +0200 +++ b/gen/classes.cpp Mon May 12 22:44:25 2008 +0200 @@ -1153,7 +1153,7 @@ Type* vdtype = DtoDType(vd->type); //Logger::println("found %u type %s", vd->offset, vdtype->toChars()); assert(vd->ir.irField->index >= 0); - if (os == vd->offset && vdtype == t) { + if (os == vd->offset && vdtype->toBasetype() == t->toBasetype()) { Logger::println("found %s %s", vdtype->toChars(), vd->toChars()); idxs.push_back(vd->ir.irField->index + dataoffset); //Logger::cout() << "indexing: " << *ptr << '\n'; diff -r e937752e4541 -r 8f9191180c7a gen/statements.cpp --- a/gen/statements.cpp Mon May 12 22:27:05 2008 +0200 +++ b/gen/statements.cpp Mon May 12 22:44:25 2008 +0200 @@ -842,12 +842,13 @@ llvm::Value* zerokey = llvm::ConstantInt::get(keytype,0,false); // value + Logger::println("value = %s", value->toPrettyChars()); const llvm::Type* valtype = DtoType(value->type); llvm::Value* valvar = NULL; if (!value->isRef() && !value->isOut()) valvar = new llvm::AllocaInst(valtype, "foreachval", p->topallocapoint()); - assert(!value->ir.irLocal); - value->ir.irLocal = new IrLocal(value); + if (!value->ir.irLocal) + value->ir.irLocal = new IrLocal(value); // what to iterate DValue* aggrval = aggr->toElem(p); diff -r e937752e4541 -r 8f9191180c7a gen/toir.cpp --- a/gen/toir.cpp Mon May 12 22:27:05 2008 +0200 +++ b/gen/toir.cpp Mon May 12 22:44:25 2008 +0200 @@ -1246,7 +1246,10 @@ return v; } - else if (u->isLRValue() || (u->isVar() && u->isVar()->lval)) + else if (DLRValue* lr = u->isLRValue()) + return new DLRValue(lr->getLType(), lr->getLVal(), to, v->getRVal()); + + else if (u->isVar() && u->isVar()->lval) return new DLRValue(e1->type, u->getLVal(), to, v->getRVal()); else if (gIR->topexp() && gIR->topexp()->e1 == this) diff -r e937752e4541 -r 8f9191180c7a gen/tollvm.cpp --- a/gen/tollvm.cpp Mon May 12 22:27:05 2008 +0200 +++ b/gen/tollvm.cpp Mon May 12 22:44:25 2008 +0200 @@ -1006,11 +1006,16 @@ Logger::cout() << "assign\nlhs: " << *l << "rhs: " << *r << '\n'; const llvm::Type* lit = l->getType()->getContainedType(0); if (r->getType() != lit) { - if (DLRValue* lr = lhs->isLRValue()) // handle lvalue cast assignments + // handle lvalue cast assignments + if (DLRValue* lr = lhs->isLRValue()) { + Logger::println("lvalue cast!"); r = DtoCast(rhs, lr->getLType())->getRVal(); - else + } + else { r = DtoCast(rhs, lhs->getType())->getRVal(); + } Logger::cout() << "really assign\nlhs: " << *l << "rhs: " << *r << '\n'; + assert(r->getType() == l->getType()->getContainedType(0)); } gIR->ir->CreateStore(r, l); } diff -r e937752e4541 -r 8f9191180c7a llvmdc-posix-internal --- a/llvmdc-posix-internal Mon May 12 22:27:05 2008 +0200 +++ b/llvmdc-posix-internal Mon May 12 22:44:25 2008 +0200 @@ -43,7 +43,7 @@ [link] -oneatatime=yes +#oneatatime=yes cmd=llvmdc $i -of$o libdir=-L-L$i @@ -53,7 +53,7 @@ [liblink] safe=yes -oneatatime=yes +#oneatatime=yes cmd=llvm-link -f -o=$o $i libdir= @@ -67,7 +67,7 @@ [shliblink] shlibs=no -oneatatime=yes +#oneatatime=yes cmd=llvm-link $i | llc -filetype=dynlib -f -o=$o libdir= diff -r e937752e4541 -r 8f9191180c7a llvmdc-tango --- a/llvmdc-tango Mon May 12 22:27:05 2008 +0200 +++ b/llvmdc-tango Mon May 12 22:44:25 2008 +0200 @@ -7,12 +7,13 @@ objext=bc +version=LLVM version=LLVMDC noversion=DigitalMars noversion=GNU testversion=linux testversion=Unix -testversion=Posix +version=Posix testversion=Windows testversion=Win32 testversion=Win64 @@ -41,7 +42,7 @@ [link] -oneatatime=yes +#oneatatime=yes cmd=llvmdc $i -of$o libdir=-L-L=$i @@ -51,7 +52,7 @@ [liblink] safe=yes -oneatatime=yes +#oneatatime=yes cmd=llvm-ar rsc $o $i libdir=-L=$i