gccrs: Regroup proc macro related mappings
Organizes proc macro mappings into a dedicated subclass within gccrs's HIR map.
The gccrs compiler’s High-Level Intermediate Representation (HIR) map has been refactored to improve organization by regrouping all proc macro-related operations into a specialized subclass. This change consolidates functionality, making the HIR map more manageable and easier to navigate for developers working on the Rust frontend. Affected components include macro expansion, name resolution, and session management.
In Details
Refactors rust-hir-map.cc/.h in gccrs by extracting proc macro-specific mappings (e.g., for derive, bang, and attribute macros) into a new ProcMacroMappings subclass. This aims to reduce the size and complexity of the main Mappings class, improving the organization and maintainability of the Rust frontend's internal data structures by separating concerns related to macro processing.
- 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.
- proc macro
- A Rust macro that runs at compile time and generates code. These include declarative macros (like
macro_rules!), procedural macros, and derive macros. - gccrs
- The Rust frontend for the GCC compiler, aiming to provide a robust and compliant Rust compilation experience within the GCC ecosystem.