aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-08 19:05:05 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-04-08 19:05:05 -0700
commit482b995a4963e045860c7fb1a4e11c48cf4de880 (patch)
treee00079980426580bbefd547e879d890dab842511 /src/codegen.zig
parentb9e508c410cd077d704a73418281f6d7839df241 (diff)
downloadzig-482b995a4963e045860c7fb1a4e11c48cf4de880.tar.gz
zig-482b995a4963e045860c7fb1a4e11c48cf4de880.zip
stage2: blaze the trail for std lib integration
This branch adds "builtin" and "std" to the import table when using the self-hosted backend. "builtin" gains one additional item: ``` pub const zig_is_stage2 = true; // false when using stage1 backend ``` This allows the std lib to do conditional compilation based on detecting which backend is being used. This will be removed from builtin as soon as self-hosted catches up to feature parity with stage1. Keep a sharp eye out - people are going to be tempted to abuse this. The general rule of thumb is do not use `builtin.zig_is_stage2`. However this commit breaks the rule so that we can gain limited start.zig support as we incrementally improve the self-hosted compiler. This commit also implements `fullyQualifiedNameHash` and related functionality, which effectively puts all Decls in their proper namespaces. `fullyQualifiedName` is not yet implemented. Stop printing "todo" log messages for test decls unless we are in test mode. Add "previous definition here" error notes for Decl name collisions. This commit does not bring us yet to a newly passing test case. Here's what I'm working towards: ```zig const std = @import("std"); export fn main() c_int { const a = std.fs.base64_alphabet[0]; return a - 'A'; } ``` Current output: ``` $ ./zig-cache/bin/zig build-exe test.zig test.zig:3:1: error: TODO implement more analyze elemptr zig-cache/lib/zig/std/start.zig:38:46: error: TODO implement structInitExpr ty ``` So the next steps are clear: * Sema: improve elemptr * AstGen: implement structInitExpr
Diffstat (limited to 'src/codegen.zig')
0 files changed, 0 insertions, 0 deletions