aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-nmsc.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-23 08:50:13 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-23 08:50:13 +0200
commite771c08509c5bc959cd8a59aaa15965cfc04a48c (patch)
tree2ec0a44a7df2f4c0418b8bc7e3d89f8f11b94c65 /gcc/ada/prj-nmsc.adb
parent5d791dfbcd073013a6145abc3d0b5f04dd2eaee5 (diff)
downloadgcc-e771c08509c5bc959cd8a59aaa15965cfc04a48c.zip
gcc-e771c08509c5bc959cd8a59aaa15965cfc04a48c.tar.gz
gcc-e771c08509c5bc959cd8a59aaa15965cfc04a48c.tar.bz2
[multiple changes]
2010-06-23 Javier Miranda <miranda@adacore.com> * atree.ads (Set_Reporting_Proc): New subprogram. * atree.adb: Remove dependency on packages Opt and SCIL_LL. (Allocate_Initialize_Node, Replace, Rewrite): Replace direct calls to routines of package Scil_ll by indirect call to the registered subprogram. (Set_Reporting_Proc): New subprogram. Used to register a subprogram that is invoked when a node is allocated, replaced or rewritten. * scil_ll.adb (Copy_SCIL_Node): New routine that takes care of copying the SCIL node. Used as argument for Set_Reporting_Proc. (Initialize): Register Copy_SCIL_Node as the reporting routine that is invoked by atree. 2010-06-23 Thomas Quinot <quinot@adacore.com> * sem_ch3.ads: Minor reformatting. 2010-06-23 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Package_Instantiation): In CodePeer mode, always analyze the generic body and instance, because it may be needed downstream. (Mark_Context): Prepend the with clauses for needed generic units, so they appear in a better order for CodePeer. * sem_util.adb, sem_util.ads: Prototype code for AI05-0144. 2010-06-23 Emmanuel Briot <briot@adacore.com> * prj.ads, prj-nmsc.adb (Error_Or_Warning): New subprogram. From-SVN: r161252
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r--gcc/ada/prj-nmsc.adb103
1 files changed, 47 insertions, 56 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index f6557f1..b502b2a 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -467,6 +467,32 @@ package body Prj.Nmsc is
-- Debug print a value for a specific property. Does nothing when not in
-- debug mode
+ procedure Error_Or_Warning
+ (Flags : Processing_Flags;
+ Kind : Error_Warning;
+ Msg : String;
+ Location : Source_Ptr;
+ Project : Project_Id);
+ -- Emits either an error or warning message (or nothing), depending on Kind
+
+ ----------------------
+ -- Error_Or_Warning --
+ ----------------------
+
+ procedure Error_Or_Warning
+ (Flags : Processing_Flags;
+ Kind : Error_Warning;
+ Msg : String;
+ Location : Source_Ptr;
+ Project : Project_Id) is
+ begin
+ case Kind is
+ when Error => Error_Msg (Flags, Msg, Location, Project);
+ when Warning => Error_Msg (Flags, "?" & Msg, Location, Project);
+ when Silent => null;
+ end case;
+ end Error_Or_Warning;
+
------------------------------
-- Replace_Into_Name_Buffer --
------------------------------
@@ -5170,8 +5196,8 @@ package body Prj.Nmsc is
begin
if Root_Dir'Length = 0 then
Err_Vars.Error_Msg_File_1 := Base_Dir;
- Error_Msg
- (Data.Flags,
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Missing_Source_Files,
"{ is not a valid directory.", Location, Project);
else
@@ -5210,8 +5236,8 @@ package body Prj.Nmsc is
if not Dir_Exists then
Err_Vars.Error_Msg_File_1 := From;
- Error_Msg
- (Data.Flags,
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Missing_Source_Files,
"{ is not a valid directory", Location, Project);
else
@@ -5291,21 +5317,9 @@ package body Prj.Nmsc is
Err_Vars.Error_Msg_File_1 :=
File_Name_Type (Object_Dir.Value);
-
- case Data.Flags.Require_Obj_Dirs is
- when Error =>
- Error_Msg
- (Data.Flags,
- "object directory { not found",
- Project.Location, Project);
- when Warning =>
- Error_Msg
- (Data.Flags,
- "?object directory { not found",
- Project.Location, Project);
- when Silent =>
- null;
- end case;
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Require_Obj_Dirs,
+ "object directory { not found", Project.Location, Project);
end if;
end if;
@@ -6493,8 +6507,8 @@ package body Prj.Nmsc is
if not Found then
Error_Msg_Name_1 := Name_Id (Source.Display_File);
Error_Msg_Name_2 := Name_Id (Source.Unit.Name);
- Error_Msg
- (Data.Flags,
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Missing_Source_Files,
"source file %% for unit %% not found",
No_Location, Project.Project);
@@ -6536,41 +6550,18 @@ package body Prj.Nmsc is
while NL /= No_Name_Location loop
if not NL.Found then
Err_Vars.Error_Msg_File_1 := NL.Name;
-
- case Data.Flags.Missing_Source_Files is
- when Error =>
- if First_Error then
- Error_Msg
- (Data.Flags,
- "source file { not found",
- NL.Location, Project.Project);
- First_Error := False;
-
- else
- Error_Msg
- (Data.Flags,
- "\source file { not found",
- NL.Location, Project.Project);
- end if;
-
- when Warning =>
- if First_Error then
- Error_Msg
- (Data.Flags,
- "?source file { not found",
- NL.Location, Project.Project);
- First_Error := False;
-
- else
- Error_Msg
- (Data.Flags,
- "?\source file { not found",
- NL.Location, Project.Project);
- end if;
-
- when Silent =>
- null;
- end case;
+ if First_Error then
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Missing_Source_Files,
+ "source file { not found",
+ NL.Location, Project.Project);
+ First_Error := False;
+ else
+ Error_Or_Warning
+ (Data.Flags, Data.Flags.Missing_Source_Files,
+ "\source file { not found",
+ NL.Location, Project.Project);
+ end if;
end if;
NL := Source_Names_Htable.Get_Next (Project.Source_Names);