zig/test
mlugg 0e5335aaf5
compiler: rework type resolution, fully resolve all types
I'm so sorry.

This commit was just meant to be making all types fully resolve by
queueing resolution at the moment of their creation. Unfortunately, a
lot of dominoes ended up falling. Here's what happened:

* I added a work queue job to fully resolve a type.
* I realised that from here we could eliminate `Sema.types_to_resolve`
  if we made function codegen a separate job. This is desirable for
  simplicity of both spec and implementation.
* This led to a new AIR traversal to detect whether any required type is
  unresolved. If a type in the AIR failed to resolve, then we can't run
  codegen.
* Because full type resolution now occurs by the work queue job, a bug
  was exposed whereby error messages for type resolution were associated
  with the wrong `Decl`, resulting in duplicate error messages when the
  type was also resolved "by" its owner `Decl` (which really *all*
  resolution should be done on).
* A correct fix for this requires using a different `Sema` when
  performing type resolution: we need a `Sema` owned by the type. Also
  note that this fix is necessary for incremental compilation.
* This means a whole bunch of functions no longer need to take `Sema`s.
  * First-order effects: `resolveTypeFields`, `resolveTypeLayout`, etc
  * Second-order effects: `Type.abiAlignmentAdvanced`, `Value.orderAgainstZeroAdvanced`, etc

The end result of this is, in short, a more correct compiler and a
simpler language specification. This regressed a few error notes in the
test cases, but nothing that seems worth blocking this change.

Oh, also, I ripped out the old code in `test/src/Cases.zig` which
introduced a dependency on `Compilation`. This dependency was
problematic at best, and this code has been unused for a while. When we
re-enable incremental test cases, we must rewrite their executor to use
the compiler server protocol.
2024-07-04 21:01:42 +01:00
..
behavior Add behavior test: including the sentinel when dereferencing a string literal 2024-07-04 16:02:27 +03:00
c_abi x86_64: fix C abi of incomplete sse register 2024-05-08 19:37:29 -07:00
c_import c_import: extract behavior tests that use @cImport 2024-02-20 18:44:43 +01:00
cases compiler: rework type resolution, fully resolve all types 2024-07-04 21:01:42 +01:00
link Change deprecated b.host to b.graph.host in tests and Zig's build.zig 2024-06-13 10:49:06 -04:00
src compiler: rework type resolution, fully resolve all types 2024-07-04 21:01:42 +01:00
standalone build: fix WriteFile and addCSourceFiles not adding LazyPath deps 2024-07-04 13:34:17 -04:00
assemble_and_link.zig
behavior.zig astgen: fix result info for catch switch_block_err_union 2024-05-11 12:06:13 +03:00
c_import.zig c_import: extract behavior tests that use @cImport 2024-02-20 18:44:43 +01:00
cases.zig remove test/cbe.zig 2024-03-28 15:24:01 +02:00
compare_output.zig std: make options a struct instance instead of a namespace 2024-02-01 15:22:36 +02:00
compile_errors.zig Change deprecated b.host to b.graph.host in tests and Zig's build.zig 2024-06-13 10:49:06 -04:00
gen_h.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
llvm_targets.zig test/llvm_targets: add watchos, tvos and visionos to test matrix 2024-05-09 22:19:45 +02:00
nvptx.zig zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
run_translated_c.zig tests: translate-c and run-translated-c to the test harness 2023-10-17 11:55:17 +03:00
stack_traces.zig test/stack_traces.zig: add err union switch case 2024-01-18 15:10:32 +11:00
tests.zig compiler: rework type resolution, fully resolve all types 2024-07-04 21:01:42 +01:00
translate_c.zig translate-c: promote macros that reference var decls to inline functions 2024-06-05 23:06:51 +03:00