diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-01-05 11:08:34 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-05 17:41:14 -0700 |
| commit | 7b8cede61fc20c137aca4e02425536bfc9a5a400 (patch) | |
| tree | 9533e4e3afb63e23ab5a42ecddb18b9998ec1237 /test/stage2 | |
| parent | 9360e5887ce0bf0ce204eb49f0d0b253348ef557 (diff) | |
| download | zig-7b8cede61fc20c137aca4e02425536bfc9a5a400.tar.gz zig-7b8cede61fc20c137aca4e02425536bfc9a5a400.zip | |
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.
Diffstat (limited to 'test/stage2')
| -rw-r--r-- | test/stage2/cbe.zig | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/test/stage2/cbe.zig b/test/stage2/cbe.zig index a740a8851a..9947c90f13 100644 --- a/test/stage2/cbe.zig +++ b/test/stage2/cbe.zig @@ -22,8 +22,6 @@ pub fn addCases(ctx: *TestContext) !void { , "hello world!" ++ std.cstr.line_sep); // Now change the message only - // TODO fix C backend not supporting updates - // https://github.com/ziglang/zig/issues/7589 case.addCompareOutput( \\extern fn puts(s: [*:0]const u8) c_int; \\export fn main() c_int { |
