From 2d5e5d89add24b9f987646c83db4639c77132be2 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet <charlet@adacore.com> Date: Tue, 5 Jan 2021 08:05:12 -0500 Subject: [PATCH] [Ada] Address some ??? comments gcc/ada/ * cstand.adb, sprint.adb, switch-c.adb, xr_tabls.ads, xr_tabls.adb, xref_lib.adb: Address ??? comments. --- gcc/ada/cstand.adb | 8 ++++---- gcc/ada/sprint.adb | 8 ++------ gcc/ada/switch-c.adb | 7 +------ gcc/ada/xr_tabls.adb | 25 +++++++++++++++---------- gcc/ada/xr_tabls.ads | 2 +- gcc/ada/xref_lib.adb | 2 +- 6 files changed, 24 insertions(+), 28 deletions(-) diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index 092e64a71a9b..d15708bdbba7 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -817,7 +817,7 @@ package body CStand is B_Node := New_Node (N_Character_Literal, Stloc); Set_Is_Static_Expression (B_Node); - Set_Chars (B_Node, No_Name); -- ??? + Set_Chars (B_Node, No_Name); Set_Char_Literal_Value (B_Node, Uint_0); Set_Entity (B_Node, Empty); Set_Etype (B_Node, Standard_Wide_Character); @@ -827,7 +827,7 @@ package body CStand is B_Node := New_Node (N_Character_Literal, Stloc); Set_Is_Static_Expression (B_Node); - Set_Chars (B_Node, No_Name); -- ??? + Set_Chars (B_Node, No_Name); Set_Char_Literal_Value (B_Node, UI_From_Int (16#FFFF#)); Set_Entity (B_Node, Empty); Set_Etype (B_Node, Standard_Wide_Character); @@ -866,7 +866,7 @@ package body CStand is B_Node := New_Node (N_Character_Literal, Stloc); Set_Is_Static_Expression (B_Node); - Set_Chars (B_Node, No_Name); -- ??? + Set_Chars (B_Node, No_Name); Set_Char_Literal_Value (B_Node, Uint_0); Set_Entity (B_Node, Empty); Set_Etype (B_Node, Standard_Wide_Wide_Character); @@ -876,7 +876,7 @@ package body CStand is B_Node := New_Node (N_Character_Literal, Stloc); Set_Is_Static_Expression (B_Node); - Set_Chars (B_Node, No_Name); -- ??? + Set_Chars (B_Node, No_Name); Set_Char_Literal_Value (B_Node, UI_From_Int (16#7FFF_FFFF#)); Set_Entity (B_Node, Empty); Set_Etype (B_Node, Standard_Wide_Wide_Character); diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 57132aeba8fc..213b63171060 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -3132,11 +3132,6 @@ package body Sprint is Write_Char (';'); - -- Don't we want to print more detail??? - - -- Doc of this extended syntax belongs in sinfo.ads and/or - -- sprint.ads ??? - when N_SCIL_Dispatch_Table_Tag_Init => Write_Indent_Str ("[N_SCIL_Dispatch_Table_Tag_Init]"); @@ -4578,7 +4573,8 @@ package body Sprint is Write_Str (");"); end; - -- For all other Itypes, print ??? (fill in later) + -- For all other Itypes, print a triple ? (fill in later + -- if needed). when others => Write_Header (True); diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index b97e0d6e5538..1e94aded0851 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -427,7 +427,7 @@ package body Switch.C is -- The reason for this prohibition is that the rewriting of -- Sloc values causes strange malfunctions in the tests of -- whether units belong to the main source. This is really a - -- bug, but too hard to fix for a marginal capability ??? + -- bug, but too hard to fix for a marginal capability. -- The proper fix is to completely redo -gnatD processing so -- that the tree is not messed with, and instead a separate @@ -1613,11 +1613,6 @@ package body Switch.C is Ptr := Ptr + 1; end if; - -- We ignore '/' in switches, this is historical, still needed??? - - when '/' => - Store_Switch := False; - -- Anything else is an error (illegal switch character) when others => diff --git a/gcc/ada/xr_tabls.adb b/gcc/ada/xr_tabls.adb index 6d002011d3f3..a4c52d0ab9b0 100644 --- a/gcc/ada/xr_tabls.adb +++ b/gcc/ada/xr_tabls.adb @@ -106,10 +106,16 @@ package body Xr_Tabls is -- when sorting the table. Longest_File_Name_In_Table : Natural := 0; - Unvisited_Files : Unvisited_Files_Access := null; - Directories : Project_File_Ptr; - Default_Match : Boolean := False; - -- The above need commenting ??? + -- The length of the longest file name stored + + Unvisited_Files : Unvisited_Files_Access := null; + -- Linked list of unvisited files + + Directories : Project_File_Ptr; + -- Store the list of directories to visit + + Default_Match : Boolean := False; + -- Default value for match in declarations function Parse_Gnatls_Src return String; -- Return the standard source directories (taking into account the @@ -482,9 +488,8 @@ package body Xr_Tabls is ------------------- function ALI_File_Name (Ada_File_Name : String) return String is - - -- ??? Should ideally be based on the naming scheme defined in - -- project files. + -- Should ideally be based on the naming scheme defined in + -- project files but this is too late for an obsolescent feature. Index : constant Natural := Ada.Strings.Fixed.Index @@ -762,7 +767,7 @@ package body Xr_Tabls is Strip : Natural := 0) return String is pragma Annotate (CodePeer, Skip_Analysis); - -- ??? To disable false positives currently generated + -- Disable CodePeer false positives Tmp : GNAT.OS_Lib.String_Access; @@ -1385,8 +1390,8 @@ package body Xr_Tabls is begin File_Ref.Visited := False; - -- ??? Do not add a source file to the list. This is true at - -- least for gnatxref, and probably for gnatfind as well + -- Do not add a source file to the list. This is true for gnatxref + -- gnatfind, so good enough. if F'Length > 4 and then F (F'Last - 3 .. F'Last) = "." & Osint.ALI_Suffix.all diff --git a/gcc/ada/xr_tabls.ads b/gcc/ada/xr_tabls.ads index b290afb98f3d..2f4dea0903c9 100644 --- a/gcc/ada/xr_tabls.ads +++ b/gcc/ada/xr_tabls.ads @@ -23,7 +23,7 @@ -- -- ------------------------------------------------------------------------------ --- We need comment here saying what this package is??? +-- Cross reference utilities used by gnatxref and gnatfind with GNAT.OS_Lib; diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb index 1f667cbd5051..9a584a454a73 100644 --- a/gcc/ada/xref_lib.adb +++ b/gcc/ada/xref_lib.adb @@ -786,7 +786,7 @@ package body Xref_Lib is -- line and column in the dependent unit number Eun. For this we need -- to parse the ali file again because the parent entity is not in -- the declaration table if it did not match the search pattern. - -- If the symbol is not found, we return "???". + -- If the symbol is not found, we return (1 .. 3 => '?'). procedure Skip_To_Matching_Closing_Bracket; -- When Ptr points to an opening square bracket, moves it to the -- GitLab