mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 07:30:43 +03:00
Adapt to new _d_newitemT template lowering for heap-allocations of structs
This commit is contained in:
parent
3ab72d8e52
commit
c5704c764d
4 changed files with 4 additions and 19 deletions
|
@ -91,15 +91,6 @@ LLValue *DtoNew(const Loc &loc, Type *newtype) {
|
|||
return DtoBitCast(mem, DtoPtrToType(newtype), ".gc_mem");
|
||||
}
|
||||
|
||||
LLValue *DtoNewStruct(const Loc &loc, TypeStruct *newtype) {
|
||||
llvm::Function *fn = getRuntimeFunction(
|
||||
loc, gIR->module,
|
||||
newtype->isZeroInit(newtype->sym->loc) ? "_d_newitemT" : "_d_newitemiT");
|
||||
LLConstant *ti = DtoTypeInfoOf(loc, newtype);
|
||||
LLValue *mem = gIR->CreateCallOrInvoke(fn, ti, ".gc_struct");
|
||||
return DtoBitCast(mem, DtoPtrToType(newtype), ".gc_struct");
|
||||
}
|
||||
|
||||
void DtoDeleteMemory(const Loc &loc, DValue *ptr) {
|
||||
llvm::Function *fn = getRuntimeFunction(loc, gIR->module, "_d_delmemory");
|
||||
LLValue *lval = (ptr->isLVal() ? DtoLVal(ptr) : makeLValue(loc, ptr));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue