Trap on unreachable
in debug mode
This commit is contained in:
parent
832baa7137
commit
570d507839
@ -627,6 +627,7 @@ pub const OptimizationPipelineOptions = packed struct(u64) {
|
|||||||
optimization_level: OptimizationLevel,
|
optimization_level: OptimizationLevel,
|
||||||
debug_info: bool,
|
debug_info: bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn default(create: Create) OptimizationPipelineOptions {
|
pub fn default(create: Create) OptimizationPipelineOptions {
|
||||||
const pref_speed = create.optimization_level.prefers_speed();
|
const pref_speed = create.optimization_level.prefers_speed();
|
||||||
return .{
|
return .{
|
||||||
|
@ -85,9 +85,8 @@ os_reserve = fn (base: u64, size: u64, protection: OS_ProtectionFlags, map: OS_M
|
|||||||
{
|
{
|
||||||
unreachable;
|
unreachable;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return address;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Arena = struct
|
Arena = struct
|
||||||
|
@ -5771,7 +5771,14 @@ pub noinline fn convert(arena: *Arena, options: ConvertOptions) void {
|
|||||||
|
|
||||||
var error_message: llvm.String = undefined;
|
var error_message: llvm.String = undefined;
|
||||||
const target_machine = llvm.Target.Machine.create(.{
|
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_triple = llvm.String.from_slice(llvm.global.host_triple),
|
||||||
.cpu_model = llvm.String.from_slice(llvm.global.host_cpu_model),
|
.cpu_model = llvm.String.from_slice(llvm.global.host_cpu_model),
|
||||||
.cpu_features = llvm.String.from_slice(llvm.global.host_cpu_features),
|
.cpu_features = llvm.String.from_slice(llvm.global.host_cpu_features),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user