Par := Parent (Par);
end if;
- if (Nkind (Par) = N_Object_Declaration
- or else Nkind (Par) = N_Assignment_Statement)
+ if Nkind_In (Par, N_Object_Declaration, N_Assignment_Statement)
and then Comes_From_Source (Par)
then
Temp :=
----------------------------
function After_Last_Declaration return Boolean is
- Spec : constant Node_Id := Parent (Current_Scope);
+ Spec : constant Node_Id := Parent (Current_Scope);
begin
if Nkind (Spec) = N_Package_Specification then
if Present (Private_Declarations (Spec)) then
-- either a tagged type, or a limited record.
if Is_Limited_Type (Rec_Type)
- and then
- (Ada_Version < Ada_05
- or else Is_Tagged_Type (Rec_Type))
+ and then (Ada_Version < Ada_05 or else Is_Tagged_Type (Rec_Type))
then
return;
and then Present (Expression (Parent (E)))
and then Nkind (Expression (Parent (E))) = N_Aggregate
and then
- Expand_Atomic_Aggregate (Expression (Parent (E)), Etype (E))
+ Expand_Atomic_Aggregate (Expression (Parent (E)), Etype (E))
then
null;
end if;
-- For a subprogram, freeze all parameter types and also the return
-- type (RM 13.14(14)). However skip this for internal subprograms.
-- This is also the point where any extra formal parameters are
- -- created since we now know whether the subprogram will use
- -- a foreign convention.
+ -- created since we now know whether the subprogram will use a
+ -- foreign convention.
if Is_Subprogram (E) then
if not Is_Internal (E) then
-- If the type of a formal is incomplete, subprogram
-- is being frozen prematurely. Within an instance
-- (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
-- a definite error.
- -- and then not Is_Wrapper_Package (Current_Scope) ???
-
if In_Instance then
Set_Is_Frozen (E, False);
return No_List;
Excluded : File_Found;
Proj : Project_Id;
begin
- Proj := Project;
- 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;
+ -- Minor optimization: if there are no excluded files, no need to
+ -- traverse the list of sources. We cannot however also check whether
+ -- the existing exceptions have ".Found" set to True (indicating we
+ -- found them before) because we need to do some final processing on
+ -- them in any case.
- if Current_Verbosity = High then
- Write_Str ("Removing file ");
- Write_Line
- (Get_Name_String (Excluded.File)
- & " " & Get_Name_String (Source.Project.Name));
+ if Excluded_Sources_Htable.Get_First (Excluded_Sources) /=
+ No_File_Found
+ then
+ Proj := Project;
+ 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;
- Excluded_Sources_Htable.Remove
- (Excluded_Sources, Source.File);
- end if;
+ Next (Iter);
+ end loop;
- Next (Iter);
+ Proj := Proj.Extends;
end loop;
-
- Proj := Proj.Extends;
- end loop;
+ end if;
-- If we have any excluded element left, that means we did not find
-- the source file
Excluded := Excluded_Sources_Htable.Get_First (Excluded_Sources);
while Excluded /= No_File_Found loop
+ if not Excluded.Found then
- -- Check if the file belongs to another imported project to
- -- provide a better error message.
+ -- Check if the file belongs to another imported project to
+ -- provide a better error message.
- Src := Find_Source
- (In_Tree => In_Tree,
- Project => Project,
- In_Imported_Only => True,
- Base_Name => Excluded.File);
+ Src := Find_Source
+ (In_Tree => In_Tree,
+ Project => Project,
+ In_Imported_Only => True,
+ 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
- Error_Msg
- (Project, In_Tree, "unknown file {", Excluded.Location);
- else
- Error_Msg
- (Project, In_Tree,
- "cannot remove a source from an imported project: {",
- Excluded.Location);
+ if Src = No_Source then
+ Error_Msg
+ (Project, In_Tree, "unknown file {", Excluded.Location);
+ else
+ Error_Msg
+ (Project, In_Tree,
+ "cannot remove a source from an imported project: {",
+ Excluded.Location);
+ end if;
end if;
Excluded := Excluded_Sources_Htable.Get_Next (Excluded_Sources);