Retain enumeration literal names in GNATprove mode
This commit prevents the Ada compiler from discarding enumeration literal names when in GNATprove mode to support the `Image` attribute.
This commit modifies the Ada compiler’s behavior in GNATprove mode to preserve the names of enumeration literals. This is necessary because GNATprove now supports the Image attribute for enumerated types, which requires access to these names for proper reasoning. This change ensures that GNATprove can correctly analyze and verify Ada code that uses enumeration literals with the Image attribute.
In Details
The change in gnat1drv.adb prevents Global_Discard_Names from being set when in GNATprove_Mode. GNATprove's increased capabilities now include supporting the Image attribute of enumerated types, necessitating the retention of enumeration literal names. This is a targeted adjustment to the compiler's behavior when used with the GNATprove formal verification tool.
For Context
This commit affects the interaction between the Ada compiler and the GNATprove formal verification tool. Formal verification uses mathematical techniques to prove that software behaves correctly. Enumerated types are a way of defining a variable that can only take on a specific set of named values. The Image attribute allows you to get the name of a specific enumerated value as a string. This change ensures that GNATprove has the information it needs to reason about Ada code that uses enumerated types and their names.