mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 12:18:15 +00:00
Add runtime._cleanup_runtime internal call
This commit is contained in:
@@ -384,7 +384,12 @@ Raw_Cstring :: struct {
|
|||||||
// This is probably only useful for freestanding targets
|
// This is probably only useful for freestanding targets
|
||||||
foreign {
|
foreign {
|
||||||
@(link_name="__$startup_runtime")
|
@(link_name="__$startup_runtime")
|
||||||
_startup_runtime :: proc "contextless" () ---
|
_startup_runtime :: proc() ---
|
||||||
|
}
|
||||||
|
|
||||||
|
@(link_name="__$cleanup_runtime")
|
||||||
|
_cleanup_runtime :: proc() {
|
||||||
|
default_temp_allocator_destroy(&global_default_temp_allocator_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1967,6 +1967,7 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
|
|||||||
str_lit("__init_context"),
|
str_lit("__init_context"),
|
||||||
str_lit("__type_info_of"),
|
str_lit("__type_info_of"),
|
||||||
str_lit("cstring_to_string"),
|
str_lit("cstring_to_string"),
|
||||||
|
str_lit("_cleanup_runtime"),
|
||||||
|
|
||||||
// Pseudo-CRT required procedures
|
// Pseudo-CRT required procedures
|
||||||
str_lit("memset"),
|
str_lit("memset"),
|
||||||
@@ -1993,7 +1994,6 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
|
|||||||
str_lit("gnu_h2f_ieee"),
|
str_lit("gnu_h2f_ieee"),
|
||||||
str_lit("gnu_f2h_ieee"),
|
str_lit("gnu_f2h_ieee"),
|
||||||
str_lit("extendhfsf2"),
|
str_lit("extendhfsf2"),
|
||||||
|
|
||||||
};
|
};
|
||||||
for (isize i = 0; i < gb_count_of(required_runtime_entities); i++) {
|
for (isize i = 0; i < gb_count_of(required_runtime_entities); i++) {
|
||||||
force_add_dependency_entity(c, c->info.runtime_package->scope, required_runtime_entities[i]);
|
force_add_dependency_entity(c, c->info.runtime_package->scope, required_runtime_entities[i]);
|
||||||
|
|||||||
@@ -879,7 +879,10 @@ lbProcedure *lb_create_main_procedure(lbModule *m, lbProcedure *startup_runtime)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lbValue cleanup_runtime_value = lb_find_runtime_value(m, str_lit("_cleanup_runtime"));
|
||||||
|
lb_emit_call(p, cleanup_runtime_value, {}, ProcInlining_none, false);
|
||||||
|
|
||||||
|
|
||||||
if (is_dll_main) {
|
if (is_dll_main) {
|
||||||
LLVMBuildRet(p->builder, LLVMConstInt(lb_type(m, t_i32), 1, false));
|
LLVMBuildRet(p->builder, LLVMConstInt(lb_type(m, t_i32), 1, false));
|
||||||
|
|||||||
Reference in New Issue
Block a user