mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
Support GC closures with alignment > 16
Tested by tests/dmd/runnable/test16098.d.
This commit is contained in:
parent
56785d41a8
commit
ef8ba481e3
3 changed files with 22 additions and 17 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue