mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 15:10:59 +03:00
Adapt to new _d_arraysetlengthT template lowering
This commit is contained in:
parent
8151a5f65c
commit
a6dc3fa73a
6 changed files with 10 additions and 49 deletions
|
@ -748,34 +748,6 @@ DSliceValue *DtoNewMulDimDynArray(const Loc &loc, Type *arrayType,
|
|||
return getSlice(arrayType, newptr);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
DSliceValue *DtoResizeDynArray(const Loc &loc, Type *arrayType, DValue *array,
|
||||
LLValue *newdim) {
|
||||
IF_LOG Logger::println("DtoResizeDynArray : %s", arrayType->toChars());
|
||||
LOG_SCOPE;
|
||||
|
||||
assert(array);
|
||||
assert(newdim);
|
||||
assert(arrayType);
|
||||
assert(arrayType->toBasetype()->ty == TY::Tarray);
|
||||
|
||||
// decide on what runtime function to call based on whether the type is zero
|
||||
// initialized
|
||||
bool zeroInit = arrayType->toBasetype()->nextOf()->isZeroInit();
|
||||
|
||||
// call runtime
|
||||
LLFunction *fn =
|
||||
getRuntimeFunction(loc, gIR->module, zeroInit ? "_d_arraysetlengthT"
|
||||
: "_d_arraysetlengthiT");
|
||||
|
||||
LLValue *newArray = gIR->CreateCallOrInvoke(
|
||||
fn, DtoTypeInfoOf(loc, arrayType), newdim,
|
||||
DtoBitCast(DtoLVal(array), fn->getFunctionType()->getParamType(2)),
|
||||
".gc_mem");
|
||||
|
||||
return getSlice(arrayType, newArray);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static LLValue *DtoSlicePtr(DValue *dval) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue