crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.2k stars 1.61k forks source link

Compiler codegen: small refactor with progress fix #14760

Open ysbaddaden opened 4 days ago

ysbaddaden commented 4 days ago

A small refactor that extracts a few methods from #codegen_many_units:

Also fixes the behavior of stats vs progress: we only need to collect reused modules for compilation stats (not for progress). Sequential compilation now correctly increments progress in sequential mode (progress was stuck at 0 when threads=1 which is always true on Windows). Extracted as #14763.

TODO:

Extracted from #14748.

ysbaddaden commented 4 days ago

AArch64 CI is failing with "fork not implemented" :raised_eyebrow:

EDIT: the issue is the legacy crystal compiler in the images (1.0.0 by default :scream:) that doesn't support the has_method? macro outside of methods, so we can't generate different method implementations :face_exhaling:

straight-shoota commented 4 days ago

Actually, I prefer the version with a single def and different bodies, instead of different defs.