Mercurial > projects > ldc
diff gen/statements.c @ 73:b706170e24a9 trunk
[svn r77] Fixed foreach on slice.
Fixed some nested function problems when accessing outer function parameters.
Major changes to handling of structs.
Initial support for unions.
Probably more...
author | lindquist |
---|---|
date | Wed, 31 Oct 2007 03:11:32 +0100 |
parents | 28e99b04a132 |
children | 2332006e1fa4 |
line wrap: on
line diff
--- a/gen/statements.c Mon Oct 29 03:28:12 2007 +0100 +++ b/gen/statements.c Wed Oct 31 03:11:32 2007 +0100 @@ -672,8 +672,14 @@ } else if (aggrtype->ty == Tarray) { - numiters = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,0,"tmp",p->scopebb())); - val = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,1,"tmp",p->scopebb())); + if (arr->type == elem::SLICE) { + numiters = arr->arg; + val = arr->mem; + } + else { + numiters = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,0,"tmp",p->scopebb())); + val = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,1,"tmp",p->scopebb())); + } } else {