zig/test
Andrew Kelley 654832253a stage2: support recursive inline/comptime functions
zir.Inst no longer has an `analyzed_inst` field. This is previously how
we mapped ZIR to their TZIR counterparts, however with the way inline
and comptime function calls work, we can potentially have the same ZIR
structure being analyzed by multiple different analyses, such as during
a recursive inline function call. This would cause the `analyzed_inst`
field to become clobbered. So instead, we use a table to map the
instructions to their semantically analyzed counterparts. This will help
with multi-threaded compilation as well.

Scope.Block.Inlining is split into 2 different layers of "sharedness".
The first layer is shared by the whole inline/comptime function call
stack. It contains the callsite where something is being inlined and the
branch count/quota. The second layer is different per function call but
shared by all the blocks within the function being inlined.

Add support for debug dumping br and brvoid TZIR instructions.

Remove the "unreachable code" error. It was happening even for this case:

```zig
if (comptime_condition) return;
bar(); // error: unreachable code
```

We will need smarter logic for when it is legal to emit this compile
error.

Remove the ZIR test cases. These are redundant with other higher level
Zig source tests we have, and maintaining support for ZIRModule as a
first-class top level abstraction is getting in the way of clean
compiler design for the main use case. We will have ZIR/TZIR based test
cases someday to help with testing optimization passes and ZIR to TZIR
analysis, but as is, these test cases are not accomplishing that, and
they are getting in the way.
2021-01-02 22:42:07 -07:00
..
src tests: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
stage1 Fix more stray uses of {} for formatting strings 2021-01-02 17:12:57 -07:00
stage2 stage2: support recursive inline/comptime functions 2021-01-02 22:42:07 -07:00
standalone move ArrayListSentineled to std lib orphanage 2020-12-23 16:24:22 +02:00
assemble_and_link.zig update std lib to new Target API 2020-02-28 14:51:54 -05:00
cli.zig add std.testing.expectStringEndsWith 2020-12-08 21:59:24 -07:00
compare_output.zig Fix more stray uses of {} for formatting strings 2021-01-02 17:12:57 -07:00
compile_errors.zig stage1: Prevent crash with some lazy pointer types 2020-12-28 15:27:31 +02:00
gen_h.zig run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
run_translated_c.zig Correctly cast bool to signed int in translate-c 2020-12-25 14:38:31 +02:00
runtime_safety.zig Add some test cases for the previous commits 2020-12-05 20:14:04 +01:00
stack_traces.zig std.crypto.random: introduce fork safety 2020-12-18 15:54:01 -07:00
standalone.zig fix deadlock with build-exe on an object for windows 2020-12-11 18:34:34 -05:00
tests.zig tests: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
translate_c.zig translate-c: demote variadic functions to declarations 2020-12-26 13:02:17 +02:00