diff options
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/llvm.zig | 6 | ||||
| -rw-r--r-- | src/codegen/llvm/bindings.zig | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 3f9a774ae9..e9559a5117 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1053,7 +1053,11 @@ pub const Object = struct { .is_small = options.is_small, .time_report = options.time_report, .tsan = options.sanitize_thread, - .lto = options.lto != .none, + .lto = switch (options.lto) { + .none => .None, + .thin => .ThinPreLink, + .full => .FullPreLink, + }, // https://github.com/ziglang/zig/issues/21215 .allow_fast_isel = !comp.root_mod.resolved_target.result.cpu.arch.isMIPS(), .asm_filename = null, diff --git a/src/codegen/llvm/bindings.zig b/src/codegen/llvm/bindings.zig index a146e2a883..3c0782397e 100644 --- a/src/codegen/llvm/bindings.zig +++ b/src/codegen/llvm/bindings.zig @@ -90,7 +90,7 @@ pub const TargetMachine = opaque { time_report: bool, tsan: bool, sancov: bool, - lto: bool, + lto: LtoPhase, allow_fast_isel: bool, asm_filename: ?[*:0]const u8, bin_filename: ?[*:0]const u8, @@ -98,6 +98,14 @@ pub const TargetMachine = opaque { bitcode_filename: ?[*:0]const u8, coverage: Coverage, + pub const LtoPhase = enum(c_int) { + None, + ThinPreLink, + ThinPostLink, + FullPreLink, + FullPostLink, + }; + pub const Coverage = extern struct { CoverageType: Coverage.Type, IndirectCalls: bool, |
