Refactor Error Handling in Ada Compiler
Refactors error handling code in the Ada compiler by extracting common functionality to erroutc and adding new subprograms for message deletion.
This commit refactors error handling in the Ada compiler by extracting common code from errout and errutil packages into a new erroutc package. It introduces Delete_Error_And_Continuation_Msgs and Set_Prev_Pointers to consolidate duplicate functionality. This change aims to improve code maintainability and reduce redundancy in error message management within the Ada front-end.
In Details
errout and errutil in GNAT handle error and warning message management. This commit extracts common functionality into erroutc.adb, including Delete_Error_And_Continuation_Msgs and Set_Prev_Pointers. The refactoring simplifies errout.adb and errutil.adb. A toolchain developer unfamiliar with the Ada front-end might overlook the significance of this internal restructuring.
For Context
This commit focuses on improving the internal structure of the Ada compiler's error handling mechanisms. It streamlines the code responsible for managing error and warning messages, making it more organized and easier to maintain. This involves moving shared code into a common location and creating new functions to handle message deletion, contributing to a more robust and efficient compilation process.