summaryrefslogtreecommitdiff
path: root/gcc/ada/ali-util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-01 10:59:58 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-01 10:59:58 +0000
commit4f84b7226c55f96f3fa458af7d8a15a72f33d1f8 (patch)
tree0d9edcd5120dd470ff8c1f523b5ecd692f338259 /gcc/ada/ali-util.adb
parent533474bc1ea83d2ac536785b2f6473bad9cfd7dc (diff)
downloadgcc-4f84b7226c55f96f3fa458af7d8a15a72f33d1f8.tar.gz
2011-09-01 Yannick Moy <moy@adacore.com>
* ali-util.adb, ali-util.ads (Read_Withed_ALIs): Add parameter Ignore_Errors to ignore failures to read ALI files when True. 2011-09-01 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Expand_N_Object_Declaration): Handle non-default constructor calls associated with non-tagged record types. 2011-09-01 Robert Dewar <dewar@adacore.com> * g-socthi-vms.adb: Minor reformatting. 2011-09-01 Nicolas Roche <roche@adacore.com> * sysdep.c: Don't use macro functions for stdio functions on VxWorks in order to avoid impact of imcompatible changes. * cstreams.c: Likewise * cio.c: Likewise * aux-io.c: Likewise 2011-09-01 Yannick Moy <moy@adacore.com> * lib-writ.adb (Write_With_Lines): Always output complete information on "with" line in Alfa mode, as this is required by formal verification back-end. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178406 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/ali-util.adb')
-rw-r--r--gcc/ada/ali-util.adb101
1 files changed, 56 insertions, 45 deletions
diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb
index a040d30fa23..0b43200f14e 100644
--- a/gcc/ada/ali-util.adb
+++ b/gcc/ada/ali-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -212,7 +212,10 @@ package body ALI.Util is
-- Read_Withed_ALIs --
----------------------
- procedure Read_Withed_ALIs (Id : ALI_Id) is
+ procedure Read_Withed_ALIs
+ (Id : ALI_Id;
+ Ignore_Errors : Boolean := False)
+ is
Afile : File_Name_Type;
Text : Text_Buffer_Ptr;
Idread : ALI_Id;
@@ -234,59 +237,67 @@ package body ALI.Util is
then
Text := Read_Library_Info (Afile);
- -- 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.
+ -- Unless Ignore_Errors is true, 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
- Error_Msg_File_1 := Afile;
- Error_Msg_File_2 := Withs.Table (W).Sfile;
- Error_Msg ("{ not found, { must be compiled");
- Set_Name_Table_Info (Afile, Int (No_Unit_Id));
- return;
- end if;
-
- -- Enter in ALIs table
- Idread :=
- Scan_ALI
- (F => Afile,
- T => Text,
- Ignore_ED => False,
- Err => False);
-
- Free (Text);
-
- if ALIs.Table (Idread).Compile_Errors then
- Error_Msg_File_1 := Withs.Table (W).Sfile;
- Error_Msg ("{ had errors, must be fixed, and recompiled");
- Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+ if not Ignore_Errors then
+ Error_Msg_File_1 := Afile;
+ Error_Msg_File_2 := Withs.Table (W).Sfile;
+ Error_Msg ("{ not found, { must be compiled");
+ Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+ return;
+ end if;
- elsif ALIs.Table (Idread).No_Object then
- Error_Msg_File_1 := Withs.Table (W).Sfile;
- Error_Msg ("{ must be recompiled");
- Set_Name_Table_Info (Afile, Int (No_Unit_Id));
- end if;
+ else
+ -- Enter in ALIs table
+
+ Idread :=
+ Scan_ALI
+ (F => Afile,
+ T => Text,
+ Ignore_ED => False,
+ Err => False);
+
+ Free (Text);
+
+ if ALIs.Table (Idread).Compile_Errors
+ and then not Ignore_Errors
+ then
+ Error_Msg_File_1 := Withs.Table (W).Sfile;
+ Error_Msg ("{ had errors, must be fixed, and recompiled");
+ Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+
+ elsif ALIs.Table (Idread).No_Object
+ and then not Ignore_Errors
+ then
+ Error_Msg_File_1 := Withs.Table (W).Sfile;
+ Error_Msg ("{ must be recompiled");
+ Set_Name_Table_Info (Afile, Int (No_Unit_Id));
+ end if;
- -- If the Unit is an Interface to a Stand-Alone Library,
- -- set the Interface flag in the Withs table, so that its
- -- dependant are not considered for elaboration order.
+ -- If the Unit is an Interface to a Stand-Alone Library,
+ -- set the Interface flag in the Withs table, so that its
+ -- dependant are not considered for elaboration order.
- if ALIs.Table (Idread).SAL_Interface then
- Withs.Table (W).SAL_Interface := True;
- Interface_Library_Unit := True;
+ if ALIs.Table (Idread).SAL_Interface then
+ Withs.Table (W).SAL_Interface := True;
+ Interface_Library_Unit := True;
- -- Set the entry in the Interfaces hash table, so that other
- -- units that import this unit will set the flag in their
- -- entry in the Withs table.
+ -- Set the entry in the Interfaces hash table, so that
+ -- other units that import this unit will set the flag
+ -- in their entry in the Withs table.
- Interfaces.Set (Afile, True);
+ Interfaces.Set (Afile, True);
- else
- -- Otherwise, recurse to get new dependents
+ else
+ -- Otherwise, recurse to get new dependents
- Read_Withed_ALIs (Idread);
+ Read_Withed_ALIs (Idread);
+ end if;
end if;
-- If the ALI file has already been processed and is an interface,