gccrs: Separate crate related mappings within hir map
Extracts crate-related mappings into a dedicated class within gccrs's HIR map.
The gccrs compiler’s High-Level Intermediate Representation (HIR) map is being made more manageable by extracting crate-related mappings into a dedicated class. This change reorganizes internal data structures to improve clarity and maintainability within the Rust frontend. Numerous backend and checking components now utilize this more organized structure.
In Details
This commit reorganizes gccrs's rust-hir-map.cc/.h by extracting crate-related mappings into a specialized class. This addresses the growing size and complexity of the main HIR map, improving code organization and maintainability within the Rust frontend. The change impacts various AST lowering and checking passes that interact with crate information.
- HIR
- High-Level Intermediate Representation. A representation of the code between the AST and the lower-level intermediate representations used by the compiler backend. In gccrs, it captures semantic information.
- crate
- The compilation unit in Rust. A crate is a collection of Rust source files that compiles either into a library or a binary executable.
- gccrs
- The Rust frontend for the GCC compiler, aiming to provide a robust and compliant Rust compilation experience within the GCC ecosystem.