From 746e880eb521e6cf5b6a452004da9bc5d2095076 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 3 May 2021 17:43:14 +0100 Subject: Begin work on making LLVM backend work with multiple modules for possible faster compilation --- src/main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 48fb4dcc3..530492cbb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1542,12 +1542,19 @@ void show_timings(Checker *c, Timings *t) { } } -void remove_temp_files(String output_base) { +void remove_temp_files(lbGenerator *gen) { if (build_context.keep_temp_files) return; + String output_base = gen->output_base; + auto data = array_make(heap_allocator(), output_base.len + 30); defer (array_free(&data)); + for_array(i, gen->output_object_paths) { + String path = gen->output_object_paths[i]; + gb_file_remove(cast(char const *)path.text); + } + isize n = output_base.len; gb_memmove(data.data, output_base.text, n); #define EXT_REMOVE(s) do { \ @@ -2183,7 +2190,7 @@ int main(int arg_count, char const **arg_ptr) { show_timings(&checker, timings); } - remove_temp_files(gen.output_base); + remove_temp_files(&gen); if (run_output) { #if defined(GB_SYSTEM_WINDOWS) -- cgit v1.2.3