gensupport: Centralizes machine-generator output management
Refactors common output handling for GCC's machine-description generators into a centralized library.
This commit introduces a centralized output management system in gensupport for GCC’s machine description generators (genemit, genrecog, genattrtab). It consolidates logic for file naming, opening, selection, and closing, improving consistency and reducing code duplication. The changes enable better handling of partitioned outputs and fixed outputs like headers, ensuring a unified lifecycle management across generators and addressing issues found in previous PRs.
In Details
The gensupport library now centralizes the management of output files for machine description generators like genemit and genrecog. A new generator_output structure and associated functions (add_generator_output, open_generator_outputs, close_generator_outputs) manage output lifecycles, including delayed file opening and size-based partition selection. This replaces duplicated logic in individual generators. Fixed outputs (headers) are also handled by this new structure. This change is part of efforts to improve build system modularity and performance, following patterns establi…
- genemit
- A GCC machine description generator responsible for producing C code that emits (generates) machine instructions.
- genrecog
- A GCC machine description generator responsible for producing C code that recognizes machine instructions.
- gensupport
- A collection of utility functions and structures within GCC used by various machine description generators.
- partitioned outputs
- Output generated by GCC tools that is split into multiple files or compilation units, typically to parallelize the build process or manage object file sizes.
- machine description (MD)
- A set of files that describe the instruction set architecture (ISA) of a target processor to GCC, including instruction formats, operands, and attributes.