Compiler module

set_optimization

procedureSource

Sets the options that go with an optimization level: bounds and cast checks, the LLVM optimization settings, inlining and so on. preserve_debug_info keeps or drops debug information.

set_optimization :: (
    build_options: *C.Build_Options,
    type: C.Optimization_Type,
    preserve_debug_info := true
)

Parameters

build_options: *C.Build_Options
preserve_debug_info := true
Example↗
options: Build_Options;
set_optimization(*options, .OPTIMIZED);
assert(options.array_bounds_check == .OFF);
set_optimization(*options, .DEBUG);
assert(options.array_bounds_check == .ON);

See also