stage2: rename Isel to Emit for x86_64

Clean up generated errors in Emit.
This commit is contained in:
Jakub Konka 2022-01-15 18:36:13 +01:00
parent 4d4bbd7624
commit 6315bcb32a
3 changed files with 424 additions and 427 deletions

View File

@ -578,7 +578,7 @@ set(ZIG_STAGE2_SOURCES
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Emit.zig"
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Mir.zig"
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/CodeGen.zig"
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/Isel.zig"
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/Emit.zig"
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/Mir.zig"
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/bits.zig"
"${CMAKE_SOURCE_DIR}/src/clang.zig"

View File

@ -17,7 +17,7 @@ const DW = std.dwarf;
const ErrorMsg = Module.ErrorMsg;
const FnResult = @import("../../codegen.zig").FnResult;
const GenerateSymbolError = @import("../../codegen.zig").GenerateSymbolError;
const Isel = @import("Isel.zig");
const Emit = @import("Emit.zig");
const Liveness = @import("../../Liveness.zig");
const Mir = @import("Mir.zig");
const Module = @import("../../Module.zig");
@ -309,7 +309,7 @@ pub fn generate(
};
defer mir.deinit(bin_file.allocator);
var isel = Isel{
var emit = Emit{
.mir = mir,
.bin_file = bin_file,
.debug_output = debug_output,
@ -320,9 +320,9 @@ pub fn generate(
.prev_di_line = module_fn.lbrace_line,
.prev_di_column = module_fn.lbrace_column,
};
defer isel.deinit();
isel.lowerMir() catch |err| switch (err) {
error.IselFail => return FnResult{ .fail = isel.err_msg.? },
defer emit.deinit();
emit.lowerMir() catch |err| switch (err) {
error.EmitFail => return FnResult{ .fail = emit.err_msg.? },
else => |e| return e,
};

File diff suppressed because it is too large Load Diff