Arm: minipool refactoring creates a new minipool class
Introduces a `minipool` class to manage Arm literal pool data, cleaning up file-scope variables.
This commit refactors the Arm minipool code by introducing a minipool class to encapsulate data related to a pool under construction. This change eliminates several file-scope variables, which are now members of the new class, and converts associated functions into member functions. This is the first step in addressing issues with alignment and insertion logic in the minipool code.
In Details
This commit introduces a minipool class in config/arm/arm.cc to manage the state of a literal pool being constructed, replacing several file-scope variables. Functions like move_minipool_fix_forward_ref, add_minipool_forward_ref, and others are converted to member functions of this new class. This refactoring is a precursor to addressing alignment-related issues in the minipool, as it provides a cleaner structure for managing pool data.
- minipool
- A data structure in the GCC ARM backend used to efficiently store and manage small constants, particularly jump table entries, that are placed near the code they reference.
- file-scope variable
- A variable declared outside of any function or class, making it accessible throughout the entire source file. These can sometimes lead to difficulties in managing state and can be replaced by class members for better encapsulation.
- alignment
- The requirement that data be stored at memory addresses that are multiples of a specific power of two, which can improve performance or be necessary for certain data types or instructions.