diff --git a/gen/toobj.c b/gen/toobj.c index 155336a7..29e5fe48 100644 --- a/gen/toobj.c +++ b/gen/toobj.c @@ -619,12 +619,9 @@ void FuncDeclaration::toObjFile() Logger::println("queueing %s", toChars()); assert(!gIR->classmethods.empty()); gIR->classmethods.back().push_back(this); - return; // will be generated later when the this parameter has a type + return; // we wait with the definition as they might invoke a virtual method and the vtable is not yet complete } - if (llvmNeedsDefinition) - { - TypeFunction* f = (TypeFunction*)type; llvm::FunctionType* functype = llvm::cast(f->llvmType); @@ -714,8 +711,6 @@ void FuncDeclaration::toObjFile() } } - } - llvmDModule = gIR->dmodule; Logger::println("FuncDeclaration done\n");