Rewrite Analyze_Aspect_Specifications for clarity.
This commit refactors the Analyze_Aspect_Specifications function in the Ada compiler, improving code clarity and removing unnecessary gotos.
The Analyze_Aspect_Specifications function in the Ada compiler’s semantic analysis phase received a major rewrite to improve code clarity and maintainability. The changes include splitting out procedures, removing gratuitous gotos, and ensuring more uniform handling of aspects. Additionally, some aspects are now set to Never_Delay to avoid unnecessary delays, and a potential issue with skipped calls to Set_Aspect_On_Partial_View has been resolved.
In Details
The commit focuses on Sem_Ch13.Analyze_Aspect_Specifications, responsible for processing aspect specifications in Ada. The rewrite aims to simplify the logic and improve consistency in how aspects are handled. Key changes include using N_Entity_Id for entity parameters, consolidating Delay_Required computation, and adjusting aspect delay settings. Boolean_Aspects now includes Library_Unit_Aspects to streamline code.
For Context
Aspect specifications in Ada provide additional information or constraints on program entities, such as variables or subprograms. The semantic analysis phase of the Ada compiler processes these specifications to ensure they are valid and consistent with the program's code. This commit improves the clarity and maintainability of the code that handles aspect specifications, making the compiler easier to understand and debug. It touches the handling of 'delay' which affects when certain checks are applied during compilation.