diff options
| author | gingerBill <bill@gingerbill.org> | 2024-07-09 14:16:56 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-07-09 14:16:56 +0100 |
| commit | 886ee66e7fcabbd09c20fd55d98051e3854dfd76 (patch) | |
| tree | 42009ae0ef71a2c755eb375416143a77d4240c77 /src/main.cpp | |
| parent | 68b70a21831b3128828357e8af366a377283fa80 (diff) | |
Cache files, env, and args
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 49c34014b..f2312f248 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3271,12 +3271,19 @@ int main(int arg_count, char const **arg_ptr) { print_all_errors(); } - MAIN_TIME_SECTION("type check"); checker->parser = parser; init_checker(checker); - defer (destroy_checker(checker)); + defer (destroy_checker(checker)); // this is here because of a `goto` + + if (build_context.cached && parser->total_seen_load_directive_count.load() == 0) { + MAIN_TIME_SECTION("check cached build (pre-semantic check)"); + if (try_cached_build(checker, args)) { + goto end_of_code_gen; + } + } + MAIN_TIME_SECTION("type check"); check_parsed_files(checker); check_defines(&build_context, checker); if (any_errors()) { @@ -3331,7 +3338,7 @@ int main(int arg_count, char const **arg_ptr) { if (build_context.cached) { MAIN_TIME_SECTION("check cached build"); - if (try_cached_build(checker)) { + if (try_cached_build(checker, args)) { goto end_of_code_gen; } } |