README.md | 4 +- build.zig | 2 +- ci/azure/pipelines.yml | 4 +- ci/drone/drone.yml | 2 + doc/docgen.zig | 5 +- doc/langref.html.in | 307 ++++-- lib/std/array_list.zig | 16 +- lib/std/ascii.zig | 22 +- lib/std/atomic/queue.zig | 6 +- lib/std/atomic/stack.zig | 8 +- lib/std/bloom_filter.zig | 22 +- lib/std/build.zig | 83 +- lib/std/builtin.zig | 33 +- lib/std/c.zig | 24 +- lib/std/c/darwin.zig | 18 +- lib/std/c/dragonfly.zig | 13 +- lib/std/c/emscripten.zig | 8 + lib/std/c/freebsd.zig | 12 + lib/std/c/fuchsia.zig | 8 + lib/std/c/haiku.zig | 14 + lib/std/c/hermit.zig | 6 + lib/std/c/linux.zig | 23 + lib/std/c/minix.zig | 18 + lib/std/c/netbsd.zig | 29 + lib/std/c/openbsd.zig | 6 + lib/std/c/solaris.zig | 15 + lib/std/child_process.zig | 97 +- lib/std/coff.zig | 2 +- lib/std/crypto/aes.zig | 20 +- lib/std/crypto/benchmark.zig | 4 +- lib/std/crypto/blake2.zig | 16 +- lib/std/crypto/chacha20.zig | 8 +- lib/std/crypto/gimli.zig | 8 +- lib/std/crypto/md5.zig | 8 +- lib/std/crypto/poly1305.zig | 12 +- lib/std/crypto/sha1.zig | 30 +- lib/std/crypto/sha2.zig | 38 +- lib/std/crypto/sha3.zig | 2 +- lib/std/crypto/x25519.zig | 66 +- lib/std/debug.zig | 49 +- lib/std/debug/leb128.zig | 6 +- lib/std/dynamic_library.zig | 4 +- lib/std/elf.zig | 24 +- lib/std/event/channel.zig | 4 +- lib/std/event/fs.zig | 13 +- lib/std/event/future.zig | 25 +- lib/std/event/group.zig | 41 +- lib/std/event/lock.zig | 10 +- lib/std/event/loop.zig | 52 +- lib/std/event/rwlock.zig | 44 +- lib/std/fifo.zig | 26 +- lib/std/fmt.zig | 130 +-- lib/std/fmt/errol.zig | 4 +- lib/std/fmt/parse_float.zig | 20 +- lib/std/fs.zig | 115 ++- lib/std/fs/file.zig | 56 +- lib/std/fs/path.zig | 2 +- lib/std/hash/auto_hash.zig | 14 +- lib/std/hash/cityhash.zig | 8 +- lib/std/hash/crc.zig | 8 +- lib/std/hash/murmur.zig | 2 +- lib/std/hash/siphash.zig | 14 +- lib/std/hash_map.zig | 2 +- lib/std/heap.zig | 12 +- lib/std/http/headers.zig | 10 +- lib/std/io.zig | 74 +- lib/std/io/out_stream.zig | 4 +- lib/std/io/test.zig | 64 +- lib/std/json.zig | 130 +-- lib/std/json/write_stream.zig | 6 +- lib/std/lazy_init.zig | 26 +- lib/std/math.zig | 163 ++-- lib/std/math/acos.zig | 4 +- lib/std/math/acosh.zig | 4 +- lib/std/math/asin.zig | 4 +- lib/std/math/asinh.zig | 4 +- lib/std/math/atan.zig | 4 +- lib/std/math/atanh.zig | 4 +- lib/std/math/big/int.zig | 22 +- lib/std/math/cbrt.zig | 10 +- lib/std/math/ceil.zig | 6 +- lib/std/math/complex.zig | 8 +- lib/std/math/complex/acos.zig | 2 +- lib/std/math/complex/ldexp.zig | 4 +- lib/std/math/complex/sqrt.zig | 4 +- lib/std/math/complex/tanh.zig | 2 +- lib/std/math/copysign.zig | 6 +- lib/std/math/cos.zig | 4 +- lib/std/math/cosh.zig | 4 +- lib/std/math/exp.zig | 6 +- lib/std/math/exp2.zig | 6 +- lib/std/math/expm1.zig | 4 +- lib/std/math/expo2.zig | 2 +- lib/std/math/fabs.zig | 8 +- lib/std/math/floor.zig | 10 +- lib/std/math/fma.zig | 2 +- lib/std/math/frexp.zig | 4 +- lib/std/math/hypot.zig | 2 +- lib/std/math/ilogb.zig | 6 +- lib/std/math/isfinite.zig | 12 +- lib/std/math/isinf.zig | 48 +- lib/std/math/isnan.zig | 8 +- lib/std/math/isnormal.zig | 12 +- lib/std/math/ln.zig | 10 +- lib/std/math/log.zig | 14 +- lib/std/math/log10.zig | 10 +- lib/std/math/log1p.zig | 6 +- lib/std/math/log2.zig | 8 +- lib/std/math/modf.zig | 8 +- lib/std/math/round.zig | 4 +- lib/std/math/scalbn.zig | 4 +- lib/std/math/signbit.zig | 6 +- lib/std/math/sin.zig | 6 +- lib/std/math/sinh.zig | 4 +- lib/std/math/sqrt.zig | 10 +- lib/std/math/tan.zig | 4 +- lib/std/math/tanh.zig | 4 +- lib/std/math/trunc.zig | 8 +- lib/std/mem.zig | 26 +- lib/std/meta.zig | 4 +- lib/std/meta/trait.zig | 4 +- lib/std/mutex.zig | 133 ++- lib/std/net.zig | 186 ++-- lib/std/net/test.zig | 38 +- lib/std/os.zig | 33 +- lib/std/os/bits.zig | 3 - lib/std/os/bits/darwin.zig | 6 - lib/std/os/bits/dragonfly.zig | 14 +- lib/std/os/bits/freebsd.zig | 6 - lib/std/os/bits/linux.zig | 15 +- lib/std/os/bits/netbsd.zig | 7 - lib/std/os/bits/windows.zig | 19 + lib/std/os/linux.zig | 194 ++-- lib/std/os/linux/arm-eabi.zig | 4 +- lib/std/os/linux/arm64.zig | 2 +- lib/std/os/linux/mipsel.zig | 6 +- lib/std/os/linux/riscv64.zig | 2 +- lib/std/os/linux/test.zig | 6 +- lib/std/os/linux/vdso.zig | 4 +- lib/std/os/linux/x86_64.zig | 2 +- lib/std/os/test.zig | 2 +- lib/std/os/uefi/protocols.zig | 44 + lib/std/os/uefi/protocols/device_path_protocol.zig | 17 + lib/std/os/uefi/protocols/ip6_config_protocol.zig | 45 + lib/std/os/uefi/protocols/ip6_protocol.zig | 143 +++ lib/std/os/uefi/protocols/ip6_service_binding_protocol.zig | 25 + lib/std/os/uefi/protocols/loaded_image_protocol.zig | 36 + lib/std/os/uefi/protocols/managed_network_protocol.zig | 126 +++ lib/std/os/uefi/protocols/managed_network_service_binding_protocol.zig | 25 + lib/std/os/uefi/protocols/simple_network_protocol.zig | 172 ++++ lib/std/os/uefi/protocols/udp6_protocol.zig | 112 +++ lib/std/os/uefi/protocols/udp6_service_binding_protocol.zig | 25 + lib/std/os/uefi/tables.zig | 3 + lib/std/os/uefi/tables/boot_services.zig | 86 +- lib/std/os/uefi/tables/runtime_services.zig | 8 + lib/std/os/uefi/tables/system_table.zig | 1 + lib/std/os/windows.zig | 132 ++- lib/std/os/windows/bits.zig | 131 ++- lib/std/os/windows/kernel32.zig | 13 + lib/std/os/windows/ntdll.zig | 30 + lib/std/os/windows/status.zig | 1654 +++++++++++++++++++++++++++++++- lib/std/os/windows/ws2_32.zig | 257 +++++ lib/std/os/zen.zig | 4 +- lib/std/packed_int_array.zig | 36 +- lib/std/parker.zig | 180 ++++ lib/std/pdb.zig | 2 +- lib/std/priority_queue.zig | 60 +- lib/std/progress.zig | 7 +- lib/std/rand.zig | 16 +- lib/std/rand/ziggurat.zig | 2 +- lib/std/segmented_list.zig | 10 +- lib/std/sort.zig | 8 +- lib/std/special/build_runner.zig | 35 +- lib/std/special/c.zig | 6 +- lib/std/special/compiler_rt.zig | 34 +- lib/std/special/compiler_rt/addXf3.zig | 26 +- lib/std/special/compiler_rt/addXf3_test.zig | 8 +- lib/std/special/compiler_rt/comparedf2.zig | 20 +- lib/std/special/compiler_rt/comparesf2.zig | 20 +- lib/std/special/compiler_rt/comparetf2.zig | 20 +- lib/std/special/compiler_rt/divdf3.zig | 66 +- lib/std/special/compiler_rt/divsf3.zig | 22 +- lib/std/special/compiler_rt/divti3_test.zig | 8 +- lib/std/special/compiler_rt/extendXfYf2.zig | 14 +- lib/std/special/compiler_rt/extendXfYf2_test.zig | 8 +- lib/std/special/compiler_rt/fixdfdi_test.zig | 2 +- lib/std/special/compiler_rt/fixdfsi_test.zig | 2 +- lib/std/special/compiler_rt/fixdfti_test.zig | 2 +- lib/std/special/compiler_rt/fixint.zig | 6 +- lib/std/special/compiler_rt/fixint_test.zig | 26 +- lib/std/special/compiler_rt/fixsfdi_test.zig | 2 +- lib/std/special/compiler_rt/fixsfsi_test.zig | 2 +- lib/std/special/compiler_rt/fixsfti_test.zig | 2 +- lib/std/special/compiler_rt/fixtfdi_test.zig | 2 +- lib/std/special/compiler_rt/fixtfsi_test.zig | 2 +- lib/std/special/compiler_rt/fixtfti_test.zig | 2 +- lib/std/special/compiler_rt/fixuint.zig | 8 +- lib/std/special/compiler_rt/fixunstfsi_test.zig | 2 +- lib/std/special/compiler_rt/fixunstfti_test.zig | 2 +- lib/std/special/compiler_rt/floatsiXf.zig | 10 +- lib/std/special/compiler_rt/floattidf.zig | 2 +- lib/std/special/compiler_rt/floattisf.zig | 2 +- lib/std/special/compiler_rt/floattitf.zig | 2 +- lib/std/special/compiler_rt/floatunsidf.zig | 6 +- lib/std/special/compiler_rt/floatuntidf.zig | 4 +- lib/std/special/compiler_rt/floatuntisf.zig | 4 +- lib/std/special/compiler_rt/floatuntitf.zig | 4 +- lib/std/special/compiler_rt/mulXf3.zig | 50 +- lib/std/special/compiler_rt/mulXf3_test.zig | 18 +- lib/std/special/compiler_rt/muldi3.zig | 2 +- lib/std/special/compiler_rt/mulodi4.zig | 2 +- lib/std/special/compiler_rt/mulodi4_test.zig | 48 +- lib/std/special/compiler_rt/muloti4.zig | 2 +- lib/std/special/compiler_rt/muloti4_test.zig | 62 +- lib/std/special/compiler_rt/multi3.zig | 2 +- lib/std/special/compiler_rt/negXf2.zig | 2 +- lib/std/special/compiler_rt/popcountdi2_test.zig | 6 +- lib/std/special/compiler_rt/truncXfYf2.zig | 2 +- lib/std/special/compiler_rt/truncXfYf2_test.zig | 20 +- lib/std/special/compiler_rt/udivmod.zig | 6 +- lib/std/special/docs/index.html | 2 +- lib/std/special/docs/main.js | 31 +- lib/std/special/start.zig | 2 +- lib/std/spinlock.zig | 45 +- lib/std/statically_initialized_mutex.zig | 105 -- lib/std/std.zig | 2 +- lib/std/target.zig | 38 +- lib/std/testing.zig | 2 +- lib/std/thread.zig | 2 +- lib/std/time.zig | 8 +- lib/std/unicode.zig | 26 +- lib/std/unicode/throughput_test.zig | 4 +- lib/std/valgrind.zig | 80 +- lib/std/valgrind/callgrind.zig | 14 +- lib/std/valgrind/memcheck.zig | 81 +- lib/std/zig/ast.zig | 23 +- lib/std/zig/parse.zig | 93 +- lib/std/zig/parse_string_literal.zig | 2 +- lib/std/zig/parser_test.zig | 98 +- lib/std/zig/render.zig | 78 +- lib/std/zig/tokenizer.zig | 56 +- src-self-hosted/clang.zig | 4 + src-self-hosted/main.zig | 11 +- src-self-hosted/stage1.zig | 14 +- src-self-hosted/test.zig | 6 +- src-self-hosted/translate_c.zig | 19 +- src/all_types.hpp | 63 +- src/analyze.cpp | 288 ++++-- src/analyze.hpp | 9 +- src/ast_render.cpp | 22 +- src/codegen.cpp | 184 ++-- src/dump_analysis.cpp | 7 +- src/ir.cpp | 1603 +++++++++++++++++++++---------- src/ir_print.cpp | 72 +- src/ir_print.hpp | 1 + src/parser.cpp | 60 +- src/range_set.cpp | 3 + src/tokenizer.cpp | 33 +- src/tokenizer.hpp | 1 + src/translate_c.cpp | 35 +- src/zig_clang.cpp | 5 + src/zig_clang.h | 3 + test/compare_output.zig | 122 +-- test/compile_errors.zig | 270 ++++-- test/stage1/behavior.zig | 2 + test/stage1/behavior/align.zig | 4 +- test/stage1/behavior/array.zig | 39 +- test/stage1/behavior/asm.zig | 16 +- test/stage1/behavior/async_fn.zig | 14 +- test/stage1/behavior/atomics.zig | 43 +- test/stage1/behavior/bitreverse.zig | 28 +- test/stage1/behavior/bool.zig | 8 +- test/stage1/behavior/bugs/1322.zig | 4 +- test/stage1/behavior/bugs/1421.zig | 2 +- test/stage1/behavior/bugs/2114.zig | 8 +- test/stage1/behavior/bugs/2889.zig | 31 + test/stage1/behavior/bugs/3007.zig | 23 + test/stage1/behavior/bugs/3046.zig | 2 +- test/stage1/behavior/byteswap.zig | 24 +- test/stage1/behavior/cast.zig | 49 +- test/stage1/behavior/defer.zig | 2 +- test/stage1/behavior/enum.zig | 4 +- test/stage1/behavior/error.zig | 8 +- test/stage1/behavior/eval.zig | 36 +- test/stage1/behavior/floatop.zig | 4 +- test/stage1/behavior/fn.zig | 20 +- test/stage1/behavior/if.zig | 4 +- test/stage1/behavior/import.zig | 4 +- test/stage1/behavior/math.zig | 24 +- test/stage1/behavior/misc.zig | 16 +- test/stage1/behavior/popcount.zig | 2 +- test/stage1/behavior/pub_enum.zig | 2 +- test/stage1/behavior/shuffle.zig | 26 +- test/stage1/behavior/slicetobytes.zig | 2 +- test/stage1/behavior/struct.zig | 84 +- test/stage1/behavior/switch.zig | 8 +- test/stage1/behavior/try.zig | 6 +- test/stage1/behavior/type_info.zig | 46 +- test/stage1/behavior/union.zig | 71 +- test/stage1/behavior/var_args.zig | 10 +- test/stage1/behavior/vector.zig | 50 +- test/stage1/behavior/void.zig | 2 +- test/stage1/behavior/while.zig | 16 +- test/standalone/brace_expansion/main.zig | 4 +- test/standalone/cat/main.zig | 14 +- test/standalone/guess_number/main.zig | 3 +- test/standalone/hello_world/hello.zig | 3 +- test/tests.zig | 4 +- test/translate_c.zig | 123 +-- 309 files changed, 8518 insertions(+), 3248 deletions(-)