mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 04:43:14 +01:00
Force initialize the runtime module in Module::genLLVMModule. It is required
for all non-trivial D modules anyway, so why load it lazily? This fixes run/typeid_83.d (DtoDeclareTypeInfo expects runtime to be initialized)
This commit is contained in:
@@ -36,7 +36,9 @@ bool LLVM_D_InitRuntime()
|
||||
Logger::println("*** Initializing D runtime declarations ***");
|
||||
LOG_SCOPE;
|
||||
|
||||
LLVM_D_BuildRuntimeModule();
|
||||
if (!M)
|
||||
LLVM_D_BuildRuntimeModule();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2585,8 +2585,8 @@ void obj_includelib(const char* lib)
|
||||
|
||||
void backend_init()
|
||||
{
|
||||
// now lazily loaded
|
||||
//LLVM_D_InitRuntime();
|
||||
// LLVM_D_InitRuntime is done in Module::genLLVMModule
|
||||
// since it requires the semantic pass to be done
|
||||
}
|
||||
|
||||
void backend_term()
|
||||
|
||||
@@ -134,6 +134,8 @@ llvm::Module* Module::genLLVMModule(Ir* sir)
|
||||
error("is missing 'class ClassInfo'");
|
||||
fatal();
|
||||
}
|
||||
|
||||
LLVM_D_InitRuntime();
|
||||
|
||||
// process module members
|
||||
for (int k=0; k < members->dim; k++) {
|
||||
|
||||
Reference in New Issue
Block a user