From 17eb24a7e4b2bc5740dc15996acc4736833cb2a0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 23 Oct 2019 18:43:24 -0400 Subject: move types from builtin to std * All the data types from `@import("builtin")` are moved to `@import("std").builtin`. The target-related types are moved to `std.Target`. This allows the data types to have methods, such as `std.Target.current.isDarwin()`. * `std.os.windows.subsystem` is moved to `std.Target.current.subsystem`. * Remove the concept of the panic package from the compiler implementation. Instead, `std.builtin.panic` is always the panic function. It checks for `@hasDecl(@import("root"), "panic")`, or else provides a default implementation. This is an important step for multibuilds (#3028). Without this change, the types inside the builtin namespace look like different types, when trying to merge builds with different target settings. With this change, Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one compilation and `std.builtin.Os` from another compilation are the same type, even if the target OS value differs. --- src-self-hosted/target.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src-self-hosted') diff --git a/src-self-hosted/target.zig b/src-self-hosted/target.zig index 15f09e8da9..c62e5af9dd 100644 --- a/src-self-hosted/target.zig +++ b/src-self-hosted/target.zig @@ -3,6 +3,8 @@ const builtin = @import("builtin"); const llvm = @import("llvm.zig"); const CInt = @import("c_int.zig").CInt; +// TODO delete this file and use std.Target + pub const FloatAbi = enum { Hard, Soft, -- cgit v1.2.3