diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-01-29 15:07:21 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-01-29 15:07:21 +0100 |
commit | 42f1d66133be06839a62c257d0f56db2b321d994 (patch) | |
tree | ad02714b5465afe2a382ed08f4ad633454774c53 /gcc/ada/make.adb | |
parent | 477cfc5b60785205119bc2ab8b97d309e0a422f4 (diff) | |
download | gcc-42f1d66133be06839a62c257d0f56db2b321d994.zip gcc-42f1d66133be06839a62c257d0f56db2b321d994.tar.gz gcc-42f1d66133be06839a62c257d0f56db2b321d994.tar.bz2 |
[multiple changes]
2013-01-29 Robert Dewar <dewar@adacore.com>
* par-ch6.adb (No_Constraint_Maybe_Expr_Func): New procedure.
* par-util.adb (No_Constraint): Undo special handling, moved
to par-ch6.adb.
2013-01-29 Robert Dewar <dewar@adacore.com>
* aspects.ads: Aspect Warnings is implementation defined Add
some other missing entries to impl-defined list Mark Warnings
as GNAT pragma in main list.
* sem_ch8.adb: Process aspects for all cases of renaming
declarations.
2013-01-29 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb (Analyze_Function_Call): Set In_Assertion flag.
* sem_elab.adb (Check_Internal_Call_Continue): Do not issue
warnings about possible elaboration error if call is within
an assertion.
* sinfo.ads, sinfo.adb (In_Assertion): New flag in N_Function_Call node.
2013-01-29 Robert Dewar <dewar@adacore.com>
* a-calend-vms.adb, g-eacodu-vms.adb, g-trasym-vms-alpha.adb,
* s-auxdec-vms-ia64.adb, s-mastop-vms.adb, s-osprim-vms.adb,
s-tasdeb-vms.adb: Replace pragma Interface by pragma Import.
2013-01-29 Robert Dewar <dewar@adacore.com>
* opt.ads (Ignore_Style_Checks_Pragmas): New flag.
* par-prag.adb (Par, case Style_Checks): Recognize
Ignore_Style_Checks_Pragmas.
* sem_prag.adb (Analyze_Pragma, case Style_Checks): Recognize
Ignore_Style_Checks_Pragmas.
* switch-c.adb: Recognize -gnateY switch.
* usage.adb: Add documentation for "-gnateY".
* vms_data.ads: Add IGNORE_STYLE_CHECKS_PRAGMAS (-gnateY).
2013-01-29 Vincent Celier <celier@adacore.com>
* clean.adb (Clean_Executables): Add Sid component when calling
Queue.Insert.
* make.adb: When inserting in the Queue, add the Source_Id
(Sid) when it is known (Start_Compile_If_Possible): When the
Source_Id is known (Sid), get the path name of the ALI file
(Full_Lib_File) from it, to avoid finding old ALI files in other
object directories.
* makeutl.ads (Source_Info): New Source_Id component Sid in
Format_Gnatmake variant.
2013-01-29 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Document -gnateY.
2013-01-29 Doug Rupp <rupp@adacore.com>
* s-osinte-vms.ads, s-taprop-vms.adb, system-vms_64.ads,
system-vms-ia64.ads: Replace pragma Interface by pragma Import.
From-SVN: r195536
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r-- | gcc/ada/make.adb | 82 |
1 files changed, 61 insertions, 21 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 97d4278..61649da 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -2746,7 +2746,8 @@ package body Make is File => Sfile, Unit => No_Unit_Name, Project => No_Project, - Index => 0)) + Index => 0, + Sid => No_Source)) then if Is_In_Obsoleted (Sfile) then Executable_Obsolete := True; @@ -3091,6 +3092,7 @@ package body Make is ALI : ALI_Id; Source_Index : Int; Sfile : File_Name_Type; + Sid : Prj.Source_Id; Uname : Unit_Name_Type; Unit_Name : Name_Id; Uid : Prj.Unit_Index; @@ -3137,6 +3139,7 @@ package body Make is loop Sfile := Withs.Table (K).Sfile; Uname := Withs.Table (K).Uname; + Sid := No_Source; -- If project files are used, find the proper source to -- compile in case Sfile is the spec but there is a body. @@ -3154,12 +3157,14 @@ package body Make is then Sfile := Uid.File_Names (Impl).File; Source_Index := Uid.File_Names (Impl).Index; + Sid := Uid.File_Names (Impl); elsif Uid.File_Names (Spec) /= null and then not Uid.File_Names (Spec).Locally_Removed then Sfile := Uid.File_Names (Spec).File; Source_Index := Uid.File_Names (Spec).Index; + Sid := Uid.File_Names (Spec); end if; end if; end if; @@ -3187,7 +3192,8 @@ package body Make is File => Sfile, Project => ALI_P.Project, Unit => Withs.Table (K).Uname, - Index => Source_Index)); + Index => Source_Index, + Sid => Sid)); end if; end if; end loop; @@ -3308,16 +3314,16 @@ package body Make is is In_Lib_Dir : Boolean; Need_To_Compile : Boolean; - Pid : Process_Id; + Pid : Process_Id := Invalid_Pid; Process_Created : Boolean; Source : Queue.Source_Info; - Full_Source_File : File_Name_Type; + Full_Source_File : File_Name_Type := No_File; Source_File_Attr : aliased File_Attributes; -- The full name of the source file and its attributes (size, ...) Lib_File : File_Name_Type; - Full_Lib_File : File_Name_Type; + Full_Lib_File : File_Name_Type := No_File; Lib_File_Attr : aliased File_Attributes; Read_Only : Boolean := False; ALI : ALI_Id; @@ -3335,23 +3341,49 @@ package body Make is then Queue.Extract (Found, Source); - Osint.Full_Source_Name - (Source.File, - Full_File => Full_Source_File, - Attr => Source_File_Attr'Access); + -- If it is a source in a project, first look for the ALI file + -- in the object directory. When the project is extending another + -- the ALI file may not be found, but the source does not + -- necessarily need to be compiled, as it may already be up to + -- date in the project being extended. In this case, look for an + -- ALI file in all the object directories, as is done when + -- gnatmake is not invoked with a project file. + + if Source.Sid /= No_Source then + Initialize_Source_Record (Source.Sid); + Full_Source_File := + File_Name_Type (Source.Sid.Path.Display_Name); + Lib_File := Source.Sid.Dep_Name; + Full_Lib_File := File_Name_Type (Source.Sid.Dep_Path); + Lib_File_Attr := Unknown_Attributes; + + if Full_Lib_File /= No_File then + declare + FLF : constant String := + Get_Name_String (Full_Lib_File) & ASCII.NUL; + begin + if not Is_Regular_File + (FLF'Address, Lib_File_Attr'Access) + then + Full_Lib_File := No_File; + end if; + end; + end if; + end if; - Lib_File := Osint.Lib_File_Name (Source.File, Source.Index); + if Full_Lib_File = No_File then + Osint.Full_Source_Name + (Source.File, + Full_File => Full_Source_File, + Attr => Source_File_Attr'Access); - -- ??? This call could be avoided when using projects, since we - -- know where the ALI file is supposed to be. That would avoid - -- searches in the object directories, including in the runtime - -- dir. However, that would require getting access to the - -- Source_Id. + Lib_File := Osint.Lib_File_Name (Source.File, Source.Index); - Osint.Full_Lib_File_Name - (Lib_File, - Lib_File => Full_Lib_File, - Attr => Lib_File_Attr); + Osint.Full_Lib_File_Name + (Lib_File, + Lib_File => Full_Lib_File, + Attr => Lib_File_Attr); + end if; -- If source has already been compiled, executable is obsolete @@ -3734,7 +3766,8 @@ package body Make is File => Main_Source, Project => Main_Project, Unit => No_Unit_Name, - Index => Main_Index)); + Index => Main_Index, + Sid => No_Source)); First_Compiled_File := No_File; Most_Recent_Obj_File := No_File; @@ -6650,6 +6683,7 @@ package body Make is Put_In_Q : Boolean := Into_Q; Unit : Unit_Index; Sfile : File_Name_Type; + Sid : Prj.Source_Id; Index : Int; Project : Project_Id; @@ -6659,6 +6693,7 @@ package body Make is Unit := Units_Htable.Get_First (Project_Tree.Units_HT); while Unit /= null loop Sfile := No_File; + Sid := No_Source; Index := 0; Project := No_Project; @@ -6704,15 +6739,18 @@ package body Make is if Sinput.P.Source_File_Is_Subunit (Src_Ind) then Sfile := No_File; Index := 0; + Sid := No_Source; else Sfile := Unit.File_Names (Impl).Display_File; Index := Unit.File_Names (Impl).Index; + Sid := Unit.File_Names (Impl); end if; end; else Sfile := Unit.File_Names (Impl).Display_File; Index := Unit.File_Names (Impl).Index; + Sid := Unit.File_Names (Impl); end if; end if; @@ -6728,6 +6766,7 @@ package body Make is Sfile := Unit.File_Names (Spec).Display_File; Index := Unit.File_Names (Spec).Index; + Sid := Unit.File_Names (Spec); Project := Unit.File_Names (Spec).Project; end if; @@ -6744,7 +6783,8 @@ package body Make is File => Sfile, Project => Project, Unit => No_Unit_Name, - Index => Index)); + Index => Index, + Sid => Sid)); end if; if not Put_In_Q and then Sfile /= No_File then |