Ada: Cleanup in expression function freezing implementation
Refactors Ada expression function freezing implementation to align with semantic model, fixing aspect expression resolution glitches.
This commit further cleans up the implementation of freezing for Ada expression functions, bringing it closer to the semantic model. It eliminates obsolete code exposed by previous refactoring and corrects how aspect expressions are resolved, ensuring both component prefixes and subcomponent prefixes are handled correctly. Selector names in expanded names are also now resolved as direct names, fixing a previous inaccuracy.
In Details
The sem_ch3.adb and sem_ch13.adb files in the GCC Ada front-end are modified to refine the handling of expression functions and aspect expressions. This change rectifies an issue where prefixes of components and subcomponents within aspect expressions were not consistently resolved. Specifically, Analyze_Declarations was updated to remove dead code, and Resolve_Aspect_Expressions.Resolve_Name now correctly distinguishes between selector names and direct names.
- expression functions
- Functions in Ada that can be used in an expression context, often allowing for more concise code.
- freezing
- In Ada, a mechanism that makes a type or object immutable, preventing further modifications after a certain point.
- aspect expressions
- Expressions in Ada that specify or query aspects of a type or object, such as its properties or behavior.