From c86cf71483eb73bf8d637e4c9d6caef3b67b09a2 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Fri, 13 Jun 2014 10:02:31 +0000 Subject: lib.ads, [...] (Is_Compiler_Unit): Removed. 2014-06-13 Robert Dewar * lib.ads, lib.adb, lib-writ.adb, lib-load.adb (Is_Compiler_Unit): Removed. * opt.ads (Compiler_Unit): New flag. * par-ch5.adb (Test_Statement_Required): Call Check_Compiler_Unit for null statement sequence (not allowed in compiler unit). * par-prag.adb (Prag): Handle Compiler_Unit[_Warning] during parsing. * restrict.ads, restrict.adb (Check_Compiler_Unit): New version and new calling sequence. * sem_ch11.adb, sem_ch3.adb, sem_ch4.adb: New calling sequence for Check_Compiler_Unit. * sem_ch6.adb (Analyze_Extended_Return_Statement): Call Check_Compiler_Unit (this construct is not allowed in compiler units). * sem_prag.adb (Analyze_Pragma, case Compiler_Unit[_Warning]): Set Opt.Compiler_Unit. From-SVN: r211617 --- gcc/ada/restrict.adb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/ada/restrict.adb') diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index a376efe..8983f78 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -168,10 +168,17 @@ package body Restrict is -- Check_Compiler_Unit -- ------------------------- - procedure Check_Compiler_Unit (N : Node_Id) is + procedure Check_Compiler_Unit (Feature : String; N : Node_Id) is begin - if Is_Compiler_Unit (Get_Source_Unit (N)) then - Error_Msg_N ("use of construct not allowed in compiler!!??", N); + if Compiler_Unit then + Error_Msg_N (Feature & " not allowed in compiler unit!!??", N); + end if; + end Check_Compiler_Unit; + + procedure Check_Compiler_Unit (Feature : String; Loc : Source_Ptr) is + begin + if Compiler_Unit then + Error_Msg (Feature & " not allowed in compiler unit!!??", Loc); end if; end Check_Compiler_Unit; -- cgit v1.1