Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn addFuzzStep(b: *Build, target: std.Build.ResolvedTarget, afl_clang_lto_path:
.use_llvm = true,
.use_lld = true,
});
fuzz_lib.want_lto = true;
fuzz_lib.lto = .full;
fuzz_lib.bundle_compiler_rt = true;
fuzz_lib.pie = true;

Expand Down Expand Up @@ -266,18 +266,18 @@ pub fn build(b: *Build) !void {
else
&[_][]const u8{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined" };

exe.addIncludePath(b.path(tracy_path));
exe.addCSourceFile(.{ .file = b.path(client_cpp), .flags = tracy_c_flags });
exe.linkLibCpp();
exe.linkLibC();
exe.root_module.addIncludePath(b.path(tracy_path));
exe.root_module.addCSourceFile(.{ .file = b.path(client_cpp), .flags = tracy_c_flags });
exe.root_module.link_libcpp = true;
exe.root_module.link_libc = true;

if (target.result.os.tag == .windows) {
exe.linkSystemLibrary("dbghelp");
exe.linkSystemLibrary("ws2_32");
exe.root_module.linkSystemLibrary("dbghelp", .{});
exe.root_module.linkSystemLibrary("ws2_32", .{});
}
}
if (link_libc) {
exe.linkLibC();
exe.root_module.link_libc = true;
}

if (no_bin) {
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.fingerprint = 0x76501fb842f52025, // Changing this has security and trust implications.

.minimum_zig_version = "0.16.0-dev.1456+16fc083f2",
.minimum_zig_version = "0.16.0-dev.1634+b27bdd5af",

.dependencies = .{},

Expand Down
3 changes: 2 additions & 1 deletion src/aro/Builtins/eval.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const assert = std.debug.assert;

const backend = @import("backend");
const Interner = backend.Interner;

const Builtins = @import("../Builtins.zig");
const Parser = @import("../Parser.zig");
const Tree = @import("../Tree.zig");
Expand All @@ -12,7 +13,7 @@ const Type = TypeStore.Type;
const Value = @import("../Value.zig");

fn makeNan(comptime T: type, str: []const u8) T {
const UnsignedSameSize = std.meta.Int(.unsigned, @bitSizeOf(T));
const UnsignedSameSize = @Int(.unsigned, @bitSizeOf(T));
const parsed = std.fmt.parseUnsigned(UnsignedSameSize, str[0 .. str.len - 1], 0) catch 0;
const bits: switch (T) {
f32 => u23,
Expand Down
6 changes: 3 additions & 3 deletions src/aro/Value.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const BigIntSpace = Interner.Tag.Int.BigIntSpace;

const annex_g = @import("annex_g.zig");
const Compilation = @import("Compilation.zig");
const Target = @import("Target.zig");
const QualType = @import("TypeStore.zig").QualType;
const Target = @import("Target.zig");

const Value = @This();

Expand Down Expand Up @@ -1048,9 +1048,9 @@ fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, qt: QualType, comp
const mag_bits: usize = @intCast(qt.bitSizeof(comp));
switch (mag_bits) {
inline 8, 16, 32, 64 => |bits| {
if (limit == .min) return Value.int(@as(i64, std.math.minInt(std.meta.Int(.signed, bits))), comp);
if (limit == .min) return Value.int(@as(i64, std.math.minInt(@Int(.signed, bits))), comp);
return switch (signedness) {
inline else => |sign| Value.int(std.math.maxInt(std.meta.Int(sign, bits)), comp),
inline else => |sign| Value.int(std.math.maxInt(@Int(sign, bits)), comp),
};
},
else => {},
Expand Down
9 changes: 4 additions & 5 deletions src/assembly_backend/x86_64.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ const assert = std.debug.assert;
const aro = @import("aro");
const Assembly = aro.Assembly;
const Compilation = aro.Compilation;
const Node = Tree.Node;
const Source = aro.Source;
const Tree = aro.Tree;
const QualType = aro.QualType;
const Value = aro.Value;

const AsmCodeGen = @This();
const Error = aro.Compilation.Error;
const Node = Tree.Node;

const AsmCodeGen = @This();
tree: *const Tree,
comp: *Compilation,
text: *std.Io.Writer,
Expand Down Expand Up @@ -58,7 +57,7 @@ fn serializeFloat(comptime T: type, value: T, w: *std.Io.Writer) !void {
},
else => {
const size = @bitSizeOf(T);
const storage_unit = std.meta.intToEnum(StorageUnit, size) catch unreachable;
const storage_unit = std.enums.fromInt(StorageUnit, size) orelse unreachable;
const IntTy = @Int(.unsigned, size);
const int_val: IntTy = @bitCast(value);
return serializeInt(int_val, storage_unit, w);
Expand Down Expand Up @@ -95,7 +94,7 @@ fn emitSingleValue(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void {
if (!scalar_kind.isReal()) {
return c.todo("Codegen _Complex values", node.tok(c.tree));
} else if (scalar_kind.isInt()) {
const storage_unit = std.meta.intToEnum(StorageUnit, bit_size) catch return c.todo("Codegen _BitInt values", node.tok(c.tree));
const storage_unit = std.enums.fromInt(StorageUnit, bit_size) orelse return c.todo("Codegen _BitInt values", node.tok(c.tree));
try c.data.print(" .{s} ", .{@tagName(storage_unit)});
_ = try value.print(qt, c.comp, c.data);
try c.data.writeByte('\n');
Expand Down
4 changes: 2 additions & 2 deletions src/backend/Interner.zig
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ pub const Key = union(enum) {
.float => |repr| switch (repr) {
inline else => |data| std.hash.autoHash(
&hasher,
@as(std.meta.Int(.unsigned, @bitSizeOf(@TypeOf(data))), @bitCast(data)),
@as(@Int(.unsigned, @bitSizeOf(@TypeOf(data))), @bitCast(data)),
),
},
.complex => |repr| switch (repr) {
inline else => |data| std.hash.autoHash(
&hasher,
@as(std.meta.Int(.unsigned, @bitSizeOf(@TypeOf(data))), @bitCast(data)),
@as(@Int(.unsigned, @bitSizeOf(@TypeOf(data))), @bitCast(data)),
),
},
.int => |repr| {
Expand Down
7 changes: 4 additions & 3 deletions src/main.zig
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const std = @import("std");
const build_options = @import("build_options");
const Allocator = mem.Allocator;
const mem = std.mem;
const process = std.process;
const Allocator = mem.Allocator;
const build_options = @import("build_options");

const aro = @import("aro");
const Compilation = aro.Compilation;
const Diagnostics = aro.Diagnostics;
Expand All @@ -21,7 +22,7 @@ var debug_allocator: std.heap.DebugAllocator(.{

pub fn main() u8 {
const gpa = if (@import("builtin").link_libc)
std.heap.raw_c_allocator
std.heap.c_allocator
else
debug_allocator.allocator();
defer if (!@import("builtin").link_libc) {
Expand Down