summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 11:08:56 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 11:08:56 +0000
commitb1a1a5f77c6484ac6462f5b95200253614876755 (patch)
tree43de46f1d86249df6141c9e602fac7c2e2a3847e /gcc/ada
parent568a61508e4c7af782e43f686297cdb6d8698283 (diff)
downloadgcc-b1a1a5f77c6484ac6462f5b95200253614876755.tar.gz
2009-11-30 Arnaud Charlet <charlet@adacore.com>
* s-taprop-posix.adb: Fix casing. * s-osinte-tru64.adb: Complete previous check-in. 2009-11-30 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Document pragma Compiler_Unit * s-bitops.adb, s-restri.adb, g-htable.adb, s-restri.ads, a-comlin.ads, a-strhas.ads, s-strhas.adb, s-parame.adb, s-parame.ads, a-clrefi.adb, a-clrefi.ads, a-ioexce.ads: Supply missing Compiler_Unit pragmas. * freeze.adb (Freeze_Entity): Improve message for 8-bit boolean passed to C. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154784 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog15
-rw-r--r--gcc/ada/a-clrefi.adb4
-rw-r--r--gcc/ada/a-clrefi.ads2
-rw-r--r--gcc/ada/a-comlin.ads2
-rw-r--r--gcc/ada/a-ioexce.ads2
-rw-r--r--gcc/ada/a-strhas.ads2
-rw-r--r--gcc/ada/freeze.adb28
-rw-r--r--gcc/ada/g-htable.adb6
-rw-r--r--gcc/ada/gnat_rm.texi20
-rw-r--r--gcc/ada/s-bitops.adb2
-rw-r--r--gcc/ada/s-osinte-tru64.adb2
-rw-r--r--gcc/ada/s-parame.adb2
-rw-r--r--gcc/ada/s-parame.ads2
-rw-r--r--gcc/ada/s-restri.adb2
-rw-r--r--gcc/ada/s-restri.ads2
-rw-r--r--gcc/ada/s-strhas.adb2
-rw-r--r--gcc/ada/s-taprop-posix.adb2
17 files changed, 85 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 8fa17573da6..33f3219507c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-30 Arnaud Charlet <charlet@adacore.com>
+
+ * s-taprop-posix.adb: Fix casing.
+ * s-osinte-tru64.adb: Complete previous check-in.
+
+2009-11-30 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi: Document pragma Compiler_Unit
+ * s-bitops.adb, s-restri.adb, g-htable.adb, s-restri.ads,
+ a-comlin.ads, a-strhas.ads, s-strhas.adb, s-parame.adb,
+ s-parame.ads, a-clrefi.adb, a-clrefi.ads, a-ioexce.ads: Supply missing
+ Compiler_Unit pragmas.
+ * freeze.adb (Freeze_Entity): Improve message for 8-bit boolean passed
+ to C.
+
2009-11-30 Robert Dewar <dewar@adacore.com>
* makeutl.adb, makeutl.ads, prj-proc.adb, prj.adb, prj.ads: Minor
diff --git a/gcc/ada/a-clrefi.adb b/gcc/ada/a-clrefi.adb
index 210e8615aa6..938ea18fb5e 100644
--- a/gcc/ada/a-clrefi.adb
+++ b/gcc/ada/a-clrefi.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2007-2009, 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- --
@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
with Ada.Unchecked_Deallocation;
with System.OS_Lib; use System.OS_Lib;
diff --git a/gcc/ada/a-clrefi.ads b/gcc/ada/a-clrefi.ads
index 63b45881499..fdefafcccc9 100644
--- a/gcc/ada/a-clrefi.ads
+++ b/gcc/ada/a-clrefi.ads
@@ -36,6 +36,8 @@
-- Using a response file allow passing a set of arguments to an executable
-- longer than the maximum allowed by the system on the command line.
+pragma Compiler_Unit;
+
with System.Strings;
package Ada.Command_Line.Response_File is
diff --git a/gcc/ada/a-comlin.ads b/gcc/ada/a-comlin.ads
index a0335a49d72..8d66e1542b9 100644
--- a/gcc/ada/a-comlin.ads
+++ b/gcc/ada/a-comlin.ads
@@ -33,6 +33,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
package Ada.Command_Line is
pragma Preelaborate;
diff --git a/gcc/ada/a-ioexce.ads b/gcc/ada/a-ioexce.ads
index 43239ddb066..44865ab6649 100644
--- a/gcc/ada/a-ioexce.ads
+++ b/gcc/ada/a-ioexce.ads
@@ -13,6 +13,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
package Ada.IO_Exceptions is
pragma Pure;
diff --git a/gcc/ada/a-strhas.ads b/gcc/ada/a-strhas.ads
index 7d33bf7d019..c2574d1e996 100644
--- a/gcc/ada/a-strhas.ads
+++ b/gcc/ada/a-strhas.ads
@@ -13,6 +13,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
with Ada.Containers;
function Ada.Strings.Hash (Key : String) return Containers.Hash_Type;
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 85206f7ae8b..9301071b301 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -2535,6 +2535,8 @@ package body Freeze is
and then not Has_Warnings_Off (F_Type)
and then not Has_Warnings_Off (Formal)
then
+ -- Qualify mention of formals with subprogram name
+
Error_Msg_Qual_Level := 1;
-- Check suspicious use of fat C pointer
@@ -2543,8 +2545,8 @@ package body Freeze is
and then Esize (F_Type) > Ttypes.System_Address_Size
then
Error_Msg_N
- ("?type of & does not correspond "
- & "to C pointer!", Formal);
+ ("?type of & does not correspond to C pointer!",
+ Formal);
-- Check suspicious return of boolean
@@ -2554,8 +2556,10 @@ package body Freeze is
and then not Has_Size_Clause (F_Type)
then
Error_Msg_N
- ("?& is an 8-bit Ada Boolean, "
- & "use char in C!", Formal);
+ ("& is an 8-bit Ada Boolean?", Formal);
+ Error_Msg_N
+ ("\use appropriate corresponding type in C "
+ & "(e.g. char)?", Formal);
-- Check suspicious tagged type
@@ -2584,6 +2588,8 @@ package body Freeze is
Formal, F_Type);
end if;
+ -- Turn off name qualification after message output
+
Error_Msg_Qual_Level := 0;
end if;
@@ -2680,9 +2686,17 @@ package body Freeze is
and then not Has_Warnings_Off (R_Type)
and then not Has_Size_Clause (R_Type)
then
- Error_Msg_N
- ("?return type of & is an 8-bit "
- & "Ada Boolean, use char in C!", E);
+ declare
+ N : constant Node_Id :=
+ Result_Definition (Declaration_Node (E));
+ begin
+ Error_Msg_NE
+ ("return type of & is an 8-bit Ada Boolean?",
+ N, E);
+ Error_Msg_NE
+ ("\use appropriate corresponding type in C "
+ & "(e.g. char)?", N, E);
+ end;
-- Check suspicious return tagged type
diff --git a/gcc/ada/g-htable.adb b/gcc/ada/g-htable.adb
index 7cb2660fae2..aa6c6b7bcae 100644
--- a/gcc/ada/g-htable.adb
+++ b/gcc/ada/g-htable.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2009, AdaCore --
-- --
-- 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- --
@@ -34,7 +34,9 @@
-- This is a dummy body, required because if we remove the body we have
-- bootstrap path problems (this unit used to have a body, and if we do not
-- supply a dummy body, the old incorrect body is picked up during the
--- bootstrap process.
+-- bootstrap process).
+
+pragma Compiler_Unit;
package body GNAT.HTable is
end GNAT.HTable;
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 4b906fe91e9..0a197c011f4 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -112,6 +112,7 @@ Implementation Defined Pragmas
* Pragma Common_Object::
* Pragma Compile_Time_Error::
* Pragma Compile_Time_Warning::
+* Pragma Compiler_Unit::
* Pragma Complete_Representation::
* Pragma Complex_Representation::
* Pragma Component_Alignment::
@@ -722,6 +723,7 @@ consideration, the use of these pragmas should be minimized.
* Pragma Common_Object::
* Pragma Compile_Time_Error::
* Pragma Compile_Time_Warning::
+* Pragma Compiler_Unit::
* Pragma Complete_Representation::
* Pragma Complex_Representation::
* Pragma Component_Alignment::
@@ -1333,6 +1335,24 @@ of formal parameters are tested, and warnings given appropriately. Another use
with a first parameter of True is to warn a client about use of a package,
for example that it is not fully implemented.
+@node Pragma Compiler_Unit
+@unnumberedsec Pragma Compiler_Unit
+@findex Compiler_Unit
+@noindent
+Syntax:
+
+@smallexample @c ada
+pragma Compiler_Unit;
+@end smallexample
+
+@noindent
+This pragma is intended only for internal use in the GNAT run-time library.
+It indicates that the unit is used as part of the compiler build. The effect
+is to disallow constructs (raise with message, conditional expressions etc)
+that would cause trouble when bootstrapping using an older version of GNAT.
+For the exact list of restrictions, see the compiler sources and references
+to Is_Compiler_Unit.
+
@node Pragma Complete_Representation
@unnumberedsec Pragma Complete_Representation
@findex Complete_Representation
diff --git a/gcc/ada/s-bitops.adb b/gcc/ada/s-bitops.adb
index a49ffed7b88..c49b829763d 100644
--- a/gcc/ada/s-bitops.adb
+++ b/gcc/ada/s-bitops.adb
@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
with System; use System;
with System.Unsigned_Types; use System.Unsigned_Types;
diff --git a/gcc/ada/s-osinte-tru64.adb b/gcc/ada/s-osinte-tru64.adb
index 6229ba0caec..ad391bcb473 100644
--- a/gcc/ada/s-osinte-tru64.adb
+++ b/gcc/ada/s-osinte-tru64.adb
@@ -102,7 +102,7 @@ package body System.OS_Interface is
Res :=
mprotect
(Teb.all.stack_yellow, Get_Page_Size,
- prot => (if Res then PROT_ON else PROT_OFF));
+ prot => (if Hide then PROT_ON else PROT_OFF));
end if;
end Hide_Unhide_Yellow_Zone;
diff --git a/gcc/ada/s-parame.adb b/gcc/ada/s-parame.adb
index 63eae6e2f95..ff61b7ee572 100644
--- a/gcc/ada/s-parame.adb
+++ b/gcc/ada/s-parame.adb
@@ -31,6 +31,8 @@
-- This is the default (used on all native platforms) version of this package
+pragma Compiler_Unit;
+
package body System.Parameters is
-------------------------
diff --git a/gcc/ada/s-parame.ads b/gcc/ada/s-parame.ads
index 511951386c6..2110034ec6b 100644
--- a/gcc/ada/s-parame.ads
+++ b/gcc/ada/s-parame.ads
@@ -46,6 +46,8 @@
-- Note: do not introduce any pragma Inline statements into this unit, since
-- otherwise the relinking and rebinding capability would be deactivated.
+pragma Compiler_Unit;
+
package System.Parameters is
pragma Pure;
diff --git a/gcc/ada/s-restri.adb b/gcc/ada/s-restri.adb
index 2db0e794a28..7ce6da9cc46 100644
--- a/gcc/ada/s-restri.adb
+++ b/gcc/ada/s-restri.adb
@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
package body System.Restrictions is
use Rident;
diff --git a/gcc/ada/s-restri.ads b/gcc/ada/s-restri.ads
index e9a72aa9f9b..cd447c1b0b4 100644
--- a/gcc/ada/s-restri.ads
+++ b/gcc/ada/s-restri.ads
@@ -38,6 +38,8 @@
-- with names discarded, so that we do not have image tables for the
-- large restriction enumeration types at run time.
+pragma Compiler_Unit;
+
with System.Rident;
package System.Restrictions is
diff --git a/gcc/ada/s-strhas.adb b/gcc/ada/s-strhas.adb
index b83823050e6..0e86cb66b31 100644
--- a/gcc/ada/s-strhas.adb
+++ b/gcc/ada/s-strhas.adb
@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
+pragma Compiler_Unit;
+
package body System.String_Hash is
-- Compute a hash value for a key. The approach here is follows the
diff --git a/gcc/ada/s-taprop-posix.adb b/gcc/ada/s-taprop-posix.adb
index 84c0eee4ffe..d05bb1cd2d4 100644
--- a/gcc/ada/s-taprop-posix.adb
+++ b/gcc/ada/s-taprop-posix.adb
@@ -246,7 +246,7 @@ package body System.Task_Primitives.Operations is
Res :=
mprotect (Guard_Page_Address, Get_Page_Size,
- prot => (if ON then PROT_ON else PROT_OFF));
+ prot => (if On then PROT_ON else PROT_OFF));
pragma Assert (Res = 0);
end if;
end Stack_Guard;