Cleans up visibility checks in `Is_Visible_Component`
This commit refactors the `Is_Visible_Component` function in the Ada front end for improved clarity and maintainability, without altering its functional behavi…
The GCC Ada front end received a cleanup to its Is_Visible_Component function. This change streamlines the logic by folding the Is_Local_Type predicate directly into the main function and focusing type entity reasoning. Developers will experience no functional changes, but the underlying code for visibility checks is now more organized.
In Details
The sem_ch3.adb file handles semantic analysis for Ada, specifically for chapter 3 of the Ada Reference Manual, which covers declarations and types. Is_Visible_Component is a function within this part of the compiler that determines the visibility of components during name resolution. This commit focuses on simplifying the internal logic of this specific function, particularly around how it handles type entities and a specific ACATS test case.
For Context
Compilers translate human-readable source code into machine-executable instructions. The GCC Ada front end is the part of the GCC compiler that understands Ada code. Before generating machine code, the compiler performs 'semantic analysis' to ensure the code is logically consistent and follows language rules. One aspect of this is determining 'visibility': which parts of your code can see and use other parts (like variables or functions). This commit refines the internal logic of a function (Is_Visible_Component) that performs these visibility checks, making the compiler's own code cleaner and easier to maintain, but not changing how your Ada programs behave.