Commit fb2e11ee by Arnaud Charlet

[multiple changes]

2009-07-13  Emmanuel Briot  <briot@adacore.com>

	* prj-nmsc.adb: Avoid traversing the list of source files if
	we have already processed all locally removed files.

2009-07-13  Jose Ruiz  <ruiz@adacore.com>

	* gnat_ugn.texi: Fix typo.

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

	* freeze.adb: Minor reformatting
	Minor code reorganization (use Nkind_In)

	* exp_ch6.adb: Minor reformatting

From-SVN: r149546
parent ffa61a5e
2009-07-13 Emmanuel Briot <briot@adacore.com>
* prj-nmsc.adb: Avoid traversing the list of source files if
we have already processed all locally removed files.
2009-07-13 Jose Ruiz <ruiz@adacore.com>
* gnat_ugn.texi: Fix typo.
2009-07-13 Robert Dewar <dewar@adacore.com>
* freeze.adb: Minor reformatting
Minor code reorganization (use Nkind_In)
* exp_ch6.adb: Minor reformatting
2009-07-11 Eric Botcazou <ebotcazou@adacore.com> 2009-07-11 Eric Botcazou <ebotcazou@adacore.com>
* checks.adb (Apply_Address_Clause_Check): Remove Size_Warning_Output * checks.adb (Apply_Address_Clause_Check): Remove Size_Warning_Output
......
...@@ -4669,7 +4669,6 @@ package body Exp_Ch6 is ...@@ -4669,7 +4669,6 @@ package body Exp_Ch6 is
if Ekind (Subp) = E_Function then if Ekind (Subp) = E_Function then
Resolve (N, Etype (Subp)); Resolve (N, Etype (Subp));
end if; end if;
end Expand_Protected_Subprogram_Call; end Expand_Protected_Subprogram_Call;
-------------------------------- --------------------------------
......
...@@ -1133,8 +1133,7 @@ package body Freeze is ...@@ -1133,8 +1133,7 @@ package body Freeze is
Par := Parent (Par); Par := Parent (Par);
end if; end if;
if (Nkind (Par) = N_Object_Declaration if Nkind_In (Par, N_Object_Declaration, N_Assignment_Statement)
or else Nkind (Par) = N_Assignment_Statement)
and then Comes_From_Source (Par) and then Comes_From_Source (Par)
then then
Temp := Temp :=
...@@ -1469,7 +1468,7 @@ package body Freeze is ...@@ -1469,7 +1468,7 @@ package body Freeze is
---------------------------- ----------------------------
function After_Last_Declaration return Boolean is function After_Last_Declaration return Boolean is
Spec : constant Node_Id := Parent (Current_Scope); Spec : constant Node_Id := Parent (Current_Scope);
begin begin
if Nkind (Spec) = N_Package_Specification then if Nkind (Spec) = N_Package_Specification then
if Present (Private_Declarations (Spec)) then if Present (Private_Declarations (Spec)) then
...@@ -1534,9 +1533,7 @@ package body Freeze is ...@@ -1534,9 +1533,7 @@ package body Freeze is
-- either a tagged type, or a limited record. -- either a tagged type, or a limited record.
if Is_Limited_Type (Rec_Type) if Is_Limited_Type (Rec_Type)
and then and then (Ada_Version < Ada_05 or else Is_Tagged_Type (Rec_Type))
(Ada_Version < Ada_05
or else Is_Tagged_Type (Rec_Type))
then then
return; return;
...@@ -2367,7 +2364,7 @@ package body Freeze is ...@@ -2367,7 +2364,7 @@ package body Freeze is
and then Present (Expression (Parent (E))) and then Present (Expression (Parent (E)))
and then Nkind (Expression (Parent (E))) = N_Aggregate and then Nkind (Expression (Parent (E))) = N_Aggregate
and then and then
Expand_Atomic_Aggregate (Expression (Parent (E)), Etype (E)) Expand_Atomic_Aggregate (Expression (Parent (E)), Etype (E))
then then
null; null;
end if; end if;
...@@ -2375,8 +2372,8 @@ package body Freeze is ...@@ -2375,8 +2372,8 @@ package body Freeze is
-- For a subprogram, freeze all parameter types and also the return -- For a subprogram, freeze all parameter types and also the return
-- type (RM 13.14(14)). However skip this for internal subprograms. -- type (RM 13.14(14)). However skip this for internal subprograms.
-- This is also the point where any extra formal parameters are -- This is also the point where any extra formal parameters are
-- created since we now know whether the subprogram will use -- created since we now know whether the subprogram will use a
-- a foreign convention. -- foreign convention.
if Is_Subprogram (E) then if Is_Subprogram (E) then
if not Is_Internal (E) then if not Is_Internal (E) then
...@@ -2402,12 +2399,10 @@ package body Freeze is ...@@ -2402,12 +2399,10 @@ package body Freeze is
-- If the type of a formal is incomplete, subprogram -- If the type of a formal is incomplete, subprogram
-- is being frozen prematurely. Within an instance -- is being frozen prematurely. Within an instance
-- (but not within a wrapper package) this is an -- (but not within a wrapper package) this is an
-- an artifact of our need to regard the end of an -- artifact of our need to regard the end of an
-- instantiation as a freeze point. Otherwise it is -- instantiation as a freeze point. Otherwise it is
-- a definite error. -- a definite error.
-- and then not Is_Wrapper_Package (Current_Scope) ???
if In_Instance then if In_Instance then
Set_Is_Frozen (E, False); Set_Is_Frozen (E, False);
return No_List; return No_List;
......
...@@ -13310,7 +13310,7 @@ file. If the order of the source directories is not known statically, it is ...@@ -13310,7 +13310,7 @@ file. If the order of the source directories is not known statically, it is
an error to have several files with the same source file name. an error to have several files with the same source file name.
Projects can be specified to have no Ada source Projects can be specified to have no Ada source
files: the value of (@code{Source_Dirs} or @code{Source_Files} may be an empty files: the value of @code{Source_Dirs} or @code{Source_Files} may be an empty
list, or the @code{"Ada"} may be absent from @code{Languages}: list, or the @code{"Ada"} may be absent from @code{Languages}:
@smallexample @c projectfile @smallexample @c projectfile
...@@ -7796,60 +7796,72 @@ package body Prj.Nmsc is ...@@ -7796,60 +7796,72 @@ package body Prj.Nmsc is
Excluded : File_Found; Excluded : File_Found;
Proj : Project_Id; Proj : Project_Id;
begin begin
Proj := Project; -- Minor optimization: if there are no excluded files, no need to
while Proj /= No_Project loop -- traverse the list of sources. We cannot however also check whether
Iter := For_Each_Source (In_Tree, Proj); -- the existing exceptions have ".Found" set to True (indicating we
while Prj.Element (Iter) /= No_Source loop -- found them before) because we need to do some final processing on
Source := Prj.Element (Iter); -- them in any case.
Excluded := Excluded_Sources_Htable.Get
(Excluded_Sources, Source.File);
if Excluded /= No_File_Found then
Source.Locally_Removed := True;
Source.In_Interfaces := False;
if Current_Verbosity = High then if Excluded_Sources_Htable.Get_First (Excluded_Sources) /=
Write_Str ("Removing file "); No_File_Found
Write_Line then
(Get_Name_String (Excluded.File) Proj := Project;
& " " & Get_Name_String (Source.Project.Name)); while Proj /= No_Project loop
Iter := For_Each_Source (In_Tree, Proj);
while Prj.Element (Iter) /= No_Source loop
Source := Prj.Element (Iter);
Excluded := Excluded_Sources_Htable.Get
(Excluded_Sources, Source.File);
if Excluded /= No_File_Found then
Source.Locally_Removed := True;
Source.In_Interfaces := False;
if Current_Verbosity = High then
Write_Str ("Removing file ");
Write_Line
(Get_Name_String (Excluded.File)
& " " & Get_Name_String (Source.Project.Name));
end if;
Excluded_Sources_Htable.Remove
(Excluded_Sources, Source.File);
end if; end if;
Excluded_Sources_Htable.Remove Next (Iter);
(Excluded_Sources, Source.File); end loop;
end if;
Next (Iter); Proj := Proj.Extends;
end loop; end loop;
end if;
Proj := Proj.Extends;
end loop;
-- If we have any excluded element left, that means we did not find -- If we have any excluded element left, that means we did not find
-- the source file -- the source file
Excluded := Excluded_Sources_Htable.Get_First (Excluded_Sources); Excluded := Excluded_Sources_Htable.Get_First (Excluded_Sources);
while Excluded /= No_File_Found loop while Excluded /= No_File_Found loop
if not Excluded.Found then
-- Check if the file belongs to another imported project to -- Check if the file belongs to another imported project to
-- provide a better error message. -- provide a better error message.
Src := Find_Source Src := Find_Source
(In_Tree => In_Tree, (In_Tree => In_Tree,
Project => Project, Project => Project,
In_Imported_Only => True, In_Imported_Only => True,
Base_Name => Excluded.File); Base_Name => Excluded.File);
Err_Vars.Error_Msg_File_1 := Excluded.File; Err_Vars.Error_Msg_File_1 := Excluded.File;
if Src = No_Source then if Src = No_Source then
Error_Msg Error_Msg
(Project, In_Tree, "unknown file {", Excluded.Location); (Project, In_Tree, "unknown file {", Excluded.Location);
else else
Error_Msg Error_Msg
(Project, In_Tree, (Project, In_Tree,
"cannot remove a source from an imported project: {", "cannot remove a source from an imported project: {",
Excluded.Location); Excluded.Location);
end if;
end if; end if;
Excluded := Excluded_Sources_Htable.Get_Next (Excluded_Sources); Excluded := Excluded_Sources_Htable.Get_Next (Excluded_Sources);
......
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