diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-07 19:38:00 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-07 19:54:28 -0700 |
| commit | 4996c2b6a94b042d86b50eb61c9d8d98e63415af (patch) | |
| tree | 3857fef9a889a57d20925005579e7ef6784ea2e8 /lib/std/Thread.zig | |
| parent | 8f28e26e7a4f770f8d8e700386e2ade111948891 (diff) | |
| download | zig-4996c2b6a94b042d86b50eb61c9d8d98e63415af.tar.gz zig-4996c2b6a94b042d86b50eb61c9d8d98e63415af.zip | |
stage2: fix incremental compilation Decl deletion logic
* `analyzeContainer` now has an `outdated_decls` set as well as
`deleted_decls`. Instead of queuing up outdated Decls for re-analysis
right away, they are added to this new set. When processing the
`deleted_decls` set, we remove deleted Decls from the
`outdated_decls` set, to avoid deleted Decl pointers from being in
the work_queue. Only after processing the deleted decls do we add
analyze_decl work items to the queue.
* Module.deletion_set is now an `AutoArrayHashMap` rather than `ArrayList`.
`declareDeclDependency` will now remove a Decl from it as appropriate.
When processing the `deletion_set` in `Compilation.performAllTheWork`,
it now assumes all Decl in the set are to be deleted.
* Fix crash when handling parse errors. Currently we unload the
`ast.Tree` if any parse errors occur. Previously the code emitted a
LazySrcLoc pointing to a token index, but then when we try to resolve
the token index to a byte offset to create a compile error message,
the ast.Tree` would be unloaded. Now we use
`LazySrcLoc.byte_abs` instead of `token_abs` so the error message can
be created even with the `ast.Tree` unloaded.
Together, these changes solve a crash that happened with incremental
compilation when Decls were added and removed in some combinations.
Diffstat (limited to 'lib/std/Thread.zig')
0 files changed, 0 insertions, 0 deletions
