zig/test
Andrew Kelley 9362f382ab stage2: implement function call inlining in the frontend
* remove the -Ddump-zir thing. that's handled through --verbose-ir
 * rework Fn to have an is_inline flag without requiring any more memory
   on the heap per function.
 * implement a rough first version of dumping typed zir (tzir) which is
   a lot more helpful for debugging than what we had before. We don't
   have a way to parse it though.
 * keep track of whether the inline-ness of a function changes because
   if it does we have to go update callsites.
 * add compile error for inline and export used together.

inline function calls and comptime function calls are implemented the
same way. A block instruction is set up to capture the result, and then
a scope is set up that has a flag for is_comptime and some state if the
scope is being inlined.

when analyzing `ret` instructions, zig looks for inlining state in the
scope, and if found, treats `ret` as a `break` instruction instead, with
the target block being the one set up at the inline callsite.

Follow-up items:
 * Complete out the debug TZIR dumping code.
 * Don't redundantly generate ZIR for each inline/comptime function
   call. Instead we should add a new state enum tag to Fn.
 * comptime and inlining branch quotas.
 * Add more test cases.
2021-01-02 19:11:19 -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: implement function call inlining in the frontend 2021-01-02 19:11:19 -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