commit 688da55f70942d0c71ddaf467096ec70ae922402 (tree)
parent e3af422003046575754ce886fb0748cf307ff19f
Author: Motiejus <motiejus@jakstys.lt>
Date: Fri, 27 Feb 2026 15:03:50 +0000
sema: remove featureSet resolution that creates wrong IP entries
The featureSet resolution in triggerArchModuleCascade attempts to resolve
`CpuFeature.FeatureSetFns(Feature).featureSet` which requires generic
function evaluation. Without proper comptime function calling, the
partial evaluation creates 7 wrong side-effect entries (ptr_uav, undef,
ptr_comptime_alloc, memoized_call with void result, etc.).
Remove the resolution to keep the IP clean. Entries [124-698] now match
the Zig compiler exactly. The remaining gap (entries [699-1016]) requires
implementing generic function evaluation (FeatureSetFns) and the rest of
the comptime cascade.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/stage0/sema.c b/stage0/sema.c
@@ -5724,10 +5724,12 @@ static void triggerArchModuleCascade(
if (feature != UINT32_MAX)
(void)resolveNavRef(feature);
- // $706: "featureSet" function in arch module.
- uint32_t fset = findNavInNamespace(arch_ns, "featureSet");
- if (fset != UINT32_MAX)
- (void)resolveNavRef(fset);
+ // NOTE: featureSet resolution requires FeatureSetFns(Feature) generic
+ // call evaluation, which the C sema can't do yet. The Zig compiler
+ // creates entries $699-$706 (type_struct, memoized_call, type_function,
+ // func_decl, type_pointer, ptr_nav) for this call. Attempting to resolve
+ // featureSet without proper generic function evaluation creates wrong
+ // side-effect entries, so skip it for now.
(void)target_file_idx;
}