Call back-end even in case of errors.
The Ada compiler now calls the back-end even with front-end errors in GNATprove mode for SARIF reporting.
This change modifies the Ada compiler’s behavior in GNATprove mode to ensure the back-end is always invoked, even if compilation errors occur in the front-end. This is crucial for environments that rely on SARIF report generation, as it allows the back-end to produce error messages necessary for these reports. Previously, front-end errors would halt the compilation process prematurely, preventing comprehensive SARIF output.
In Details
When operating in GNATprove mode, the Ada front-end (gnat1drv.adb) previously exited immediately upon encountering compilation errors. This prevented the back-end from being invoked, which is necessary for emitting subsequent error messages that are often integrated into SARIF (Static Analysis Results Interchange Format) reports. The change ensures that Gnat1drv proceeds to call the back-end even after front-end errors, allowing the generation of a complete SARIF report that includes diagnostic information from both the front-end and back-end.
For Context
When you compile Ada code, the process usually goes through two main stages: the 'front-end' (which understands your Ada code and turns it into a generic representation) and the 'back-end' (which takes that generic representation and turns it into machine code). This change affects the compiler when it's running in 'GNATprove mode,' which is a special setting used for advanced code analysis to ensure correctness and safety. Previously, if the front-end found any basic errors in your Ada code, it would stop immediately. However, for specialized tools that generate 'SARIF reports' (a standard format for sharing static analysis results), it's important for the back-end to also run, even with errors, because it might have additional error messages to contribute to the report. This update ensures the back-end always gets a chance to run in GNATprove mode, allowing for more complete and useful SARIF reports.