Zig rewrite start #1

Merged
davidgmbb merged 100 commits from zig into main 2025-04-05 11:22:15 +02:00
3 changed files with 11 additions and 4 deletions
Showing only changes of commit 570d507839 - Show all commits

View File

@ -627,6 +627,7 @@ pub const OptimizationPipelineOptions = packed struct(u64) {
optimization_level: OptimizationLevel,
debug_info: bool,
};
pub fn default(create: Create) OptimizationPipelineOptions {
const pref_speed = create.optimization_level.prefers_speed();
return .{

View File

@ -85,9 +85,8 @@ os_reserve = fn (base: u64, size: u64, protection: OS_ProtectionFlags, map: OS_M
{
unreachable;
}
else
{
}
return address;
}
Arena = struct

View File

@ -5771,7 +5771,14 @@ pub noinline fn convert(arena: *Arena, options: ConvertOptions) void {
var error_message: llvm.String = undefined;
const target_machine = llvm.Target.Machine.create(.{
.target_options = llvm.Target.Options.default(),
.target_options = blk: {
var target_options = llvm.Target.Options.default();
target_options.flags0.trap_unreachable = switch (options.build_mode) {
.debug_none, .debug_fast, .debug_size => true,
else => false,
};
break :blk target_options;
},
.cpu_triple = llvm.String.from_slice(llvm.global.host_triple),
.cpu_model = llvm.String.from_slice(llvm.global.host_cpu_model),
.cpu_features = llvm.String.from_slice(llvm.global.host_cpu_features),