0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib
Andrew Kelley 7b8cede61f stage2: rework the C backend
* std.ArrayList gains `moveToUnmanaged` and dead code
   `ArrayListUnmanaged.appendWrite` is deleted.
 * emit_h state is attached to Module rather than Compilation.
 * remove the implementation of emit-h because it did not properly
   integrate with incremental compilation. I will re-implement it
   in a follow-up commit.
 * Compilation: use the .codegen_failure tag rather than
   .dependency_failure tag for when `bin_file.updateDecl` fails.

C backend:
 * Use a CValue tagged union instead of strings for C values.
 * Cleanly separate state into Object and DeclGen:
   - Object is present only when generating a .c file
   - DeclGen is present for both generating a .c and .h
 * Move some functions into their respective Object/DeclGen namespace.
 * Forward decls are managed by the incremental compilation frontend; C
   backend no longer renders function signatures based on callsites.
   For simplicity, all functions always get forward decls.
 * Constants are managed by the incremental compilation frontend. C
   backend no longer has a "constants" section.
 * Participate in incremental compilation. Each Decl gets an ArrayList
   for its generated C code and it is updated when the Decl is updated.
   During flush(), all these are joined together in the output file.
 * The new CValue tagged union is used to clean up using of assigning to
   locals without an additional pointer local.
 * Fix bug with bitcast of non-pointers making the memcpy destination
   immutable.
History 2021-01-05 17:41:14 -07:00
..
include update to latest clang C headers 2020-12-04 15:39:16 -07:00
libc Duplicate OSAtomic.h between aarch64 and x86_64 2021-01-02 15:30:14 +01:00
libcxx update install files for LLVM 11rc1 2020-08-04 17:52:26 -07:00
libcxxabi update install files for LLVM 11rc1 2020-08-04 17:52:26 -07:00
libunwind libunwind: fix compile errors and warnings for 32-bit arm 2020-12-24 13:31:41 -07:00
std stage2: rework the C backend 2021-01-05 17:41:14 -07:00
tsan stage2: fix Cache deadlock and build more of TSAN 2020-12-24 01:18:48 -07:00