mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
Part of effort to move to runtime CPU feature detection. The `cpu_version` and `cpu_versions` macros had become unweildly, and we'd reached the edge of what it's possible to do with declarative macros, even using all the tt-muncher tricks. Some improvements were impractical to make. Convert both macros to proc macros in a new `oxc_lexer_macros` crate. The proc macros are half as many lines of code, easier to understand, and more capable. This also allows getting rid of the weird `apply` wrapper: ```rust // Before #[apply(cpu_version(Avx2))] // After #[cpu_version(Avx2)] ``` Rename `cpu_versions` to `cpu_multiversion`, which describes it better.