Commit Graph

29 Commits

Author SHA1 Message Date
7b0dd08921 disable leak checker for now 2026-02-12 14:08:49 +02:00
2998dd1122 quicker zig build test 2026-02-12 14:06:15 +02:00
47c9f3e038 disable gcc_analyze for now 2026-02-12 13:52:53 +02:00
71f570ee3d lint per file
gives paralellism
2026-02-12 13:51:53 +02:00
0295bb4651 astgen: port Phases 4-5 (control flow, expressions, scope chain)
Port scope chain infrastructure, function parameters, local var_decl,
control flow (if/for/while/switch/orelse/catch/defer), labeled blocks,
break/continue, comparison/boolean/unary operators, array access,
field access rvalue, rvalue type coercion optimization, and many
builtins from upstream AstGen.zig. test_all.zig corpus passes;
4 remaining corpus files still have mismatches (WIP).

Also fix cppcheck/lint issues: safe realloc pattern, null checks,
const correctness, enable inline suppressions, comment out test
debug output for clean `zig build`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 11:40:51 +00:00
d6d60fbebf valgrind no timeout 2026-02-12 09:29:33 +02:00
9a6341a23b test timeouts 2026-02-12 08:16:50 +02:00
b12d338f4f use zig's x86 backend 2026-02-12 00:32:57 +02:00
b5880e3ce2 build: subtract avx512f when running under valgrind
Valgrind 3.26.0 cannot decode AVX-512 instructions. On AVX-512 capable
CPUs (e.g. Zen 4), Zig's standard library emits these instructions when
targeting native, causing immediate crashes. Subtract avx512f from the
CPU features when -Dvalgrind is set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:20:12 +02:00
85e7abd0b7 Merge branch 'zig01' 2026-02-11 18:37:51 +00:00
5fb7a1ab9c Add astgen scaffolding with ZIR data structures and first passing test
Introduce zir.h/zir.c with ZIR instruction types (269 tags, 56 extended
opcodes, 8-byte Data union) ported from lib/std/zig/Zir.zig, and
astgen.h/astgen.c implementing the empty-container fast path that produces
correct ZIR for empty source files.

The test infrastructure in astgen_test.zig compares C astGen() output
field-by-field against Zig's std.zig.AstGen.generate() using tag-based
dispatch, avoiding raw byte comparison since Zig's Data union has no
guaranteed in-memory layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:37:07 +00:00
0a563abefa valgrind 2026-02-11 18:36:29 +00:00
a3e8198477 valgrind 2026-02-11 18:27:44 +00:00
37ae8b01d1 parser: implement for loops, port for/while loop test
Implement in parser.c:
- forPrefix: parse for input expressions and capture variables
- parseForExpr: for_simple and for AST nodes with optional else
- Handle for and while in parsePrimaryTypeExpr for top-level usage

Remove stale cppcheck knownConditionTrueFalse suppression.

Port test "top-level for/while loop".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-11 14:40:18 +00:00
745b38fde2 zig build does more and in parallel 2026-02-11 14:40:02 +00:00
00db079347 zig build -Dcc=tcc 2026-02-10 10:47:27 +00:00
2948cfd7cf zig 0.15.1
With opus 4.6
2026-02-10 10:03:44 +00:00
49c910b8b2 fix memleak; initialization boilerplate 2025-01-02 17:17:22 +02:00
85dfbe9d09 more parser 2025-01-01 17:26:58 +02:00
2ae1ac885b fix filename 2024-12-30 01:33:34 +02:00
b8a52d3f39 More parser — lint+tests pass again 2024-12-30 01:30:48 +02:00
6006a802e1 making tcc happier 2024-12-29 00:13:54 +02:00
6ae7d7320d adding more parser — starts breaking the build 2024-12-26 00:35:13 +02:00
a9c4b5c7ab macros 2024-12-23 00:01:42 +02:00
db35aa7722 rename types 2024-12-22 22:31:16 +02:00
228b215259 making parser 2024-12-20 00:24:51 +02:00
69e90b6b9f allo system compiler 2024-12-19 20:28:00 +02:00
7361b6058d linters, some ast headers 2024-12-19 00:24:03 +02:00
6863e34fbc Tokenizer 2024-12-13 09:39:02 +02:00