From 0a2f6632810ceb6a17bffbafd846c5f3aaa24e64 Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Tue, 17 Mar 2026 19:37:50 +0000 Subject: [PATCH] llvm: solve a misc TODO The compiler has had the desired semantics for comptime evaluation of these checks for quite a while now. --- src/codegen/llvm.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index efd58ab947117afcd760adfc57d39d50cd4da3c6..ab57302d7d4cc6d46b51b7e9ecfcc51c2cf66926 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -10833,9 +10833,8 @@ pub const FuncGen = struct { comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Rw.read) == 0); comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Rw.write) == 1); - // TODO these two asserts should be able to be comptime because the type is a u2 - assert(prefetch.locality >= 0); - assert(prefetch.locality <= 3); + comptime assert(prefetch.locality >= 0); + comptime assert(prefetch.locality <= 3); comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Cache.instruction) == 0); comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Cache.data) == 1); -- 2.54.0