]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
restrict.ads, [...] (Check_Implicit_Dynamic_Code_Allowed): New procedure to be called...
authorBob Duff <duff@adacore.com>
Thu, 13 Dec 2007 10:28:48 +0000 (11:28 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 13 Dec 2007 10:28:48 +0000 (11:28 +0100)
2007-12-06  Bob Duff  <duff@adacore.com>

* restrict.ads, restrict.adb (Check_Implicit_Dynamic_Code_Allowed): New
procedure to be called from the back end to check the
No_Implicit_Dynamic_Code restriction.

From-SVN: r130847

gcc/ada/restrict.adb
gcc/ada/restrict.ads

index ac1d254f85ea34e6e75075074b024c64b192c482..85134080835d03ce03408e908dbadea1c3313310 100644 (file)
@@ -101,19 +101,18 @@ package body Restrict is
 
    procedure Check_Elaboration_Code_Allowed (N : Node_Id) is
    begin
-      --  Avoid calling Namet.Unlock/Lock except when there is an error.
-      --  Even in the error case it is a bit dubious, either gigi needs
-      --  the table locked or it does not! ???
-
-      if Restrictions.Set (No_Elaboration_Code)
-        and then not Suppress_Restriction_Message (N)
-      then
-         Namet.Unlock;
-         Check_Restriction (No_Elaboration_Code, N);
-         Namet.Lock;
-      end if;
+      Check_Restriction (No_Elaboration_Code, N);
    end Check_Elaboration_Code_Allowed;
 
+   -----------------------------------------
+   -- Check_Implicit_Dynamic_Code_Allowed --
+   -----------------------------------------
+
+   procedure Check_Implicit_Dynamic_Code_Allowed (N : Node_Id) is
+   begin
+      Check_Restriction (No_Implicit_Dynamic_Code, N);
+   end Check_Implicit_Dynamic_Code_Allowed;
+
    ----------------------------------
    -- Check_No_Implicit_Heap_Alloc --
    ----------------------------------
index 11e7075685d20e3212ea47d87dc4412a92e681d4..e82449e593305d13108213e0a691a7e4549b6a8f 100644 (file)
@@ -207,6 +207,13 @@ package Restrict is
    --  an elaboration routine. If elaboration code is not allowed, an error
    --  message is posted on the node given as argument.
 
+   procedure Check_Implicit_Dynamic_Code_Allowed (N : Node_Id);
+   --  Tests to see if dynamic code generation (dynamically generated
+   --  trampolines, in particular) is allowed by the current restrictions
+   --  settings. This function is called by Gigi when it needs to generate code
+   --  that generates a trampoline. If not allowed, an error message is posted
+   --  on the node given as argument.
+
    procedure Check_No_Implicit_Heap_Alloc (N : Node_Id);
    --  Equivalent to Check_Restriction (No_Implicit_Heap_Allocations, N).
    --  Provided for easy use by back end, which has to check this restriction.