Commit graph

8 commits

Author SHA1 Message Date
Jacob Young
8159ff8b81 x86_64: implement error set and enum safety
This is all of the expected 0.14.0 progress on #21530, which can now be
postponed once this commit is merged.

This required rewriting the (un)wrap operations since the original
implementations were extremely buggy.

Also adds an easy way to retrigger Sema OPV bugs so that I don't have to
keep updating #22419 all the time.
2025-02-15 03:45:21 -05:00
Jacob Young
2ff49751aa Compilation: introduce work stages for better work distribution 2024-07-13 04:47:38 -04:00
mlugg
5f03c02505
Zcu: key compile errors on AnalUnit where appropriate
This change seeks to more appropriately model the way semantic analysis
works by drawing a more clear line between errors emitted by analyzing a
`Decl` (in future a `Cau`) and errors emitted by analyzing a runtime
function.

This does change a few compile errors surrounding compile logs by adding
more "also here" notes. The new notes are more technically correct, but
perhaps not so helpful. They're not doing enough harm for me to put
extensive thought into this for now.
2024-07-04 21:01:41 +01:00
mlugg
845226a7c9
cases: necessary changes from branch 2024-03-26 17:06:14 +00:00
mlugg
4976b58ab1
Prevent analysis of functions only referenced at comptime
The idea here is that there are two ways we can reference a function at runtime:

* Through a direct call, i.e. where the function is comptime-known
* Through a function pointer

This means we can easily perform a form of rudimentary escape analysis
on functions. If we ever see a `decl_ref` or `ref` of a function, we
have a function pointer, which could "leak" into runtime code, so we
emit the function; but for a plain `decl_val`, there's no need to.

This change means that `comptime { _ = f; }` no longer forces a function
to be emitted, which was used for some things (mainly tests). These use
sites have been replaced with `_ = &f;`, which still triggers analysis
of the function body, since you're taking a pointer to the function.

Resolves: #6256
Resolves: #15353
2023-05-29 23:06:08 +01:00
Andrew Kelley
6664d2418d test-cases: add missing compile log output
The new testing harness is not bound by previous limitations; it can now
test compile log output as well.
2023-03-15 10:48:15 -07:00
Veikka Tuominen
3d18c8c130 Sema: resolve lazy values for compile log
Close #12204
2022-07-26 16:40:24 +03:00
Veikka Tuominen
3c73f71177 Sema: prefer func.onwer_decl for compilelog src 2022-07-01 10:22:25 +03:00
Renamed from test/cases/compile_errors/stage1/obj/compile_log.zig (Browse further)