From d33744e42a08e71e9e3425dd9b08903e64c0f964 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Mon, 27 Jul 2009 13:47:11 +0000 Subject: [PATCH] gnatfind.adb, [...]: Minor reformatting and code clean up. 2009-07-27 Robert Dewar * gnatfind.adb, osint.ads, sem.adb, xr_tabls.adb: Minor reformatting and code clean up. From-SVN: r150117 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gnatfind.adb | 14 ++++++++------ gcc/ada/osint.ads | 4 ++-- gcc/ada/sem.adb | 15 ++++++++------- gcc/ada/xr_tabls.adb | 8 ++++---- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d886bdf5c24..bd34c32f360 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-07-27 Robert Dewar + + * gnatfind.adb, osint.ads, sem.adb, xr_tabls.adb: Minor reformatting + and code clean up. + 2009-07-27 Ed Schonberg * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not attempt expansion in diff --git a/gcc/ada/gnatfind.adb b/gcc/ada/gnatfind.adb index 45bc5ee2005..8af7b9e4f8b 100644 --- a/gcc/ada/gnatfind.adb +++ b/gcc/ada/gnatfind.adb @@ -157,14 +157,13 @@ procedure Gnatfind is -- Only switch starting with -- recognized is --RTS - when '-' => - + when '-' => if GNAT.Command_Line.Full_Switch = "-RTS" then + -- Check that it is the first time we see this switch if RTS_Specified = null then RTS_Specified := new String'(GNAT.Command_Line.Parameter); - elsif RTS_Specified.all /= GNAT.Command_Line.Parameter then Osint.Fail ("--RTS cannot be specified multiple times"); end if; @@ -204,18 +203,21 @@ procedure Gnatfind is "adalib directory"); end if; end; + + -- Process -ext switch + elsif GNAT.Command_Line.Full_Switch = "-ext" then + -- Check that it is the first time we see this switch if EXT_Specified = null then EXT_Specified := new String'(GNAT.Command_Line.Parameter); - elsif EXT_Specified.all /= GNAT.Command_Line.Parameter then Osint.Fail ("--ext cannot be specified multiple times"); end if; - if EXT_Specified'Length - = Osint.ALI_Default_Suffix'Length + if + EXT_Specified'Length = Osint.ALI_Default_Suffix'Length then Osint.ALI_Suffix := EXT_Specified.all'Access; else diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads index 5ddda479efb..a44d4e24b3c 100644 --- a/gcc/ada/osint.ads +++ b/gcc/ada/osint.ads @@ -572,8 +572,8 @@ package Osint is -- Get length of argument ALI_Default_Suffix : constant String_Ptr := new String'("ali"); - ALI_Suffix : String_Ptr := ALI_Default_Suffix; - -- The suffix used for the library files (also known as ALI files) + ALI_Suffix : String_Ptr := ALI_Default_Suffix; + -- The suffixes used for the library files (also known as ALI files) private diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index 7411edeaa7f..b8ad571487e 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -1873,13 +1873,12 @@ package body Sem is Main_CU : constant Node_Id := Cunit (Main_Unit); begin - - -- If the main unit is an instantiation, the body appears - -- before the instance spec, which is added later to the - -- unit list. Do the spec if present, body will follow. + -- If the main unit is an instantiation, the body appears before + -- the instance spec, which is added later to the unit list. Do + -- the spec if present, body will follow. if Nkind (Original_Node (Unit (Main_CU))) - in N_Generic_Instantiation + in N_Generic_Instantiation and then Present (Library_Unit (Main_CU)) then Do_Unit_And_Dependents @@ -1965,9 +1964,11 @@ package body Sem is end loop; -- See if it belongs to current unit, and if so, include its - -- with_clauses. + -- with_clauses. Do not process main unit prematurely. - if Pnode = CU then + if Pnode = CU + and then (CU /= Cunit (Main_Unit)) + then Walk_Immediate (Cunit (S), Include_Limited); end if; end; diff --git a/gcc/ada/xr_tabls.adb b/gcc/ada/xr_tabls.adb index 30a4ecc55a4..95bdfa985d8 100644 --- a/gcc/ada/xr_tabls.adb +++ b/gcc/ada/xr_tabls.adb @@ -824,14 +824,14 @@ package body Xr_Tabls is end if; if File.Dir = null then - if Ada.Strings.Fixed.Tail (File.File.all, 3) - = Osint.ALI_Suffix.all + if Ada.Strings.Fixed.Tail (File.File.all, 3) = + Osint.ALI_Suffix.all then Tmp := Locate_Regular_File - (Internal_Strip (File.File.all), Directories.Obj_Dir); + (Internal_Strip (File.File.all), Directories.Obj_Dir); else Tmp := Locate_Regular_File - (File.File.all, Directories.Src_Dir); + (File.File.all, Directories.Src_Dir); end if; if Tmp = null then -- 2.30.2