.builds/freebsd.yml | 43 + CMakeLists.txt | 34 +- README.md | 54 +- build.zig | 59 +- ci/azure/windows_install | 1 + cmake/Findllvm.cmake | 45 + doc/docgen.zig | 31 +- doc/langref.html.in | 365 +++- doc/targets.md | 15 - example/guess_number/main.zig | 2 +- example/hello_world/hello.zig | 2 +- src-self-hosted/arg.zig | 23 +- src-self-hosted/codegen.zig | 42 +- src-self-hosted/compilation.zig | 99 +- src-self-hosted/errmsg.zig | 20 +- src-self-hosted/introspect.zig | 4 +- src-self-hosted/ir.zig | 35 +- src-self-hosted/libc_installation.zig | 45 +- src-self-hosted/link.zig | 2 +- src-self-hosted/llvm.zig | 181 +- src-self-hosted/main.zig | 15 +- src-self-hosted/package.zig | 6 +- src-self-hosted/scope.zig | 20 +- src-self-hosted/target.zig | 6 +- src-self-hosted/test.zig | 8 +- src-self-hosted/type.zig | 75 +- src-self-hosted/value.zig | 53 +- src/all_types.hpp | 273 ++- src/analyze.cpp | 919 ++++++--- src/analyze.hpp | 22 +- src/ast_render.cpp | 42 +- src/ast_render.hpp | 3 - src/bigint.cpp | 1 + src/cache_hash.cpp | 16 +- src/codegen.cpp | 982 +++++++--- src/codegen.hpp | 3 +- src/ir.cpp | 3178 +++++++++++++++++++++----------- src/ir.hpp | 9 +- src/ir_print.cpp | 151 +- src/link.cpp | 306 +-- src/main.cpp | 98 +- src/os.cpp | 64 +- src/os.hpp | 3 +- src/parser.cpp | 40 +- src/target.cpp | 15 +- src/target.hpp | 14 + src/tokenizer.cpp | 33 +- src/tokenizer.hpp | 2 + src/translate_c.cpp | 2399 ++++++++++++------------ src/zig_clang.cpp | 214 +++ src/zig_clang.h | 259 +++ src/zig_llvm.cpp | 15 +- src/zig_llvm.h | 3 + std/array_list.zig | 115 +- std/atomic/queue.zig | 66 +- std/atomic/stack.zig | 88 +- std/base64.zig | 13 +- std/buf_map.zig | 52 +- std/buf_set.zig | 6 +- std/buffer.zig | 15 +- std/build.zig | 149 +- std/c/darwin.zig | 22 +- std/c/freebsd.zig | 91 +- std/c/index.zig | 2 +- std/coff.zig | 44 +- std/crypto/blake2.zig | 11 +- std/crypto/chacha20.zig | 68 +- std/crypto/md5.zig | 3 +- std/crypto/poly1305.zig | 29 +- std/crypto/sha1.zig | 3 +- std/crypto/sha2.zig | 6 +- std/crypto/sha3.zig | 5 +- std/crypto/test.zig | 9 +- std/crypto/x25519.zig | 65 +- std/cstr.zig | 6 +- std/debug/index.zig | 190 +- std/dynamic_library.zig | 7 +- std/elf.zig | 70 +- std/event/channel.zig | 17 +- std/event/fs.zig | 70 +- std/event/future.zig | 6 +- std/event/group.zig | 14 +- std/event/io.zig | 14 +- std/event/lock.zig | 6 +- std/event/loop.zig | 27 +- std/event/net.zig | 7 +- std/event/rwlock.zig | 10 +- std/fmt/index.zig | 208 ++- std/fmt/parse_float.zig | 420 +++++ std/hash/adler.zig | 12 +- std/hash/crc.zig | 25 +- std/hash/fnv.zig | 18 +- std/hash/siphash.zig | 29 +- std/hash_map.zig | 63 +- std/heap.zig | 153 +- std/index.zig | 20 +- std/io.zig | 804 +++++++- std/io_test.zig | 506 ++++- std/json.zig | 25 +- std/json_test.zig | 6 +- std/lazy_init.zig | 9 +- std/linked_list.zig | 31 +- std/math/acos.zig | 38 +- std/math/acosh.zig | 30 +- std/math/asin.zig | 46 +- std/math/asinh.zig | 54 +- std/math/atan.zig | 42 +- std/math/atan2.zig | 116 +- std/math/atanh.zig | 38 +- std/math/big/int.zig | 367 ++-- std/math/cbrt.zig | 50 +- std/math/ceil.zig | 38 +- std/math/complex/abs.zig | 4 +- std/math/complex/acos.zig | 6 +- std/math/complex/acosh.zig | 6 +- std/math/complex/arg.zig | 4 +- std/math/complex/asin.zig | 6 +- std/math/complex/asinh.zig | 6 +- std/math/complex/atan.zig | 10 +- std/math/complex/atanh.zig | 6 +- std/math/complex/conj.zig | 4 +- std/math/complex/cos.zig | 6 +- std/math/complex/cosh.zig | 10 +- std/math/complex/exp.zig | 10 +- std/math/complex/index.zig | 16 +- std/math/complex/log.zig | 6 +- std/math/complex/pow.zig | 6 +- std/math/complex/proj.zig | 4 +- std/math/complex/sin.zig | 6 +- std/math/complex/sinh.zig | 10 +- std/math/complex/sqrt.zig | 10 +- std/math/complex/tan.zig | 6 +- std/math/complex/tanh.zig | 10 +- std/math/copysign.zig | 32 +- std/math/cos.zig | 42 +- std/math/cosh.zig | 42 +- std/math/exp2.zig | 32 +- std/math/expm1.zig | 38 +- std/math/fabs.zig | 57 +- std/math/floor.zig | 56 +- std/math/fma.zig | 34 +- std/math/frexp.zig | 34 +- std/math/hypot.zig | 58 +- std/math/ilogb.zig | 46 +- std/math/index.zig | 362 ++-- std/math/inf.zig | 7 +- std/math/isfinite.zig | 26 +- std/math/isinf.zig | 96 +- std/math/isnan.zig | 20 +- std/math/isnormal.zig | 20 +- std/math/ln.zig | 46 +- std/math/log.zig | 26 +- std/math/log10.zig | 46 +- std/math/log1p.zig | 58 +- std/math/log2.zig | 42 +- std/math/modf.zig | 58 +- std/math/nan.zig | 7 +- std/math/pow.zig | 96 +- std/math/powi.zig | 138 +- std/math/round.zig | 42 +- std/math/scalbn.zig | 10 +- std/math/signbit.zig | 20 +- std/math/sin.zig | 52 +- std/math/sinh.zig | 42 +- std/math/sqrt.zig | 104 +- std/math/tan.zig | 50 +- std/math/tanh.zig | 46 +- std/math/trunc.zig | 38 +- std/mem.zig | 804 +++++--- std/meta/index.zig | 188 +- std/meta/trait.zig | 148 +- std/mutex.zig | 153 +- std/net.zig | 12 +- std/os/child_process.zig | 21 +- std/os/darwin.zig | 2 +- std/os/freebsd/index.zig | 291 +-- std/os/freebsd/syscall.zig | 493 ----- std/os/freebsd/x86_64.zig | 136 -- std/os/get_app_data_dir.zig | 7 +- std/os/index.zig | 251 ++- std/os/linux/test.zig | 12 +- std/os/path.zig | 280 +-- std/os/test.zig | 36 +- std/os/time.zig | 27 +- std/os/uefi.zig | 2 + std/os/windows/index.zig | 18 + std/os/windows/kernel32.zig | 57 +- std/os/windows/tls.zig | 36 + std/pdb.zig | 18 +- std/rand/index.zig | 169 +- std/rb.zig | 5 +- std/segmented_list.zig | 31 +- std/sort.zig | 17 +- std/special/bootstrap.zig | 78 +- std/special/compiler_rt/addXf3.zig | 191 ++ std/special/compiler_rt/addXf3_test.zig | 85 + std/special/compiler_rt/divti3_test.zig | 4 +- std/special/compiler_rt/extendXfYf2_test.zig | 1 - std/special/compiler_rt/fixdfdi.zig | 11 + std/special/compiler_rt/fixdfdi_test.zig | 66 + std/special/compiler_rt/fixdfsi.zig | 11 + std/special/compiler_rt/fixdfsi_test.zig | 74 + std/special/compiler_rt/fixdfti.zig | 11 + std/special/compiler_rt/fixdfti_test.zig | 66 + std/special/compiler_rt/fixint.zig | 74 + std/special/compiler_rt/fixint_test.zig | 152 ++ std/special/compiler_rt/fixsfdi.zig | 11 + std/special/compiler_rt/fixsfdi_test.zig | 68 + std/special/compiler_rt/fixsfsi.zig | 11 + std/special/compiler_rt/fixsfsi_test.zig | 76 + std/special/compiler_rt/fixsfti.zig | 11 + std/special/compiler_rt/fixsfti_test.zig | 84 + std/special/compiler_rt/fixtfdi.zig | 11 + std/special/compiler_rt/fixtfdi_test.zig | 76 + std/special/compiler_rt/fixtfsi.zig | 11 + std/special/compiler_rt/fixtfsi_test.zig | 76 + std/special/compiler_rt/fixtfti.zig | 11 + std/special/compiler_rt/fixtfti_test.zig | 66 + std/special/compiler_rt/fixunsdfdi_test.zig | 4 +- std/special/compiler_rt/fixunsdfsi_test.zig | 4 +- std/special/compiler_rt/fixunsdfti_test.zig | 4 +- std/special/compiler_rt/fixunssfdi_test.zig | 4 +- std/special/compiler_rt/fixunssfsi_test.zig | 4 +- std/special/compiler_rt/fixunssfti_test.zig | 4 +- std/special/compiler_rt/fixunstfdi_test.zig | 4 +- std/special/compiler_rt/fixunstfsi_test.zig | 4 +- std/special/compiler_rt/fixunstfti_test.zig | 4 +- std/special/compiler_rt/floattidf_test.zig | 4 +- std/special/compiler_rt/floattisf_test.zig | 4 +- std/special/compiler_rt/floattitf_test.zig | 4 +- std/special/compiler_rt/floatunditf_test.zig | 1 - std/special/compiler_rt/floatunsitf_test.zig | 1 - std/special/compiler_rt/floatuntidf_test.zig | 4 +- std/special/compiler_rt/floatuntisf_test.zig | 4 +- std/special/compiler_rt/floatuntitf_test.zig | 4 +- std/special/compiler_rt/index.zig | 19 +- std/special/compiler_rt/muloti4_test.zig | 4 +- std/special/compiler_rt/multi3_test.zig | 4 +- std/special/compiler_rt/truncXfYf2.zig | 4 + std/special/compiler_rt/truncXfYf2_test.zig | 68 + std/special/compiler_rt/udivmoddi4_test.zig | 6 +- std/special/compiler_rt/udivmodti4_test.zig | 6 +- std/special/fmt_runner.zig | 260 +++ std/special/init-lib/src/main.zig | 4 +- std/special/panic.zig | 4 + std/statically_initialized_mutex.zig | 111 ++ std/testing.zig | 147 ++ std/unicode.zig | 149 +- std/zig/ast.zig | 9 +- std/zig/parse.zig | 437 +++-- std/zig/parser_test.zig | 17 +- std/zig/render.zig | 3 + std/zig/tokenizer.zig | 27 +- test/behavior.zig | 77 - test/cases/align.zig | 230 --- test/cases/alignof.zig | 17 - test/cases/array.zig | 173 -- test/cases/asm.zig | 48 - test/cases/atomics.zig | 71 - test/cases/bit_shifting.zig | 88 - test/cases/bitcast.zig | 37 - test/cases/bool.zig | 35 - test/cases/bugs/1076.zig | 16 - test/cases/bugs/1111.zig | 12 - test/cases/bugs/1277.zig | 15 - test/cases/bugs/1322.zig | 19 - test/cases/bugs/1381.zig | 21 - test/cases/bugs/1421.zig | 14 - test/cases/bugs/1442.zig | 11 - test/cases/bugs/1486.zig | 11 - test/cases/bugs/394.zig | 18 - test/cases/bugs/655.zig | 12 - test/cases/bugs/655_other_file.zig | 1 - test/cases/bugs/656.zig | 31 - test/cases/bugs/726.zig | 16 - test/cases/bugs/828.zig | 33 - test/cases/bugs/920.zig | 65 - test/cases/byval_arg_var.zig | 27 - test/cases/cancel.zig | 92 - test/cases/cast.zig | 472 ----- test/cases/const_slice_child.zig | 45 - test/cases/coroutine_await_struct.zig | 47 - test/cases/coroutines.zig | 258 --- test/cases/defer.zig | 78 - test/cases/enum.zig | 894 --------- test/cases/enum_with_members.zig | 27 - test/cases/error.zig | 245 --- test/cases/eval.zig | 782 -------- test/cases/field_parent_ptr.zig | 41 - test/cases/fn.zig | 207 --- test/cases/fn_in_struct_in_comptime.zig | 17 - test/cases/for.zig | 106 -- test/cases/generics.zig | 151 -- test/cases/if.zig | 37 - test/cases/import.zig | 10 - test/cases/import/a_namespace.zig | 3 - test/cases/incomplete_struct_param_tld.zig | 30 - test/cases/ir_block_deps.zig | 21 - test/cases/math.zig | 500 ----- test/cases/merge_error_sets.zig | 21 - test/cases/misc.zig | 681 ------- test/cases/namespace_depends_on_compile_var/a.zig | 1 - test/cases/namespace_depends_on_compile_var/b.zig | 1 - test/cases/namespace_depends_on_compile_var/index.zig | 14 - test/cases/new_stack_call.zig | 26 - test/cases/null.zig | 162 -- test/cases/optional.zig | 30 - test/cases/pointers.zig | 44 - test/cases/popcount.zig | 24 - test/cases/pub_enum/index.zig | 13 - test/cases/pub_enum/other.zig | 6 - test/cases/ref_var_in_if_after_if_2nd_switch_prong.zig | 37 - test/cases/reflection.zig | 95 - test/cases/sizeof_and_typeof.zig | 69 - test/cases/slice.zig | 40 - test/cases/struct.zig | 470 ----- test/cases/struct_contains_null_ptr_itself.zig | 21 - test/cases/struct_contains_slice_of_itself.zig | 43 - test/cases/switch.zig | 234 --- test/cases/switch_prong_err_enum.zig | 30 - test/cases/switch_prong_implicit_cast.zig | 22 - test/cases/syntax.zig | 59 - test/cases/this.zig | 34 - test/cases/try.zig | 43 - test/cases/type_info.zig | 259 --- test/cases/undefined.zig | 68 - test/cases/underscore.zig | 28 - test/cases/union.zig | 352 ---- test/cases/var_args.zig | 84 - test/cases/void.zig | 30 - test/cases/while.zig | 227 --- test/cases/widening.zig | 27 - test/cli.zig | 18 +- test/compile_errors.zig | 432 ++++- test/runtime_safety.zig | 41 + test/stage1/behavior.zig | 82 + test/stage1/behavior/align.zig | 230 +++ test/stage1/behavior/alignof.zig | 18 + test/stage1/behavior/array.zig | 270 +++ test/stage1/behavior/asm.zig | 92 + test/stage1/behavior/atomics.zig | 71 + test/stage1/behavior/bit_shifting.zig | 88 + test/stage1/behavior/bitcast.zig | 36 + test/stage1/behavior/bitreverse.zig | 81 + test/stage1/behavior/bool.zig | 35 + test/stage1/behavior/bswap.zig | 32 + test/stage1/behavior/bugs/1076.zig | 16 + test/stage1/behavior/bugs/1111.zig | 12 + test/stage1/behavior/bugs/1277.zig | 15 + test/stage1/behavior/bugs/1322.zig | 19 + test/stage1/behavior/bugs/1381.zig | 21 + test/stage1/behavior/bugs/1421.zig | 14 + test/stage1/behavior/bugs/1442.zig | 11 + test/stage1/behavior/bugs/1486.zig | 11 + test/stage1/behavior/bugs/1851.zig | 27 + test/stage1/behavior/bugs/394.zig | 18 + test/stage1/behavior/bugs/655.zig | 12 + test/stage1/behavior/bugs/655_other_file.zig | 1 + test/stage1/behavior/bugs/656.zig | 31 + test/stage1/behavior/bugs/726.zig | 16 + test/stage1/behavior/bugs/828.zig | 33 + test/stage1/behavior/bugs/920.zig | 65 + test/stage1/behavior/byval_arg_var.zig | 27 + test/stage1/behavior/cancel.zig | 92 + test/stage1/behavior/cast.zig | 484 +++++ test/stage1/behavior/const_slice_child.zig | 46 + test/stage1/behavior/coroutine_await_struct.zig | 47 + test/stage1/behavior/coroutines.zig | 258 +++ test/stage1/behavior/defer.zig | 78 + test/stage1/behavior/enum.zig | 894 +++++++++ test/stage1/behavior/enum_with_members.zig | 27 + test/stage1/behavior/error.zig | 337 ++++ test/stage1/behavior/eval.zig | 778 ++++++++ test/stage1/behavior/field_parent_ptr.zig | 41 + test/stage1/behavior/fn.zig | 208 +++ test/stage1/behavior/fn_in_struct_in_comptime.zig | 17 + test/stage1/behavior/for.zig | 106 ++ test/stage1/behavior/generics.zig | 151 ++ test/stage1/behavior/if.zig | 37 + test/stage1/behavior/import.zig | 10 + test/stage1/behavior/import/a_namespace.zig | 3 + test/stage1/behavior/incomplete_struct_param_tld.zig | 30 + test/stage1/behavior/inttoptr.zig | 26 + test/stage1/behavior/ir_block_deps.zig | 21 + test/stage1/behavior/math.zig | 517 ++++++ test/stage1/behavior/merge_error_sets.zig | 21 + test/stage1/behavior/misc.zig | 695 +++++++ test/stage1/behavior/namespace_depends_on_compile_var/a.zig | 1 + test/stage1/behavior/namespace_depends_on_compile_var/b.zig | 1 + test/stage1/behavior/namespace_depends_on_compile_var/index.zig | 14 + test/stage1/behavior/new_stack_call.zig | 26 + test/stage1/behavior/null.zig | 162 ++ test/stage1/behavior/optional.zig | 81 + test/stage1/behavior/pointers.zig | 126 ++ test/stage1/behavior/popcount.zig | 25 + test/stage1/behavior/ptrcast.zig | 52 + test/stage1/behavior/pub_enum/index.zig | 13 + test/stage1/behavior/pub_enum/other.zig | 6 + test/stage1/behavior/ref_var_in_if_after_if_2nd_switch_prong.zig | 37 + test/stage1/behavior/reflection.zig | 96 + test/stage1/behavior/sizeof_and_typeof.zig | 69 + test/stage1/behavior/slice.zig | 40 + test/stage1/behavior/struct.zig | 470 +++++ test/stage1/behavior/struct_contains_null_ptr_itself.zig | 21 + test/stage1/behavior/struct_contains_slice_of_itself.zig | 85 + test/stage1/behavior/switch.zig | 271 +++ test/stage1/behavior/switch_prong_err_enum.zig | 30 + test/stage1/behavior/switch_prong_implicit_cast.zig | 22 + test/stage1/behavior/syntax.zig | 60 + test/stage1/behavior/this.zig | 35 + test/stage1/behavior/truncate.zig | 36 + test/stage1/behavior/try.zig | 43 + test/stage1/behavior/type_info.zig | 291 +++ test/stage1/behavior/undefined.zig | 69 + test/stage1/behavior/underscore.zig | 28 + test/stage1/behavior/union.zig | 352 ++++ test/stage1/behavior/var_args.zig | 84 + test/stage1/behavior/vector.zig | 45 + test/stage1/behavior/void.zig | 35 + test/stage1/behavior/while.zig | 228 +++ test/stage1/behavior/widening.zig | 28 + test/stage1/c_abi/main.zig | 82 +- test/standalone/brace_expansion/main.zig | 9 +- test/standalone/issue_794/main.zig | 4 +- test/tests.zig | 192 +- test/translate_c.zig | 92 +- 426 files changed, 25085 insertions(+), 16300 deletions(-)