README.md | 10 - build.zig | 17 +- ci/appveyor/after_build.bat | 1 + doc/docgen.zig | 549 +++++++- doc/langref.html.in | 2162 +++++++++++++++++--------------- example/cat/main.zig | 8 +- example/guess_number/main.zig | 2 +- example/hello_world/hello.zig | 2 +- example/hello_world/hello_libc.zig | 2 +- example/hello_world/hello_windows.zig | 2 +- example/mix_o_files/base64.zig | 2 +- example/mix_o_files/build.zig | 2 +- example/shared_library/build.zig | 2 +- example/shared_library/mathtest.zig | 2 +- src-self-hosted/ast.zig | 32 +- src-self-hosted/ir.zig | 2 +- src-self-hosted/llvm.zig | 2 +- src-self-hosted/main.zig | 20 +- src-self-hosted/module.zig | 36 +- src-self-hosted/parser.zig | 221 ++-- src-self-hosted/target.zig | 12 +- src-self-hosted/tokenizer.zig | 20 +- src/all_types.hpp | 21 +- src/analyze.cpp | 176 ++- src/ast_render.cpp | 9 +- src/codegen.cpp | 351 ++++-- src/ir.cpp | 201 ++- src/ir_print.cpp | 21 +- src/main.cpp | 2 +- src/os.cpp | 29 +- src/parser.cpp | 35 +- src/tokenizer.cpp | 4 +- src/tokenizer.hpp | 2 +- src/translate_c.cpp | 2 +- std/array_list.zig | 32 +- std/base64.zig | 36 +- std/buf_map.zig | 24 +- std/buf_set.zig | 20 +- std/buffer.zig | 44 +- std/build.zig | 248 ++-- std/c/darwin.zig | 6 +- std/c/index.zig | 74 +- std/c/linux.zig | 4 +- std/c/windows.zig | 2 +- std/crypto/blake2.zig | 30 +- std/crypto/md5.zig | 14 +- std/crypto/sha1.zig | 14 +- std/crypto/sha2.zig | 32 +- std/crypto/sha3.zig | 14 +- std/crypto/test.zig | 4 +- std/crypto/throughput_test.zig | 2 +- std/cstr.zig | 18 +- std/debug/failing_allocator.zig | 8 +- std/debug/index.zig | 102 +- std/elf.zig | 12 +- std/endian.zig | 8 +- std/fmt/errol/enum3.zig | 2 +- std/fmt/errol/index.zig | 32 +- std/fmt/index.zig | 46 +- std/hash_map.zig | 36 +- std/heap.zig | 20 +- std/io.zig | 142 ++- std/linked_list.zig | 36 +- std/math/acos.zig | 10 +- std/math/acosh.zig | 6 +- std/math/asin.zig | 10 +- std/math/asinh.zig | 6 +- std/math/atan.zig | 6 +- std/math/atan2.zig | 6 +- std/math/atanh.zig | 6 +- std/math/cbrt.zig | 6 +- std/math/ceil.zig | 6 +- std/math/copysign.zig | 6 +- std/math/cos.zig | 6 +- std/math/cosh.zig | 6 +- std/math/exp.zig | 6 +- std/math/exp2.zig | 6 +- std/math/expm1.zig | 6 +- std/math/expo2.zig | 6 +- std/math/fabs.zig | 6 +- std/math/floor.zig | 6 +- std/math/fma.zig | 14 +- std/math/frexp.zig | 8 +- std/math/hypot.zig | 8 +- std/math/ilogb.zig | 6 +- std/math/index.zig | 86 +- std/math/inf.zig | 2 +- std/math/isfinite.zig | 2 +- std/math/isinf.zig | 6 +- std/math/isnan.zig | 4 +- std/math/isnormal.zig | 2 +- std/math/ln.zig | 6 +- std/math/log.zig | 2 +- std/math/log10.zig | 6 +- std/math/log1p.zig | 6 +- std/math/log2.zig | 8 +- std/math/modf.zig | 8 +- std/math/nan.zig | 4 +- std/math/pow.zig | 4 +- std/math/round.zig | 6 +- std/math/scalbn.zig | 6 +- std/math/signbit.zig | 6 +- std/math/sin.zig | 6 +- std/math/sinh.zig | 6 +- std/math/sqrt.zig | 8 +- std/math/tan.zig | 6 +- std/math/tanh.zig | 6 +- std/math/trunc.zig | 6 +- std/math/x86_64/sqrt.zig | 4 +- std/mem.zig | 100 +- std/net.zig | 20 +- std/os/child_process.zig | 98 +- std/os/darwin.zig | 90 +- std/os/get_user_id.zig | 4 +- std/os/index.zig | 162 +-- std/os/linux.zig | 168 ++- std/os/linux_i386.zig | 14 +- std/os/linux_x86_64.zig | 16 +- std/os/path.zig | 90 +- std/os/windows/index.zig | 81 +- std/os/windows/util.zig | 20 +- std/os/zen.zig | 24 +- std/rand.zig | 18 +- std/sort.zig | 62 +- std/special/bootstrap.zig | 14 +- std/special/bootstrap_lib.zig | 2 +- std/special/build_file_template.zig | 2 +- std/special/build_runner.zig | 8 +- std/special/builtin.zig | 33 +- std/special/compiler_rt/aulldiv.zig | 4 +- std/special/compiler_rt/aullrem.zig | 4 +- std/special/compiler_rt/comparetf2.zig | 12 +- std/special/compiler_rt/fixuint.zig | 8 +- std/special/compiler_rt/fixunsdfdi.zig | 4 +- std/special/compiler_rt/fixunsdfdi_test.zig | 2 +- std/special/compiler_rt/fixunsdfsi.zig | 4 +- std/special/compiler_rt/fixunsdfsi_test.zig | 2 +- std/special/compiler_rt/fixunsdfti.zig | 4 +- std/special/compiler_rt/fixunsdfti_test.zig | 2 +- std/special/compiler_rt/fixunssfdi.zig | 4 +- std/special/compiler_rt/fixunssfdi_test.zig | 2 +- std/special/compiler_rt/fixunssfsi.zig | 4 +- std/special/compiler_rt/fixunssfsi_test.zig | 2 +- std/special/compiler_rt/fixunssfti.zig | 4 +- std/special/compiler_rt/fixunssfti_test.zig | 2 +- std/special/compiler_rt/fixunstfdi.zig | 4 +- std/special/compiler_rt/fixunstfdi_test.zig | 2 +- std/special/compiler_rt/fixunstfsi.zig | 4 +- std/special/compiler_rt/fixunstfsi_test.zig | 2 +- std/special/compiler_rt/fixunstfti.zig | 4 +- std/special/compiler_rt/fixunstfti_test.zig | 2 +- std/special/compiler_rt/index.zig | 51 +- std/special/compiler_rt/udivmod.zig | 4 +- std/special/compiler_rt/udivmoddi4.zig | 4 +- std/special/compiler_rt/udivmoddi4_test.zig | 2 +- std/special/compiler_rt/udivmodti4.zig | 4 +- std/special/compiler_rt/udivmodti4_test.zig | 2 +- std/special/compiler_rt/udivti3.zig | 4 +- std/special/compiler_rt/umodti3.zig | 4 +- std/special/panic.zig | 3 +- std/special/test_runner.zig | 2 +- std/unicode.zig | 16 +- std/zlib/deflate.zig | 522 -------- std/zlib/inflate.zig | 969 -------------- test/assemble_and_link.zig | 2 +- test/build_examples.zig | 2 +- test/cases/align.zig | 46 +- test/cases/array.zig | 2 +- test/cases/asm.zig | 4 +- test/cases/bitcast.zig | 6 +- test/cases/bool.zig | 4 +- test/cases/bugs/655.zig | 2 +- test/cases/bugs/656.zig | 2 +- test/cases/cast.zig | 46 +- test/cases/const_slice_child.zig | 8 +- test/cases/defer.zig | 6 +- test/cases/enum.zig | 26 +- test/cases/enum_with_members.zig | 2 +- test/cases/error.zig | 18 +- test/cases/eval.zig | 50 +- test/cases/field_parent_ptr.zig | 4 +- test/cases/fn.zig | 24 +- test/cases/for.zig | 6 +- test/cases/generics.zig | 38 +- test/cases/if.zig | 6 +- test/cases/import/a_namespace.zig | 2 +- test/cases/incomplete_struct_param_tld.zig | 4 +- test/cases/ir_block_deps.zig | 4 +- test/cases/math.zig | 52 +- test/cases/misc.zig | 69 +- test/cases/null.zig | 12 +- test/cases/pub_enum/index.zig | 2 +- test/cases/ref_var_in_if_after_if_2nd_switch_prong.zig | 4 +- test/cases/reflection.zig | 4 +- test/cases/slice.zig | 6 +- test/cases/struct.zig | 34 +- test/cases/switch.zig | 30 +- test/cases/switch_prong_err_enum.zig | 4 +- test/cases/switch_prong_implicit_cast.zig | 2 +- test/cases/syntax.zig | 22 +- test/cases/this.zig | 8 +- test/cases/try.zig | 6 +- test/cases/undefined.zig | 6 +- test/cases/union.zig | 45 +- test/cases/var_args.zig | 24 +- test/cases/while.zig | 32 +- test/compare_output.zig | 74 +- test/compile_errors.zig | 872 +++++++------ test/debug_safety.zig | 286 ----- test/gen_h.zig | 69 + test/runtime_safety.zig | 286 +++++ test/standalone/brace_expansion/build.zig | 2 +- test/standalone/brace_expansion/main.zig | 18 +- test/standalone/issue_339/build.zig | 2 +- test/standalone/issue_339/test.zig | 6 +- test/standalone/pkg_import/build.zig | 2 +- test/standalone/pkg_import/pkg.zig | 2 +- test/standalone/pkg_import/test.zig | 2 +- test/standalone/use_alias/build.zig | 2 +- test/tests.zig | 263 +++- test/translate_c.zig | 132 +- 221 files changed, 5224 insertions(+), 5546 deletions(-)