stage2: breaking AST memory layout modifications

InfixOp is flattened out so that each operator is an independent AST
node tag. The two kinds of structs are now Catch and SimpleInfixOp.

Beginning implementation of supporting codegen for const locals.
This commit is contained in:
Andrew Kelley
2020-07-15 19:39:18 -07:00
parent f119092273
commit af12596e8d
6 changed files with 601 additions and 287 deletions

View File

@@ -1954,7 +1954,7 @@ pub fn addZIRInstSpecial(
positionals: std.meta.fieldInfo(T, "positionals").field_type,
kw_args: std.meta.fieldInfo(T, "kw_args").field_type,
) !*T {
const gen_zir = scope.cast(Scope.GenZIR).?;
const gen_zir = scope.getGenZIR();
try gen_zir.instructions.ensureCapacity(self.gpa, gen_zir.instructions.items.len + 1);
const inst = try newZIRInst(gen_zir.arena, src, T, positionals, kw_args);
gen_zir.instructions.appendAssumeCapacity(&inst.base);