From 92167df3c9735de9c62bab9bf325618febc75198 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 17 Sep 2019 07:59:48 +0000 Subject: [PATCH] [Ada] Ignore missing ALI files in GNATprove mode This change only affects GNATprove backend, where it avoids spurious errors on missing ALI files for units indirectly withed from the current unit and processed as part of a different .gpr project. No test provided, because only GNATprove is affected. 2019-09-17 Piotr Trojanek gcc/ada/ * ali.ads: Fix casing in comment. * ali-util.ads, ali-util.adb (Read_Withed_ALIs): Remove Ignore_Errors parameter; it was only set to non-default value of True when running in GNATprove_Mode and wrongly reset to False when calling this routine recursively. Now in GNATprove mode we want it to be always True, so in fact it is equivalent to GNATProve_Mode flag itself (which was already used in this routine). From-SVN: r275775 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/ali-util.adb | 12 ++++-------- gcc/ada/ali-util.ads | 10 ++++------ gcc/ada/ali.ads | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5b1a7d1..fb1f7f5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2019-09-17 Piotr Trojanek + + * ali.ads: Fix casing in comment. + * ali-util.ads, ali-util.adb (Read_Withed_ALIs): Remove + Ignore_Errors parameter; it was only set to non-default value of + True when running in GNATprove_Mode and wrongly reset to False + when calling this routine recursively. Now in GNATprove mode we + want it to be always True, so in fact it is equivalent to + GNATProve_Mode flag itself (which was already used in this + routine). + 2019-09-17 Arnaud Charlet * adaint.c (_REENTRANT, _THREAD_SAFE): Only define if needed. diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb index 0d9a22a..1efad4d 100644 --- a/gcc/ada/ali-util.adb +++ b/gcc/ada/ali-util.adb @@ -215,10 +215,7 @@ package body ALI.Util is -- Read_Withed_ALIs -- ---------------------- - procedure Read_Withed_ALIs - (Id : ALI_Id; - Ignore_Errors : Boolean := False) - is + procedure Read_Withed_ALIs (Id : ALI_Id) is Afile : File_Name_Type; Text : Text_Buffer_Ptr; Idread : ALI_Id; @@ -240,14 +237,14 @@ package body ALI.Util is then Text := Read_Library_Info (Afile); - -- Unless Ignore_Errors is true, return with an error if source + -- Unless in GNATprove mode, return with an error if source -- cannot be found. We used to skip this check when we did not -- compile library generics separately, but we now always do, -- so there is no special case here anymore. if Text = null then - if not Ignore_Errors then + if not GNATprove_Mode then Error_Msg_File_1 := Afile; Error_Msg_File_2 := Withs.Table (W).Sfile; Error_Msg ("{ not found, { must be compiled"); @@ -268,7 +265,7 @@ package body ALI.Util is Free (Text); if ALIs.Table (Idread).Compile_Errors - and then not Ignore_Errors + and then not GNATprove_Mode then Error_Msg_File_1 := Withs.Table (W).Sfile; Error_Msg ("{ had errors, must be fixed, and recompiled"); @@ -279,7 +276,6 @@ package body ALI.Util is elsif ALIs.Table (Idread).No_Object and then not GNATprove_Mode - and then not Ignore_Errors then Error_Msg_File_1 := Withs.Table (W).Sfile; Error_Msg ("{ must be recompiled"); diff --git a/gcc/ada/ali-util.ads b/gcc/ada/ali-util.ads index 3023d00..7b3f9a5 100644 --- a/gcc/ada/ali-util.ads +++ b/gcc/ada/ali-util.ads @@ -107,15 +107,13 @@ package ALI.Util is -- Subprograms for Manipulating ALI Information -- -------------------------------------------------- - procedure Read_Withed_ALIs - (Id : ALI_Id; - Ignore_Errors : Boolean := False); + procedure Read_Withed_ALIs (Id : ALI_Id); -- Process an ALI file which has been read and scanned by looping through -- all withed units in the ALI file, checking if they have been processed. -- Each unit that has not yet been processed will be read, scanned, and - -- processed recursively. If Ignore_Errors is True, then failure to read an - -- ALI file is not reported as an error, and scanning continues with other - -- ALI files. + -- processed recursively. In GNATprove mode a failure to read an ALI file + -- is not reported as an error, and scanning continues with other ALI + -- files. procedure Set_Source_Table (A : ALI_Id); -- Build source table entry corresponding to the ALI file whose id is A diff --git a/gcc/ada/ali.ads b/gcc/ada/ali.ads index 5e2ec71..7e12c7b 100644 --- a/gcc/ada/ali.ads +++ b/gcc/ada/ali.ads @@ -1429,7 +1429,7 @@ package ALI is -- both. If both are provided then only the Read_Lines value is used, -- and the Ignore_Lines parameter is ignored. -- - -- Read_XREF is set True to read and acquire the cross-reference + -- Read_Xref is set True to read and acquire the cross-reference -- information. If Read_XREF is set to True, then the effect is to ignore -- all lines other than U, W, D and X lines and the Ignore_Lines and -- Read_Lines parameters are ignored (i.e. the use of True for Read_XREF -- 2.7.4