Consolidate Error Message Deletion in Ada Compiler
Refactors error message deletion code in the Ada compiler by extracting common code into a new subprogram, Delete_Error_Msg.
This commit refactors the Ada compiler’s error handling by extracting common code for deleting error messages into a new subprogram, Delete_Error_Msg. This consolidation reduces code duplication and improves maintainability within the errout package. Multiple locations that previously deleted messages directly now use this shared function.
In Details
The errout package in GNAT handles error reporting. This commit introduces Delete_Error_Msg in erroutc.adb, consolidating code for message deletion. This simplifies several call sites within errout.adb. A toolchain developer outside the Ada front-end might view this as a minor internal refactoring.
For Context
This commit focuses on improving the internal organization of the Ada compiler's error handling code. It identifies common code used to delete error messages and moves it into a single, reusable function. This makes the code easier to understand, modify, and maintain, leading to a more robust compiler.