stage2: implement caching for ZIR code

Notably this exposed an issue with the language having to do with the
secret safety tag on untagged unions. How can we have our cake and eat
it too? Not solved in this commit. I will file a language proposal to
tackle this issue soon.

Fixes a compile error in `std.fs.File.readvAll`.
This commit is contained in:
Andrew Kelley
2021-04-25 00:02:58 -07:00
parent ff2ec0dc5a
commit 015cd79f89
6 changed files with 587 additions and 22 deletions

View File

@@ -3606,7 +3606,7 @@ pub fn cmdAstgen(
if (file.zir.hasCompileErrors()) {
var errors = std.ArrayList(Compilation.AllErrors.Message).init(arena);
try Compilation.AllErrors.addZir(arena, &errors, &file, source);
try Compilation.AllErrors.addZir(arena, &errors, &file);
const ttyconf = std.debug.detectTTYConfig();
for (errors.items) |full_err_msg| {
full_err_msg.renderToStdErr(ttyconf);