From b1d3d48f687a3a73be1d9ab85035cbdc58e2bb1b Mon Sep 17 00:00:00 2001 From: mlugg Date: Mon, 15 Jul 2024 16:18:41 +0100 Subject: Type,Value: mark `ResolveStrat` parameter of type queries as `comptime` This eliminates the statically-reachable recursion loop between code generation backends and Sema. This is beneficial for optimizers (although I do not measure any performance improvement for this change), and for profilers. --- src/Zcu/PerThread.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Zcu/PerThread.zig') diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index c3f569cc7d..b2e9ca8040 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -3145,7 +3145,7 @@ pub fn unionFieldNormalAlignmentAdvanced( pt: Zcu.PerThread, loaded_union: InternPool.LoadedUnionType, field_index: u32, - strat: Type.ResolveStrat, + comptime strat: Type.ResolveStrat, ) Zcu.SemaError!InternPool.Alignment { const ip = &pt.zcu.intern_pool; assert(loaded_union.flagsUnordered(ip).layout != .@"packed"); @@ -3173,7 +3173,7 @@ pub fn structFieldAlignmentAdvanced( explicit_alignment: InternPool.Alignment, field_ty: Type, layout: std.builtin.Type.ContainerLayout, - strat: Type.ResolveStrat, + comptime strat: Type.ResolveStrat, ) Zcu.SemaError!InternPool.Alignment { assert(layout != .@"packed"); if (explicit_alignment != .none) return explicit_alignment; -- cgit v1.2.3