Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
72:d7e764e62462 | 73:b706170e24a9 |
---|---|
670 assert(n > 0); | 670 assert(n > 0); |
671 numiters = llvm::ConstantInt::get(keytype,n,false); | 671 numiters = llvm::ConstantInt::get(keytype,n,false); |
672 } | 672 } |
673 else if (aggrtype->ty == Tarray) | 673 else if (aggrtype->ty == Tarray) |
674 { | 674 { |
675 numiters = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,0,"tmp",p->scopebb())); | 675 if (arr->type == elem::SLICE) { |
676 val = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,1,"tmp",p->scopebb())); | 676 numiters = arr->arg; |
677 val = arr->mem; | |
678 } | |
679 else { | |
680 numiters = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,0,"tmp",p->scopebb())); | |
681 val = p->ir->CreateLoad(LLVM_DtoGEPi(val,0,1,"tmp",p->scopebb())); | |
682 } | |
677 } | 683 } |
678 else | 684 else |
679 { | 685 { |
680 assert(0 && "aggregate type is not Tarray or Tsarray"); | 686 assert(0 && "aggregate type is not Tarray or Tsarray"); |
681 } | 687 } |