Commit 50ff4b8d
50ff4b8d153aMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 1 file · ~1 modified
Description
Force-enable all runtime features for large multi-file programs
When required_file_count > 5, enable all needs_* flags to ensure all type definitions (sp_String, sp_StrArray, sp_RbArray, etc.) are emitted in the generated C code.
C errors: 419 → 388 on lrama.
Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]
Details
- Commit
- 50ff4b8d153a
- Parent
- 645783f13089
src/codegen.cmodifiedView file
@@ -2059,6 +2059,18 @@
20592059
for (int i = 0; i < ctx->class_count; i++)20602060
ctx->classes[i].class_tag = 0x0040 + i; /* NaN-box class tag base */20612061
2062+
/* For large multi-file programs, enable all runtime features */2063+
if (ctx->required_file_count > 5) {2064+
ctx->needs_hash = true;2065+
ctx->needs_rb_array = true;2066+
ctx->needs_rb_hash = true;2067+
ctx->needs_poly = true;2068+
ctx->needs_sp_string = true;2069+
ctx->needs_str_split = true;2070+
ctx->needs_gc = true;2071+
ctx->needs_proc = true;2072+
}2073+
20622074
/* Detect needs from class ivars and method params/returns */20632075
for (int ci = 0; ci < ctx->class_count; ci++) {20642076
class_info_t *cls = &ctx->classes[ci];