.builds/freebsd.yml | 22 + CMakeLists.txt | 16 + README.md | 101 ++-- build.zig | 2 +- ci/azure/linux_script | 3 + ci/azure/macos_script | 3 + ci/azure/windows_install | 1 + ci/azure/windows_upload | 3 + cmake/Findclang.cmake | 2 + cmake/Findlld.cmake | 8 +- cmake/Findllvm.cmake | 2 +- deps/lld/ELF/OutputSections.cpp | 2 +- doc/langref.html.in | 267 +++++++---- example/guess_number/main.zig | 10 +- example/hello_world/hello.zig | 2 +- src-self-hosted/compilation.zig | 3 +- src-self-hosted/libc_installation.zig | 2 +- src-self-hosted/target.zig | 306 ++++++------ src/all_types.hpp | 14 +- src/analyze.cpp | 158 ++++--- src/analyze.hpp | 8 +- src/buffer.hpp | 10 + src/cache_hash.cpp | 6 +- src/codegen.cpp | 111 +++-- src/error.cpp | 1 + src/error.hpp | 1 + src/ir.cpp | 807 ++++++++++++++++++++++++-------- src/ir_print.cpp | 15 + src/link.cpp | 7 + src/main.cpp | 9 +- src/os.cpp | 38 +- src/os.hpp | 2 + src/parser.cpp | 26 +- src/target.cpp | 63 ++- src/target.hpp | 2 + src/translate_c.cpp | 8 + src/util.hpp | 11 + src/zig_llvm.cpp | 175 ++++++- std/array_list.zig | 11 + std/atomic/int.zig | 4 + std/buf_map.zig | 36 +- std/build.zig | 46 +- std/c/freebsd.zig | 33 ++ std/c/index.zig | 1 + std/coff.zig | 44 +- std/crypto/blake2.zig | 11 +- std/crypto/chacha20.zig | 53 ++- std/crypto/md5.zig | 3 +- std/crypto/poly1305.zig | 27 +- std/crypto/sha1.zig | 3 +- std/crypto/sha2.zig | 6 +- std/crypto/sha3.zig | 5 +- std/crypto/x25519.zig | 41 +- std/debug/index.zig | 499 ++++++++++---------- std/dynamic_library.zig | 4 +- std/elf.zig | 115 ++--- std/event/fs.zig | 31 +- std/event/io.zig | 14 +- std/event/loop.zig | 27 +- std/fmt/index.zig | 80 +++- std/hash/siphash.zig | 14 +- std/hash_map.zig | 14 + std/heap.zig | 8 +- std/index.zig | 3 +- std/io.zig | 141 ++++-- std/io/seekable_stream.zig | 32 ++ std/json.zig | 27 +- std/json_test.zig | 638 ++++++++++++------------- std/linked_list.zig | 96 ++++ std/math/index.zig | 70 +++ std/mem.zig | 425 +++++++++++------ std/meta/index.zig | 48 ++ std/net.zig | 12 +- std/os/child_process.zig | 17 +- std/os/file.zig | 70 ++- std/os/freebsd/errno.zig | 121 +++++ std/os/freebsd/index.zig | 801 +++++++++++++++++++++++++++++++ std/os/freebsd/syscall.zig | 493 +++++++++++++++++++ std/os/freebsd/x86_64.zig | 136 ++++++ std/os/get_app_data_dir.zig | 2 +- std/os/get_user_id.zig | 2 +- std/os/index.zig | 95 ++-- std/os/linux/index.zig | 103 ++-- std/os/path.zig | 14 +- std/os/windows/kernel32.zig | 6 +- std/os/zen.zig | 22 +- std/pdb.zig | 7 +- std/rand/index.zig | 201 ++++++-- std/rand/ziggurat.zig | 2 +- std/segmented_list.zig | 5 + std/special/bootstrap.zig | 18 +- std/special/build_runner.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/index.zig | 153 +++--- std/unicode.zig | 32 +- test/behavior.zig | 4 + test/cases/asm.zig | 24 + test/cases/bswap.zig | 32 ++ test/cases/cast.zig | 18 + test/cases/inttoptr.zig | 13 + test/cases/ptrcast.zig | 36 ++ test/cases/struct_contains_slice_of_itself.zig | 42 ++ test/cases/truncate.zig | 8 + test/compile_errors.zig | 140 ++++-- test/runtime_safety.zig | 10 + 124 files changed, 6574 insertions(+), 1880 deletions(-)