wcc: name-bind the size type in type position (#85 fold-2)
Resolve `size` -> TY_SIZE at the type-name resolver (C lookup_builtin / ww tinfofornode's N_TNAME chain), mirroring uintptr, both stages. This makes `size` writable as a type (`let x: size`, struct field, etc.), the prerequisite for lib/types SIZE_MAX. Twins every NAME-keyed uintptr arm in the wwstage so it behaves like the cstage's kind-keyed Type switches (already TY_SIZE-aware from fold-1): primtypesize + astalign (8B/8-align), primsize + letscalarprim (8B scalar slot), isinttypeast + isnumerictname (int/numeric). rule-10 symmetric; dead on the size-free selfhost corpus so 990-997 stay byte-id. Coexists with the size(T) size-of operator (separate c.top SK_FN seed + N_CALL fold, NOT a type path) and `.size` field access (N_DOT); neither touched. No c.top SK_TYPE "size" seed (would collide with the operator seed at check.ww:96). Regenerates w6c/wwdump combined.ww (checker embedded). New probe 957_size_type_run exercises type-position `size` and the operator in one scope.
This commit is contained in:
5
Makefile
5
Makefile
@@ -333,6 +333,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_f64xmm_run \
|
||||
$(BIN)/test_tuprecv_f64_run \
|
||||
$(BIN)/test_floats_run \
|
||||
$(BIN)/test_size_type_run \
|
||||
$(BIN)/test_bufio_run $(BIN)/test_random_run
|
||||
|
||||
$(BIN)/test_smoke: test/wcc/000_smoke.c $(LIB)/libwcc.a | $(BIN)
|
||||
@@ -1074,6 +1075,10 @@ $(BIN)/test_floats_run: test/wcc/952_floats_run.c $(BIN)/ww $(BIN)/w6c \
|
||||
$(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_size_type_run: test/wcc/957_size_type_run.c $(BIN)/ww $(BIN)/w6c \
|
||||
$(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_f64crossmod_run: test/wcc/953_f64crossmod_run.c $(BIN)/ww \
|
||||
$(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
|
||||
Reference in New Issue
Block a user