summaryrefslogtreecommitdiff
path: root/gcc/ada/make.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-04 13:00:35 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-04 13:00:35 +0000
commit7d7c97e8eba638d3c0a0dfa475112ec5e11da9fb (patch)
tree96fd65519a4e0289bd387135dbf3778b82117043 /gcc/ada/make.adb
parent6894bd1184d1745ab649692cfbfdfec1a1a35207 (diff)
downloadgcc-7d7c97e8eba638d3c0a0dfa475112ec5e11da9fb.tar.gz
2011-08-04 Emmanuel Briot <briot@adacore.com>
* makeutl.adb (Compute_Builder_Switches): no longer accept a unit name as an index for Builder'Switches. This conforms to the documentation. * make.adb (Insert_Project_Sources): avoid duplicate code git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177375 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r--gcc/ada/make.adb47
1 files changed, 9 insertions, 38 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index d450648e8a6..6d1eaa5e54a 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -5831,7 +5831,7 @@ package body Make is
-- Get the first executable.
-- ??? This needs to be done early, because Osint.Next_Main_File also
- -- initializes the primary search directory, used below to initiliaze
+ -- initializes the primary search directory, used below to initialize
-- the "-I" parameter
Main_Source_File := Next_Main_Source; -- No directory information
@@ -6610,41 +6610,6 @@ package body Make is
Index : Int;
Project : Project_Id;
- Extending : constant Boolean := The_Project.Extends /= No_Project;
-
- function Check_Project (P : Project_Id) return Boolean;
- -- Returns True if P is The_Project or a project extended by The_Project
-
- -------------------
- -- Check_Project --
- -------------------
-
- function Check_Project (P : Project_Id) return Boolean is
- begin
- if All_Projects or else P = The_Project then
- return True;
-
- elsif Extending then
- declare
- Proj : Project_Id;
-
- begin
- Proj := The_Project;
- while Proj /= null loop
- if P = Proj.Extends then
- return True;
- end if;
-
- Proj := Proj.Extends;
- end loop;
- end;
- end if;
-
- return False;
- end Check_Project;
-
- -- Start of processing for Insert_Project_Sources
-
begin
-- Loop through all the sources in the project files
@@ -6662,7 +6627,10 @@ package body Make is
then
-- And it is a source for the specified project
- if Check_Project (Unit.File_Names (Impl).Project) then
+ if All_Projects
+ or else
+ Is_Extending (The_Project, Unit.File_Names (Impl).Project)
+ then
Project := Unit.File_Names (Impl).Project;
-- If we don't have a spec, we cannot consider the source
@@ -6707,7 +6675,10 @@ package body Make is
elsif Unit.File_Names (Spec) /= null
and then not Unit.File_Names (Spec).Locally_Removed
- and then Check_Project (Unit.File_Names (Spec).Project)
+ and then
+ (All_Projects
+ or else
+ Is_Extending (The_Project, Unit.File_Names (Spec).Project))
then
-- If there is no source for the body, but there is one for the
-- spec which has not been locally removed, then we take this one.