mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-20 06:43:14 +01:00
Prefer more specific functions to DtoResolveDsymbol.
The remaining ones should also be easy to remove with a closer look at the situation. Ideally, we would get rid of all of them at some point and use safe wrapper functions for accessing the IrDsymbol associated with a given declaration (which would emit the declarations on the fly if not already present).
This commit is contained in:
@@ -98,7 +98,7 @@ DValue* DtoNewClass(Loc loc, TypeClass* tc, NewExp* newexp)
|
||||
// custom allocator
|
||||
else if (newexp->allocator)
|
||||
{
|
||||
DtoResolveDsymbol(newexp->allocator);
|
||||
DtoResolveFunction(newexp->allocator);
|
||||
DFuncValue dfn(newexp->allocator, newexp->allocator->ir.irFunc->func);
|
||||
DValue* res = DtoCallFunction(newexp->loc, NULL, &dfn, newexp->newargs);
|
||||
mem = DtoBitCast(res->getRVal(), DtoType(tc), ".newclass_custom");
|
||||
@@ -139,7 +139,7 @@ DValue* DtoNewClass(Loc loc, TypeClass* tc, NewExp* newexp)
|
||||
{
|
||||
Logger::println("Calling constructor");
|
||||
assert(newexp->arguments != NULL);
|
||||
DtoResolveDsymbol(newexp->member);
|
||||
DtoResolveFunction(newexp->member);
|
||||
DFuncValue dfn(newexp->member, newexp->member->ir.irFunc->func, mem);
|
||||
return DtoCallFunction(newexp->loc, tc, &dfn, newexp->arguments);
|
||||
}
|
||||
@@ -578,7 +578,7 @@ static LLConstant* build_class_dtor(ClassDeclaration* cd)
|
||||
if (!dtor)
|
||||
return getNullPtr(getVoidPtrType());
|
||||
|
||||
DtoResolveDsymbol(dtor);
|
||||
DtoResolveFunction(dtor);
|
||||
return llvm::ConstantExpr::getBitCast(dtor->ir.irFunc->func, getPtrToType(LLType::getInt8Ty(gIR->context())));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user