Support GC closures with alignment > 16

Tested by tests/dmd/runnable/test16098.d.
This commit is contained in:
Martin Kinkelin 2023-02-18 22:18:52 +01:00
parent 56785d41a8
commit ef8ba481e3
3 changed files with 22 additions and 17 deletions

View file

@ -207,17 +207,6 @@ llvm::AllocaInst *DtoRawAlloca(LLType *lltype, size_t alignment,
return ai;
}
LLValue *DtoGcMalloc(const Loc &loc, LLType *lltype, const char *name) {
// get runtime function
llvm::Function *fn = getRuntimeFunction(loc, gIR->module, "_d_allocmemory");
// parameters
LLValue *size = DtoConstSize_t(getTypeAllocSize(lltype));
// call runtime allocator
LLValue *mem = gIR->CreateCallOrInvoke(fn, size, name);
// cast
return DtoBitCast(mem, getPtrToType(lltype), name);
}
LLValue *DtoAllocaDump(DValue *val, const char *name) {
return DtoAllocaDump(val, val->type, name);
}