Ada Sets Etype Before Analysis for Conditions Generated for 'Old Attribute.
This change sets the Etype decoration for conditions generated for the 'Old attribute in Ada, which is required for GNATprove analysis.
The Ada compiler now sets the Etype decoration before analysis for conditions generated for the 'Old attribute. The absence of the Etype decoration was problematic for GNATprove, a formal verification tool for Ada, as it couldn’t properly analyze the output without it. New utilities were added in sem_util.adb to fill decoration in expressions, and the Etype is now set for generated Boolean connectors in Determining_Condition and Conditional_Evaluation_Condition.
In Details
The Ada compiler uses decoration to store type information about expressions. This commit focuses on the 'Old attribute and its interaction with GNATprove. The semantic analysis phase (sem_util.adb) is modified to ensure that the Etype decoration is set for conditions generated for 'Old before analysis. This is crucial for GNATprove, which relies on complete type information.
For Context
In Ada, the 'Old attribute refers to the value of a variable before a subprogram is executed. The compiler generates conditions to check properties related to this 'Old value. This commit ensures that these generated conditions have complete type information, which is required by formal verification tools like GNATprove. This improvement enables more effective static analysis of Ada code, potentially catching errors before runtime.