CMakeLists.txt | 111 +- README.md | 242 ++- build.zig | 27 + ci/azure/windows_upload | 2 +- cmake/Findclang.cmake | 2 +- deps/lld/wasm/OutputSections.cpp | 12 +- doc/docgen.zig | 55 +- doc/langref.html.in | 109 +- src-self-hosted/clang.zig | 866 +++++++++ src-self-hosted/compilation.zig | 10 +- src-self-hosted/main.zig | 18 +- src-self-hosted/scope.zig | 1 - src-self-hosted/stage1.zig | 397 ++++ src-self-hosted/translate_c.zig | 682 +++++++ src-self-hosted/value.zig | 8 +- src/all_types.hpp | 13 +- src/analyze.cpp | 153 +- src/analyze.hpp | 4 + src/ast_render.cpp | 6 +- src/ast_render.hpp | 2 +- src/bigint.cpp | 13 +- src/buffer.hpp | 1 - src/c_tokenizer.cpp | 20 + src/c_tokenizer.hpp | 3 + src/cache_hash.cpp | 28 +- src/codegen.cpp | 509 +++-- src/codegen.hpp | 4 +- src/compiler.cpp | 8 +- src/compiler.hpp | 4 +- src/error.cpp | 4 + src/error.hpp | 50 +- src/ir.cpp | 379 +++- src/ir.hpp | 2 +- src/ir_print.cpp | 9 + src/libc_installation.cpp | 36 +- src/libc_installation.hpp | 3 +- src/link.cpp | 308 +-- src/list.hpp | 2 - src/main.cpp | 169 +- src/os.cpp | 53 +- src/os.hpp | 6 +- src/parser.cpp | 114 +- src/target.cpp | 27 +- src/target.hpp | 2 + src/translate_c.cpp | 3219 ++++++++++++++++---------------- src/translate_c.hpp | 6 +- src/userland.cpp | 44 + src/userland.h | 120 ++ src/util.cpp | 10 +- src/util.hpp | 4 + src/zig_clang.cpp | 1717 ++++++++++++++++- src/zig_clang.h | 801 ++++++-- std/array_list.zig | 38 + std/build.zig | 27 + std/c.zig | 6 + std/c/freebsd.zig | 32 +- std/c/linux.zig | 4 + std/c/netbsd.zig | 32 +- std/crypto/chacha20.zig | 5 +- std/debug.zig | 630 ++++--- std/debug/failing_allocator.zig | 18 +- std/debug/leb128.zig | 228 +++ std/dwarf.zig | 4 + std/dynamic_library.zig | 83 + std/elf.zig | 5 + std/fmt.zig | 108 +- std/hash_map.zig | 83 +- std/heap.zig | 478 ++++- std/io.zig | 41 +- std/io/c_out_stream.zig | 48 + std/io/seekable_stream.zig | 16 +- std/io/test.zig | 602 ++++++ std/io_test.zig | 591 ------ std/json.zig | 4 + std/json/test.zig | 1904 +++++++++++++++++++ std/json_test.zig | 1904 ------------------- std/math/acos.zig | 10 +- std/math/acosh.zig | 12 +- std/math/asin.zig | 12 +- std/math/asinh.zig | 14 +- std/math/atan.zig | 12 +- std/math/atan2.zig | 42 +- std/math/atanh.zig | 14 +- std/math/big.zig | 2 + std/math/big/int.zig | 786 +++++--- std/math/big/rational.zig | 938 ++++++++++ std/math/cbrt.zig | 14 +- std/math/ceil.zig | 14 +- std/math/complex.zig | 12 + std/math/complex/abs.zig | 1 + std/math/complex/acos.zig | 1 + std/math/complex/acosh.zig | 1 + std/math/complex/arg.zig | 1 + std/math/complex/asin.zig | 1 + std/math/complex/asinh.zig | 1 + std/math/complex/atan.zig | 7 + std/math/complex/atanh.zig | 1 + std/math/complex/conj.zig | 1 + std/math/complex/cos.zig | 1 + std/math/complex/cosh.zig | 7 + std/math/complex/exp.zig | 7 + std/math/complex/ldexp.zig | 7 + std/math/complex/log.zig | 1 + std/math/complex/pow.zig | 1 + std/math/complex/proj.zig | 1 + std/math/complex/sin.zig | 1 + std/math/complex/sinh.zig | 7 + std/math/complex/sqrt.zig | 8 + std/math/complex/tan.zig | 1 + std/math/complex/tanh.zig | 7 + std/math/copysign.zig | 7 + std/math/cos.zig | 146 +- std/math/cosh.zig | 14 +- std/math/exp.zig | 12 +- std/math/exp2.zig | 12 +- std/math/expm1.zig | 17 +- std/math/expo2.zig | 7 + std/math/fabs.zig | 12 +- std/math/floor.zig | 14 +- std/math/fma.zig | 10 +- std/math/frexp.zig | 15 +- std/math/hypot.zig | 16 +- std/math/ilogb.zig | 14 +- std/math/inf.zig | 1 + std/math/isfinite.zig | 1 + std/math/isinf.zig | 3 + std/math/isnan.zig | 6 +- std/math/isnormal.zig | 1 + std/math/ln.zig | 16 +- std/math/log.zig | 7 + std/math/log10.zig | 16 +- std/math/log1p.zig | 18 +- std/math/log2.zig | 16 +- std/math/modf.zig | 13 +- std/math/nan.zig | 6 +- std/math/pow.zig | 96 +- std/math/powi.zig | 22 +- std/math/round.zig | 14 +- std/math/scalbn.zig | 7 + std/math/signbit.zig | 1 + std/math/sin.zig | 160 +- std/math/sinh.zig | 14 +- std/math/sqrt.zig | 14 +- std/math/tan.zig | 154 +- std/math/tanh.zig | 14 +- std/math/trunc.zig | 14 +- std/mem.zig | 52 +- std/os.zig | 118 +- std/os/darwin.zig | 2 +- std/os/file.zig | 28 +- std/os/linux.zig | 166 +- std/os/linux/arm64.zig | 19 +- std/os/linux/test.zig | 41 + std/os/linux/tls.zig | 247 +++ std/os/linux/x86_64.zig | 25 +- std/os/time.zig | 30 +- std/os/wasi.zig | 42 + std/os/wasi/core.zig | 374 ++++ std/os/windows.zig | 31 + std/os/windows/kernel32.zig | 3 + std/packed_int_array.zig | 649 +++++++ std/pdb.zig | 13 +- std/rand.zig | 4 +- std/special/bootstrap.zig | 74 +- std/special/build_runner.zig | 30 +- std/special/compiler_rt.zig | 687 +++++-- std/special/compiler_rt/addXf3.zig | 4 +- std/special/compiler_rt/arm/aeabi_dcmp.zig | 108 ++ std/special/compiler_rt/arm/aeabi_fcmp.zig | 108 ++ std/special/compiler_rt/ashlti3.zig | 41 + std/special/compiler_rt/ashlti3_test.zig | 46 + std/special/compiler_rt/ashrti3.zig | 42 + std/special/compiler_rt/ashrti3_test.zig | 58 + std/special/compiler_rt/comparedf2.zig | 122 ++ std/special/compiler_rt/comparedf2_test.zig | 101 + std/special/compiler_rt/comparesf2.zig | 122 ++ std/special/compiler_rt/comparesf2_test.zig | 101 + std/special/compiler_rt/divti3.zig | 6 +- std/special/compiler_rt/extendXfYf2.zig | 14 +- std/special/compiler_rt/floatdidf.zig | 22 + std/special/compiler_rt/floatdidf_test.zig | 53 + std/special/compiler_rt/floatsiXf.zig | 109 ++ std/special/compiler_rt/floatundidf.zig | 24 + std/special/compiler_rt/floatundidf_test.zig | 50 + std/special/compiler_rt/floatunsidf.zig | 33 + std/special/compiler_rt/lshrti3.zig | 41 + std/special/compiler_rt/lshrti3_test.zig | 46 + std/special/compiler_rt/modti3.zig | 6 +- std/special/compiler_rt/mulodi4.zig | 44 + std/special/compiler_rt/mulodi4_test.zig | 85 + std/special/compiler_rt/muloti4.zig | 10 +- std/special/compiler_rt/multi3.zig | 6 +- std/special/compiler_rt/stack_probe.zig | 206 ++ std/special/compiler_rt/truncXfYf2.zig | 4 + std/special/compiler_rt/truncXfYf2_test.zig | 37 + std/special/compiler_rt/udivmodti4.zig | 5 +- std/special/compiler_rt/udivti3.zig | 5 +- std/special/compiler_rt/umodti3.zig | 6 +- std/special/fmt_runner.zig | 260 --- std/special/panic.zig | 7 +- std/special/test_runner.zig | 2 +- std/std.zig | 7 + std/zig/ast.zig | 9 +- std/zig/parse.zig | 338 ++-- std/zig/parser_test.zig | 36 +- std/zig/render.zig | 7 +- test/compile_errors.zig | 113 +- test/runtime_safety.zig | 20 + test/stage1/behavior.zig | 3 + test/stage1/behavior/bit_shifting.zig | 10 + test/stage1/behavior/bugs/1607.zig | 15 + test/stage1/behavior/bugs/2114.zig | 19 + test/stage1/behavior/bugs/2346.zig | 6 + test/stage1/behavior/enum.zig | 39 + test/stage1/behavior/math.zig | 7 + test/stage1/behavior/pointers.zig | 50 + test/stage1/behavior/sizeof_and_typeof.zig | 7 + test/stage1/behavior/struct.zig | 22 +- test/stage1/behavior/syntax.zig | 8 + test/stage1/behavior/union.zig | 37 + test/tests.zig | 36 +- test/translate_c.zig | 215 ++- 222 files changed, 18469 insertions(+), 7246 deletions(-)