aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/restrict.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-06-13 10:02:31 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-06-13 12:02:31 +0200
commitc86cf71483eb73bf8d637e4c9d6caef3b67b09a2 (patch)
tree5763142f34ae94b7103a174f78d7a22414f8261f /gcc/ada/restrict.adb
parent65ede00530bf84ad6fb7a04f6f1ff92cb5b095d6 (diff)
downloadgcc-c86cf71483eb73bf8d637e4c9d6caef3b67b09a2.zip
gcc-c86cf71483eb73bf8d637e4c9d6caef3b67b09a2.tar.gz
gcc-c86cf71483eb73bf8d637e4c9d6caef3b67b09a2.tar.bz2
lib.ads, [...] (Is_Compiler_Unit): Removed.
2014-06-13 Robert Dewar <dewar@adacore.com> * 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
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r--gcc/ada/restrict.adb13
1 files changed, 10 insertions, 3 deletions
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;