Add _d_newarrayvT and _d_newarraymvT to create arrays without initialization.

Adjust DtoNewDynArray to use DtoArrayInit for initialization of new arrays.
Make Type::tvoid->defaultInit() not error.
This commit is contained in:
Christian Kamm
2008-09-14 10:13:50 +02:00
parent e0635f1707
commit 30c9af1945
6 changed files with 118 additions and 22 deletions

View File

@@ -1452,7 +1452,7 @@ DValue* NewExp::toElem(IRState* p)
{
DValue* sz = ((Expression*)arguments->data[0])->toElem(p);
// allocate & init
return DtoNewDynArray(newtype, sz, true);
return DtoNewDynArray(loc, newtype, sz, true);
}
else
{
@@ -1460,7 +1460,7 @@ DValue* NewExp::toElem(IRState* p)
std::vector<DValue*> dims(ndims);
for (size_t i=0; i<ndims; ++i)
dims[i] = ((Expression*)arguments->data[i])->toElem(p);
return DtoNewMulDimDynArray(newtype, &dims[0], ndims, true);
return DtoNewMulDimDynArray(loc, newtype, &dims[0], ndims, true);
}
}
// new static array