diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 028da0f7333..e1beacc2a34 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2009-04-24 Robert Dewar + + * mlib-prj.adb, prj-env.adb, prj-nmsc.adb, prj-proc.adb, make.adb, + clean.adb: Minor reformatting. + Minor code reorganization and message improvement. + 2009-04-24 Emmanuel Briot * prj-proc.adb, prj.adb, prj.ads, prj-nmsc.adb, prj-nmsc.ads diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb index 756fa990272..ce77b60577e 100644 --- a/gcc/ada/clean.adb +++ b/gcc/ada/clean.adb @@ -1078,13 +1078,14 @@ package body Clean is if All_Projects then declare - Imported : Project_List := Data.Imported_Projects; + Imported : Project_List; Process : Boolean; begin -- For each imported project, call Clean_Project if the project -- has not been processed already. + Imported := Data.Imported_Projects; while Imported /= null loop Process := True; @@ -1249,8 +1250,8 @@ package body Clean is (Dir : String; Source : File_Name_Type) is - Source_Name : constant String := Get_Name_String (Source); - Current : constant String := Get_Current_Dir; + Source_Name : constant String := Get_Name_String (Source); + Current : constant String := Get_Current_Dir; Last : constant Positive := B_Start'Length + Source_Name'Length; File_Name : String (1 .. Last + 4); @@ -1415,8 +1416,8 @@ package body Clean is end; end if; - -- If neither a project file nor an executable were specified, - -- output the usage and exit. + -- If neither a project file nor an executable were specified, output + -- the usage and exit. if Main_Project = No_Project and then Osint.Number_Of_Files = 0 then Usage; @@ -1443,8 +1444,8 @@ package body Clean is Clean_Executables; end if; - -- In verbose mode, if Delete has not been called, indicate that - -- no file needs to be deleted. + -- In verbose mode, if Delete has not been called, indicate that no file + -- needs to be deleted. if Verbose_Mode and (not File_Deleted) then New_Line; @@ -1889,8 +1890,7 @@ package body Clean is Src : constant String := Get_Name_String (Source); begin - -- If the source name has an extension, then replace it with - -- the tree suffix. + -- If source name has an extension, then replace it with the tree suffix for Index in reverse Src'First + 1 .. Src'Last loop if Src (Index) = '.' then diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index c3db62f4c43..bc40cbab067 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -7136,8 +7136,7 @@ package body Make is Init_Q; end if; - -- And of course, we only insert in the Q if the source is not - -- marked. + -- And of course, only insert in the Q if the source is not marked if Sfile /= No_File and then not Is_Marked (Sfile, Index) then if Verbose_Mode then @@ -7253,8 +7252,8 @@ package body Make is Full_Lib_File : File_Name_Type) return Boolean is begin - -- There is something to check only when using project files. - -- Otherwise, this function returns True (last line of the function). + -- There is something to check only when using project files. Otherwise, + -- this function returns True (last line of the function). if Main_Project /= No_Project then declare @@ -7280,9 +7279,9 @@ package body Make is Path => Path_Name); Current_Verbosity := Saved_Verbosity; - -- If this source is in a project, check that the ALI file is - -- in its object directory. If it is not, return False, so that - -- the ALI file will not be skipped. + -- If this source is in a project, check that the ALI file is in + -- its object directory. If it is not, return False, so that the + -- ALI file will not be skipped. if Project /= No_Project then Data := Project_Tree.Projects.Table (Project); @@ -7548,10 +7547,9 @@ package body Make is Data.Depth := Depth; - List := Data.Imported_Projects; - -- Visit each imported project + List := Data.Imported_Projects; while List /= null loop Proj := List.Project; List := List.Next; diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb index 042cd65b5c4..a1309d716ae 100644 --- a/gcc/ada/mlib-prj.adb +++ b/gcc/ada/mlib-prj.adb @@ -679,7 +679,7 @@ package body MLib.Prj is procedure Process_Project (Project : Project_Id) is Data : Project_Data := In_Tree.Projects.Table (Project); - Imported : Project_List := Data.Imported_Projects; + Imported : Project_List; begin -- Nothing to do if process has already been processed @@ -691,6 +691,7 @@ package body MLib.Prj is -- We first process the imported projects to guarantee that -- we have a proper reverse order for the libraries. + Imported := Data.Imported_Projects; while Imported /= null loop if Imported.Project /= No_Project then Process_Project (Imported.Project); @@ -776,7 +777,6 @@ package body MLib.Prj is end if; end if; end if; - end if; end Process_Project; diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 5c0a11b180f..778db9d89b2 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -549,7 +549,6 @@ package body Prj.Env is declare Current : Project_List := Data.Imported_Projects; - begin while Current /= null loop Check (Current.Project); diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 56e9a0cdb47..9c1914371d7 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -907,7 +907,6 @@ package body Prj.Nmsc is or else Source.Language = Language; Alt_Lang := Source.Alternate_Languages; - while Alt_Lang /= null loop exit Source_Loop when Alt_Lang.Language = Language; Alt_Lang := Alt_Lang.Next; @@ -5890,7 +5889,7 @@ package body Prj.Nmsc is File_Name_Type (Object_Dir.Value); Error_Msg (Project, In_Tree, - "the object directory { cannot be found", + "object directory { not found", Data.Location); end if; @@ -5968,7 +5967,7 @@ package body Prj.Nmsc is Err_Vars.Error_Msg_File_1 := File_Name_Type (Exec_Dir.Value); Error_Msg (Project, In_Tree, - "the exec directory { cannot be found", + "exec directory { not found", Data.Location); end if; end if; @@ -8607,7 +8606,7 @@ package body Prj.Nmsc is Error_Msg (Project, In_Tree, "?source of spec of unit %% (%%)" & - " cannot be found in this project", + " not found in this project", Location); end if; @@ -8619,7 +8618,7 @@ package body Prj.Nmsc is Error_Msg (Project, In_Tree, "?source of body of unit %% (%%)" & - " cannot be found in this project", + " not found in this project", Location); end if; end if; diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 7cbcf02ab97..a10d7fe7235 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -63,6 +63,10 @@ package body Prj.Proc is -- Concatenate two strings and returns another string if both -- arguments are not null string. + -- In the following procedures, we are expected to guess the meaning of + -- the parameters from their names, this is never a good idea, comments + -- should be added precisely defining every formal ??? + procedure Add_Attributes (Project : Project_Id; Project_Name : Name_Id; @@ -71,8 +75,8 @@ package body Prj.Proc is Decl : in out Declarations; First : Attribute_Node_Id; Project_Level : Boolean); - -- Add all attributes, starting with First, with their default - -- values to the package or project with declarations Decl. + -- Add all attributes, starting with First, with their default values to + -- the package or project with declarations Decl. procedure Check (In_Tree : Project_Tree_Ref; @@ -134,12 +138,12 @@ package body Prj.Proc is From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Extended_By : Project_Id); - -- Process project with node From_Project_Node in the tree. - -- Do nothing if From_Project_Node is Empty_Node. - -- If project has already been processed, simply return its project id. - -- Otherwise create a new project id, mark it as processed, call itself - -- recursively for all imported projects and a extended project, if any. - -- Then process the declarative items of the project. + -- Process project with node From_Project_Node in the tree. Do nothing if + -- From_Project_Node is Empty_Node. If project has already been processed, + -- simply return its project id. Otherwise create a new project id, mark it + -- as processed, call itself recursively for all imported projects and a + -- extended project, if any. Then process the declarative items of the + -- project. type Recursive_Check_Data is record In_Tree : Project_Tree_Ref; @@ -151,8 +155,8 @@ package body Prj.Proc is -- Current_Dir is for optimization purposes, avoiding extra system calls. procedure Recursive_Check - (Project : Project_Id; - Data : in out Recursive_Check_Data); + (Project : Project_Id; + Data : in out Recursive_Check_Data); -- Check_Naming_Scheme for the project --------- @@ -1608,12 +1612,12 @@ package body Prj.Proc is if Orig_Array = No_Array then if Error_Report = null then Error_Msg - ("associative array value cannot be found", + ("associative array value not found", Location_Of (Current_Item, From_Project_Node_Tree)); else Error_Report - ("associative array value cannot be found", + ("associative array value not found", Project, In_Tree); end if; @@ -2469,8 +2473,8 @@ package body Prj.Proc is --------------------- procedure Recursive_Check - (Project : Project_Id; - Data : in out Recursive_Check_Data) + (Project : Project_Id; + Data : in out Recursive_Check_Data) is begin if Verbose_Mode then