mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
stage2: rename Isel to Emit for x86_64
Clean up generated errors in Emit.
This commit is contained in:
parent
4d4bbd7624
commit
6315bcb32a
3 changed files with 424 additions and 427 deletions
|
|
@ -578,7 +578,7 @@ set(ZIG_STAGE2_SOURCES
|
||||||
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Emit.zig"
|
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Emit.zig"
|
||||||
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Mir.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/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/Mir.zig"
|
||||||
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/bits.zig"
|
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/bits.zig"
|
||||||
"${CMAKE_SOURCE_DIR}/src/clang.zig"
|
"${CMAKE_SOURCE_DIR}/src/clang.zig"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ const DW = std.dwarf;
|
||||||
const ErrorMsg = Module.ErrorMsg;
|
const ErrorMsg = Module.ErrorMsg;
|
||||||
const FnResult = @import("../../codegen.zig").FnResult;
|
const FnResult = @import("../../codegen.zig").FnResult;
|
||||||
const GenerateSymbolError = @import("../../codegen.zig").GenerateSymbolError;
|
const GenerateSymbolError = @import("../../codegen.zig").GenerateSymbolError;
|
||||||
const Isel = @import("Isel.zig");
|
const Emit = @import("Emit.zig");
|
||||||
const Liveness = @import("../../Liveness.zig");
|
const Liveness = @import("../../Liveness.zig");
|
||||||
const Mir = @import("Mir.zig");
|
const Mir = @import("Mir.zig");
|
||||||
const Module = @import("../../Module.zig");
|
const Module = @import("../../Module.zig");
|
||||||
|
|
@ -309,7 +309,7 @@ pub fn generate(
|
||||||
};
|
};
|
||||||
defer mir.deinit(bin_file.allocator);
|
defer mir.deinit(bin_file.allocator);
|
||||||
|
|
||||||
var isel = Isel{
|
var emit = Emit{
|
||||||
.mir = mir,
|
.mir = mir,
|
||||||
.bin_file = bin_file,
|
.bin_file = bin_file,
|
||||||
.debug_output = debug_output,
|
.debug_output = debug_output,
|
||||||
|
|
@ -320,9 +320,9 @@ pub fn generate(
|
||||||
.prev_di_line = module_fn.lbrace_line,
|
.prev_di_line = module_fn.lbrace_line,
|
||||||
.prev_di_column = module_fn.lbrace_column,
|
.prev_di_column = module_fn.lbrace_column,
|
||||||
};
|
};
|
||||||
defer isel.deinit();
|
defer emit.deinit();
|
||||||
isel.lowerMir() catch |err| switch (err) {
|
emit.lowerMir() catch |err| switch (err) {
|
||||||
error.IselFail => return FnResult{ .fail = isel.err_msg.? },
|
error.EmitFail => return FnResult{ .fail = emit.err_msg.? },
|
||||||
else => |e| return e,
|
else => |e| return e,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue