Commit d33744e4 by Robert Dewar Committed by Arnaud Charlet

gnatfind.adb, [...]: Minor reformatting and code clean up.

2009-07-27  Robert Dewar  <dewar@adacore.com>

	* gnatfind.adb, osint.ads, sem.adb, xr_tabls.adb: Minor reformatting
	and code clean up.

From-SVN: r150117
parent df7c3f62
2009-07-27 Robert Dewar <dewar@adacore.com>
* gnatfind.adb, osint.ads, sem.adb, xr_tabls.adb: Minor reformatting
and code clean up.
2009-07-27 Ed Schonberg <schonberg@adacore.com> 2009-07-27 Ed Schonberg <schonberg@adacore.com>
* exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not attempt expansion in * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not attempt expansion in
......
...@@ -157,14 +157,13 @@ procedure Gnatfind is ...@@ -157,14 +157,13 @@ procedure Gnatfind is
-- Only switch starting with -- recognized is --RTS -- Only switch starting with -- recognized is --RTS
when '-' => when '-' =>
if GNAT.Command_Line.Full_Switch = "-RTS" then if GNAT.Command_Line.Full_Switch = "-RTS" then
-- Check that it is the first time we see this switch -- Check that it is the first time we see this switch
if RTS_Specified = null then if RTS_Specified = null then
RTS_Specified := new String'(GNAT.Command_Line.Parameter); RTS_Specified := new String'(GNAT.Command_Line.Parameter);
elsif RTS_Specified.all /= GNAT.Command_Line.Parameter then elsif RTS_Specified.all /= GNAT.Command_Line.Parameter then
Osint.Fail ("--RTS cannot be specified multiple times"); Osint.Fail ("--RTS cannot be specified multiple times");
end if; end if;
...@@ -204,18 +203,21 @@ procedure Gnatfind is ...@@ -204,18 +203,21 @@ procedure Gnatfind is
"adalib directory"); "adalib directory");
end if; end if;
end; end;
-- Process -ext switch
elsif GNAT.Command_Line.Full_Switch = "-ext" then elsif GNAT.Command_Line.Full_Switch = "-ext" then
-- Check that it is the first time we see this switch -- Check that it is the first time we see this switch
if EXT_Specified = null then if EXT_Specified = null then
EXT_Specified := new String'(GNAT.Command_Line.Parameter); EXT_Specified := new String'(GNAT.Command_Line.Parameter);
elsif EXT_Specified.all /= GNAT.Command_Line.Parameter then elsif EXT_Specified.all /= GNAT.Command_Line.Parameter then
Osint.Fail ("--ext cannot be specified multiple times"); Osint.Fail ("--ext cannot be specified multiple times");
end if; end if;
if EXT_Specified'Length if
= Osint.ALI_Default_Suffix'Length EXT_Specified'Length = Osint.ALI_Default_Suffix'Length
then then
Osint.ALI_Suffix := EXT_Specified.all'Access; Osint.ALI_Suffix := EXT_Specified.all'Access;
else else
......
...@@ -572,8 +572,8 @@ package Osint is ...@@ -572,8 +572,8 @@ package Osint is
-- Get length of argument -- Get length of argument
ALI_Default_Suffix : constant String_Ptr := new String'("ali"); ALI_Default_Suffix : constant String_Ptr := new String'("ali");
ALI_Suffix : String_Ptr := ALI_Default_Suffix; ALI_Suffix : String_Ptr := ALI_Default_Suffix;
-- The suffix used for the library files (also known as ALI files) -- The suffixes used for the library files (also known as ALI files)
private private
......
...@@ -1873,13 +1873,12 @@ package body Sem is ...@@ -1873,13 +1873,12 @@ package body Sem is
Main_CU : constant Node_Id := Cunit (Main_Unit); Main_CU : constant Node_Id := Cunit (Main_Unit);
begin begin
-- If the main unit is an instantiation, the body appears before
-- If the main unit is an instantiation, the body appears -- the instance spec, which is added later to the unit list. Do
-- before the instance spec, which is added later to the -- the spec if present, body will follow.
-- unit list. Do the spec if present, body will follow.
if Nkind (Original_Node (Unit (Main_CU))) if Nkind (Original_Node (Unit (Main_CU)))
in N_Generic_Instantiation in N_Generic_Instantiation
and then Present (Library_Unit (Main_CU)) and then Present (Library_Unit (Main_CU))
then then
Do_Unit_And_Dependents Do_Unit_And_Dependents
...@@ -1965,9 +1964,11 @@ package body Sem is ...@@ -1965,9 +1964,11 @@ package body Sem is
end loop; end loop;
-- See if it belongs to current unit, and if so, include its -- 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); Walk_Immediate (Cunit (S), Include_Limited);
end if; end if;
end; end;
......
...@@ -824,14 +824,14 @@ package body Xr_Tabls is ...@@ -824,14 +824,14 @@ package body Xr_Tabls is
end if; end if;
if File.Dir = null then if File.Dir = null then
if Ada.Strings.Fixed.Tail (File.File.all, 3) if Ada.Strings.Fixed.Tail (File.File.all, 3) =
= Osint.ALI_Suffix.all Osint.ALI_Suffix.all
then then
Tmp := Locate_Regular_File Tmp := Locate_Regular_File
(Internal_Strip (File.File.all), Directories.Obj_Dir); (Internal_Strip (File.File.all), Directories.Obj_Dir);
else else
Tmp := Locate_Regular_File Tmp := Locate_Regular_File
(File.File.all, Directories.Src_Dir); (File.File.all, Directories.Src_Dir);
end if; end if;
if Tmp = null then if Tmp = null then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment