Ada: Refine semantic analysis of expression functions
This commit streamlines semantic analysis of expression functions in Ada, eliminating some redundant checks and messages.
This commit introduces small refinements to the semantic analysis of expression functions in Ada. The changes primarily focus on streamlining the implementation within Analyze_Subprogram_Body_Helper by introducing a local boolean constant From_Expression_Function and using it consistently. The update also eliminates redundant name conflict checks and consistency verifications for overriding indicators in specific cases, aiming to reduce noise and improve the efficiency of the compilation process.
In Details
The changes are concentrated in sem_ch6.adb and sem_util.adb. The new local constant From_Expression_Function in Analyze_Subprogram_Body_Helper simplifies the logic for handling expression functions. Additionally, redundant checks for name conflicts and overriding indicators have been removed when dealing with stand-alone expression functions. The wording in Is_Expression_Function_Or_Completion's description was also corrected.
For Context
Expression functions in Ada offer a shorthand for defining simple functions with a single expression. This commit improves the internal workings of the Ada compiler when analyzing these expression functions. It streamlines the analysis process and removes unnecessary checks, improving compiler efficiency without altering the behavior of the compiled code.