diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-08-16 12:46:52 +0100 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-08-17 18:50:10 -0400 |
| commit | 84c2ebd6c6b16752d8d030d5904d0a525283cbf5 (patch) | |
| tree | 442234d4a737c6fbcf4f165ac18fa2a31cef9ac1 /lib/std/array_hash_map.zig | |
| parent | 65cbdefe4d923efd8fd2cfb555cc02a52c5635fc (diff) | |
| download | zig-84c2ebd6c6b16752d8d030d5904d0a525283cbf5.tar.gz zig-84c2ebd6c6b16752d8d030d5904d0a525283cbf5.zip | |
frontend: incremental compilation progress
Another big commit, sorry! This commit makes all fixes necessary for
incremental updates of the compiler itself (specifically, adding a
breakpoint to `zirCompileLog`) to succeed, at least on the frontend.
The biggest change here is a reform to how types are handled. It works
like this:
* When a type is first created in `zirStructDecl` etc, its namespace is
scanned. If the type requires resolution, an `interned` dependency is
declared for the containing `AnalUnit`.
* `zirThis` also declared an `interned` dependency for its `AnalUnit` on
the namespace's owner type.
* If the type's namespace changes, the surrounding source declaration
changes hash, so `zirStructDecl` etc will be hit again. We check
whether the namespace has been scanned this generation, and re-scan it
if not.
* Namespace lookups also check whether the namespace in question
requires a re-scan based on the generation. This is because there's no
guarantee that the `zirStructDecl` is re-analyzed before the namespace
lookup is re-analyzed.
* If a type's structure (essentially its fields) change, then the type's
`Cau` is considered outdated. When the type is re-analyzed due to
being outdated, or the `zirStructDecl` is re-analyzed by being
transitively outdated, or a corresponding `zirThis` is re-analyzed by
being transitively outdated, the struct type is recreated at a new
`InternPool` index. The namespace's owner is updated (but not
re-scanned, since that is handled by the mechanisms above), and the
old type, while remaining a valid `Index`, is removed from the map
metadata so it will never be found by lookups. `zirStructDecl` and
`zirThis` store an `interned` dependency on the *new* type.
Diffstat (limited to 'lib/std/array_hash_map.zig')
0 files changed, 0 insertions, 0 deletions
