Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver: don't catch fatal errors; let caller handle them #802

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/aro/Driver.zig
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,7 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_
error.StreamTooLong => return d.fatal("builtin macro source exceeded max size", .{}),
else => |e| return e,
};
d.processSource(tc, d.inputs.items[0], builtin, user_macros, fast_exit, asm_gen_fn) catch |e| switch (e) {
error.FatalError => {
d.renderErrors();
d.exitWithCleanup(1);
},
else => |er| return er,
};
try d.processSource(tc, d.inputs.items[0], builtin, user_macros, fast_exit, asm_gen_fn);
unreachable;
}

Expand All @@ -738,12 +732,7 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_
error.StreamTooLong => return d.fatal("builtin macro source exceeded max size", .{}),
else => |e| return e,
};
d.processSource(tc, source, builtin, user_macros, fast_exit, asm_gen_fn) catch |e| switch (e) {
error.FatalError => {
d.renderErrors();
},
else => |er| return er,
};
try d.processSource(tc, source, builtin, user_macros, fast_exit, asm_gen_fn);
}
if (d.comp.diagnostics.errors != 0) {
if (fast_exit) d.exitWithCleanup(1);
Expand Down
Loading