aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/json_utils.adb
AgeCommit message (Collapse)AuthorFilesLines
2025-07-03ada: Fix minor fallout of latest changeEric Botcazou1-1/+1
This adjusts the header of the renamed files and adds missing blank lines. gcc/ada/ChangeLog: * errid.ads: Adjust header to renaming and fix copyright line. * errid.adb: Adjust header to renaming and add blank line. * erroutc-pretty_emitter.ads: Adjust header to renaming. * erroutc-pretty_emitter.adb: Likewise. * erroutc-sarif_emitter.ads: Likewise. * erroutc-sarif_emitter.adb: Likewise. * errsw.ads: Adjust header to renaming and add blank line. * errsw.adb: Likewise. * json_utils.ads: Likewise. * json_utils.adb: Adjust header to renaming.
2025-06-06ada: Refactor the implementation of gnat diagnosticsViljar Indus1-0/+254
The goal of this patch is to remove the implementation from the Diagnostic objects and port the new features over to the Error_Msg_Objects. gcc/ada/ChangeLog: * debug.adb: Mark -gnatd_D as unused. * diagnostics-repository.adb: Move to... * errid.adb: ...here. * diagnostics-repository.ads: Move to... * errid.ads: ...here. * errout.adb (Error_Msg_Internal): Add new arguments for the new attributes of Error_Msg_Objects. (Error_Msg): Likewise. (Error_Msg_N): Likewise. (Labeled_Span): New method for creating Labeled_Span-s (Primary_Label_Span): New method for creating primary Labeled_Spans. (Secondary_Labeled_Span): New method for creating secondary Labeled_Spans. (Edit): New method for creating Edit elements. (Fix): New method for creating Fix elements. (Error_Msg_F): Simplify code for evaluating the span. (Error_Msg_FE): Likewise. (Error_Msg_NE): Likewise. (Error_Msg_NEL): Likewise. (Error_Msg_N_Gigi): New method that is used as a wrapper for the Error_Msg_xxx methods that have the new arguments. This function is later mapped to the Error_Msg method used inside gigi. (Error_Msg_NE_Gigi): Likewise. (Write_JSON_Span): Ensure that the Style prefix is included that is removed when parsing the message is reinserted to the JSON report. (Output_Messages): Use the new Pretty_Printer and Sarif_Printer packages to print the messages and remove the old implementation for the pretty printer. (Set_Msg_Text): Remove message kind insertion characters from the final message text to avoid some message kinds being duplicated. (To_Full_Span_First): New method for creating a span for a node. (To_Full_Span): Likewise. * errout.ads: Add the specs for all of the newly added functions. * diagnostics-pretty_emitter.adb: Move to... * erroutc-pretty_emitter.adb: ...here. * diagnostics-pretty_emitter.ads: Move to... * erroutc-pretty_emitter.ads: ...here. * diagnostics-sarif_emitter.adb: Move to... * erroutc-sarif_emitter.adb: ...here. * diagnostics-sarif_emitter.ads: Move to... * erroutc-sarif_emitter.ads: ...here. * erroutc.adb (Next_Error_Msg): New method for iterating to the next error message. (Next_Continuation_Msg): New method for iterating to the next continuation message. (Primary_Location): New method for returning the first primary location for the error message. (Get_Human_Id): New method for returning the human readable name for the switch associated with this error message. (Get_Doc_Switch): New method for creating the tag for the switch used in the error message. (Output_Text_Within): Change the method to operating on Strings instead of String pointers. (Output_Msg_Text): Simplify implementation for generating the error message. (Prescan_Message): Make the String handling more error proof. * erroutc.ads (Error_Msg_Object): Add new attributes that were added to Diagnostic objects to Error_Msg_Objects. Add new methods for handling the new error objects. * diagnostics-switch_repository.adb: Move to... * errsw.adb: ...here. * errutil.adb (Error_Msg): Initialize all of the new attributes added to Error_Msg_Object-s. * fe.h (Error_Msg_N): Update the binding. (Error_Msg_NE): Update the binding. For now the error_msg methods in gigi will use the old simplified interface for those methods. * diagnostics-json_utils.adb: Move to... * json_utils.adb: ...here. * diagnostics-json_utils.ads: Move to... * json_utils.ads: ...here. * par-endh.adb: Replace the old error_msg calls with the updated interface. * sem_aggr.adb: Likewise. * sem_ch13.adb: Likewise. * sem_ch4.adb: Likewise. * sem_ch9.adb: Likewise. * diagnostics-brief_emitter.adb: Removed. * diagnostics-brief_emitter.ads: Removed. * diagnostics-constructors.adb: Removed. * diagnostics-constructors.ads: Removed. * diagnostics-converter.adb: Removed. * diagnostics-converter.ads: Removed. * diagnostics-switch_repository.ads: Removed. * diagnostics-utils.adb: Removed. * diagnostics-utils.ads: Removed. * diagnostics.adb: Removed. * diagnostics.ads: Removed. * errsw.ads: New file. Based on diagnostics-switch_repository.ads. It additionally contains all the switch enumerations. * gcc-interface/Make-lang.in: Update compilation dependencies. * gcc-interface/Makefile.in: Likewise.