Mercurial > projects > ldc
diff gen/arrays.c @ 51:61bc1b4ad3c4 trunk
[svn r55] Foreach was always generating code as if the value variable was 'ref'
Other not-so-major improvements
author | lindquist |
---|---|
date | Mon, 22 Oct 2007 17:25:44 +0200 |
parents | 4d171915a77b |
children | 0c77619e803b |
line wrap: on
line diff
--- a/gen/arrays.c Mon Oct 22 15:40:56 2007 +0200 +++ b/gen/arrays.c Mon Oct 22 17:25:44 2007 +0200 @@ -445,16 +445,8 @@ elem* e = exp->toElem(gIR); Type* et = LLVM_DtoDType(exp->type); - - if (et->ty == Tstruct) { - TypeStruct* ts = (TypeStruct*)et; - LLVM_DtoStructCopy(ts,ptr,e->getValue()); - } - else { - llvm::Value* val = e->getValue(); - Logger::cout() << "ptr = '" << *ptr << "' element = '" << *val << "'\n"; - new llvm::StoreInst(val, ptr, gIR->scopebb()); - } + LLVM_DtoAssign(et, ptr, e->getValue()); + delete e; } //////////////////////////////////////////////////////////////////////////////////////////