mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 07:30:43 +03:00
Keep _d_newclass() semantics, re-introduce _d_allocclass() instead
And use that one in DtoNewClass(), keeping 3rd party code from breaking.
This commit is contained in:
parent
97921fbb8d
commit
a5e5bd1716
6 changed files with 20 additions and 6 deletions
|
@ -84,8 +84,8 @@ DValue *DtoNewClass(Loc &loc, TypeClass *tc, NewExp *newexp) {
|
|||
// allocate
|
||||
LLValue *mem;
|
||||
if (newexp->onstack) {
|
||||
// FIXME align scope class to its largest member
|
||||
mem = DtoRawAlloca(DtoType(tc)->getContainedType(0), 0, ".newclass_alloca");
|
||||
mem = DtoRawAlloca(DtoType(tc)->getContainedType(0), DtoAlignment(tc),
|
||||
".newclass_alloca");
|
||||
}
|
||||
// custom allocator
|
||||
else if (newexp->allocator) {
|
||||
|
@ -97,7 +97,7 @@ DValue *DtoNewClass(Loc &loc, TypeClass *tc, NewExp *newexp) {
|
|||
// default allocator
|
||||
else {
|
||||
llvm::Function *fn =
|
||||
getRuntimeFunction(loc, gIR->module, "_d_newclass");
|
||||
getRuntimeFunction(loc, gIR->module, "_d_allocclass");
|
||||
LLConstant *ci = DtoBitCast(getIrAggr(tc->sym)->getClassInfoSymbol(),
|
||||
DtoType(Type::typeinfoclass->type));
|
||||
mem =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue