mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Adapt to removed _d_array[set]ctor druntime hooks (replaced by templated lowerings)
This commit is contained in:
parent
0a98ccd153
commit
6998886e89
2 changed files with 11 additions and 13 deletions
|
@ -270,10 +270,10 @@ void DtoArrayAssign(const Loc &loc, DValue *lhs, DValue *rhs, EXP op,
|
|||
knownInBounds);
|
||||
}
|
||||
} else if (isConstructing) {
|
||||
LLFunction *fn = getRuntimeFunction(loc, gIR->module, "_d_arrayctor");
|
||||
gIR->CreateCallOrInvoke(fn, DtoTypeInfoOf(loc, elemType),
|
||||
DtoSlice(rhsPtr, rhsLength, getI8Type()),
|
||||
DtoSlice(lhsPtr, lhsLength, getI8Type()));
|
||||
error(
|
||||
loc,
|
||||
"ICE: array construction should have been lowered to `_d_arrayctor`");
|
||||
fatal();
|
||||
} else { // assigning
|
||||
LLValue *tmpSwap = DtoAlloca(elemType, "arrayAssign.tmpSwap");
|
||||
LLFunction *fn = getRuntimeFunction(
|
||||
|
@ -306,10 +306,13 @@ void DtoArrayAssign(const Loc &loc, DValue *lhs, DValue *rhs, EXP op,
|
|||
: gIR->ir->CreateExactUDiv(lhsSize, DtoConstSize_t(rhsSize));
|
||||
}
|
||||
DtoArrayInit(loc, actualPtr, actualLength, rhs);
|
||||
} else if (isConstructing) {
|
||||
error(loc, "ICE: array construction should have been lowered to "
|
||||
"`_d_arraysetctor`");
|
||||
fatal();
|
||||
} else {
|
||||
LLFunction *fn = getRuntimeFunction(loc, gIR->module,
|
||||
isConstructing ? "_d_arraysetctor"
|
||||
: "_d_arraysetassign");
|
||||
LLFunction *fn =
|
||||
getRuntimeFunction(loc, gIR->module, "_d_arraysetassign");
|
||||
gIR->CreateCallOrInvoke(
|
||||
fn, lhsPtr, DtoBitCast(makeLValue(loc, rhs), getVoidPtrType()),
|
||||
gIR->ir->CreateTruncOrBitCast(lhsLength,
|
||||
|
|
|
@ -696,13 +696,8 @@ static void buildRuntimeModule() {
|
|||
createFwdDecl(LINK::c, voidArrayTy, {"_d_arrayassign_l", "_d_arrayassign_r"},
|
||||
{typeInfoTy, voidArrayTy, voidArrayTy, voidPtrTy});
|
||||
|
||||
// void[] _d_arrayctor(TypeInfo ti, void[] from, void[] to)
|
||||
createFwdDecl(LINK::c, voidArrayTy, {"_d_arrayctor"},
|
||||
{typeInfoTy, voidArrayTy, voidArrayTy});
|
||||
|
||||
// void* _d_arraysetassign(void* p, void* value, int count, TypeInfo ti)
|
||||
// void* _d_arraysetctor(void* p, void* value, int count, TypeInfo ti)
|
||||
createFwdDecl(LINK::c, voidPtrTy, {"_d_arraysetassign", "_d_arraysetctor"},
|
||||
createFwdDecl(LINK::c, voidPtrTy, {"_d_arraysetassign"},
|
||||
{voidPtrTy, voidPtrTy, intTy, typeInfoTy});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue