| ... | @@ -651,10 +651,20 @@ pub fn putAstErrorsIntoBundle( | ... | @@ -651,10 +651,20 @@ pub fn putAstErrorsIntoBundle( |
| 651 | path: []const u8, | 651 | path: []const u8, |
| 652 | wip_errors: *std.zig.ErrorBundle.Wip, | 652 | wip_errors: *std.zig.ErrorBundle.Wip, |
| 653 | ) Allocator.Error!void { | 653 | ) Allocator.Error!void { |
| 654 | var zir = try AstGen.generate(gpa, tree); | 654 | switch (tree.mode) { |
| 655 | defer zir.deinit(gpa); | 655 | .zig => { |
| | 656 | var zir = try AstGen.generate(gpa, tree); |
| | 657 | defer zir.deinit(gpa); |
| 656 | | 658 | |
| 657 | try wip_errors.addZirErrorMessages(zir, tree, tree.source, path); | 659 | try wip_errors.addZirErrorMessages(zir, tree, tree.source, path); |
| | 660 | }, |
| | 661 | .zon => { |
| | 662 | var zoir = try ZonGen.generate(gpa, tree, .{}); |
| | 663 | defer zoir.deinit(gpa); |
| | 664 | |
| | 665 | try wip_errors.addZoirErrorMessages(zoir, tree, tree.source, path); |
| | 666 | }, |
| | 667 | } |
| 658 | } | 668 | } |
| 659 | | 669 | |
| 660 | pub fn resolveTargetQueryOrFatal(io: Io, target_query: std.Target.Query) std.Target { | 670 | pub fn resolveTargetQueryOrFatal(io: Io, target_query: std.Target.Query) std.Target { |