aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-12-03 17:33:20 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-12-03 17:33:20 -0700
commit4c1a62326b5090fad67c004a6e58a6e4265a77ad (patch)
tree922d865e78b10012f773c292795b9d7479894bdd /src/codegen
parent9ede943e0753b250cb9a60a5b9b66ba9bff4a694 (diff)
downloadzig-4c1a62326b5090fad67c004a6e58a6e4265a77ad.tar.gz
zig-4c1a62326b5090fad67c004a6e58a6e4265a77ad.zip
stage2: use Target.Abi instead of introducing Target.TargetAbi
This branch introduced std.Target.TargetAbi when we already had std.Target.Abi which was, unsurprisingly, already suited for this task. Also pull out the -mabi= cc flag addition to the common area instead of duplicating it for assembly and c files.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 886be120b0..58239fdaea 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -15,6 +15,7 @@ const TypedValue = @import("../TypedValue.zig");
const Zir = @import("../Zir.zig");
const Air = @import("../Air.zig");
const Liveness = @import("../Liveness.zig");
+const target_util = @import("../target.zig");
const Value = @import("../value.zig").Value;
const Type = @import("../type.zig").Type;
@@ -244,8 +245,6 @@ pub const Object = struct {
// TODO handle float ABI better- it should depend on the ABI portion of std.Target
const float_abi: llvm.ABIType = .Default;
- const abi_name: ?[*:0]const u8 = if (options.target_abi) |t| @tagName(t) else null;
-
const target_machine = llvm.TargetMachine.create(
target,
llvm_target_triple.ptr,
@@ -256,7 +255,7 @@ pub const Object = struct {
code_model,
options.function_sections,
float_abi,
- abi_name,
+ if (target_util.llvmMachineAbi(options.target)) |s| s.ptr else null,
);
errdefer target_machine.dispose();