mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 09:00:33 +03:00
driver: Initialize D druntime
This commit is contained in:
parent
002b9afa2c
commit
d531614a34
1 changed files with 10 additions and 1 deletions
|
@ -63,6 +63,11 @@
|
||||||
// Needs Type already declared.
|
// Needs Type already declared.
|
||||||
#include "cond.h"
|
#include "cond.h"
|
||||||
|
|
||||||
|
// From druntime/src/core/runtime.d.
|
||||||
|
extern "C" {
|
||||||
|
int rt_init();
|
||||||
|
}
|
||||||
|
|
||||||
// in traits.c
|
// in traits.c
|
||||||
void initTraitsStringTable();
|
void initTraitsStringTable();
|
||||||
|
|
||||||
|
@ -908,9 +913,13 @@ static void emitJson(Modules &modules) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
// stack trace on signals
|
|
||||||
llvm::sys::PrintStackTraceOnErrorSignal();
|
llvm::sys::PrintStackTraceOnErrorSignal();
|
||||||
|
|
||||||
|
// Initialize the D runtime.
|
||||||
|
// TODO: We might want to call rt_term() using an atexit handler or so to
|
||||||
|
// run module destructors, etc.
|
||||||
|
rt_init();
|
||||||
|
|
||||||
exe_path::initialize(argv[0], reinterpret_cast<void *>(main));
|
exe_path::initialize(argv[0], reinterpret_cast<void *>(main));
|
||||||
|
|
||||||
global._init();
|
global._init();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue