Begin work on making LLVM backend work with multiple modules for possible faster compilation

This commit is contained in:
gingerBill
2021-05-03 17:43:14 +01:00
parent e4286d0ff9
commit 746e880eb5
4 changed files with 416 additions and 278 deletions

View File

@@ -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<u8>(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)