diff mbox

[Ada] Minor code reorganization, move Is_Generic_Formal

Message ID 20101022094022.GA20507@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Oct. 22, 2010, 9:40 a.m. UTC
Minor code reorganization, move Is_Generic_Formal from Sem_Util
to Sem_Aux. No test needed, no functional effect.

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-10-22  Robert Dewar  <dewar@adacore.com>

	* sem_util.ads, sem_util.adb, sem_aux.ads, sem_aux.adb
	(Is_Generic_Formal): Moved from Sem_Util to Sem_Aux.
diff mbox

Patch

Index: sem_aux.adb
===================================================================
--- sem_aux.adb	(revision 165807)
+++ sem_aux.adb	(working copy)
@@ -537,6 +537,25 @@  package body Sem_Aux is
       end if;
    end Is_Derived_Type;
 
+   -----------------------
+   -- Is_Generic_Formal --
+   -----------------------
+
+   function Is_Generic_Formal (E : Entity_Id) return Boolean is
+      Kind : Node_Kind;
+   begin
+      if No (E) then
+         return False;
+      else
+         Kind := Nkind (Parent (E));
+         return
+           Nkind_In (Kind, N_Formal_Object_Declaration,
+                           N_Formal_Package_Declaration,
+                           N_Formal_Type_Declaration)
+             or else Is_Formal_Subprogram (E);
+      end if;
+   end Is_Generic_Formal;
+
    ---------------------------
    -- Is_Indefinite_Subtype --
    ---------------------------
Index: sem_aux.ads
===================================================================
--- sem_aux.ads	(revision 165807)
+++ sem_aux.ads	(working copy)
@@ -159,6 +159,11 @@  package Sem_Aux is
    --  Determines if the given entity Ent is a derived type. Result is always
    --  false if argument is not a type.
 
+   function Is_Generic_Formal (E : Entity_Id) return Boolean;
+   --  Determine whether E is a generic formal parameter. In particular this is
+   --  used to set the visibility of generic formals of a generic package
+   --  declared with a box or with partial parametrization.
+
    function Is_Indefinite_Subtype (Ent : Entity_Id) return Boolean;
    --  Ent is any entity. Determines if given entity is an unconstrained array
    --  type or subtype, a discriminated record type or subtype with no initial
Index: sem_util.adb
===================================================================
--- sem_util.adb	(revision 165810)
+++ sem_util.adb	(working copy)
@@ -6559,25 +6559,6 @@  package body Sem_Util is
       end if;
    end Is_Fully_Initialized_Variant;
 
-   -----------------------
-   -- Is_Generic_Formal --
-   -----------------------
-
-   function Is_Generic_Formal (E : Entity_Id) return Boolean is
-      Kind : Node_Kind;
-   begin
-      if No (E) then
-         return False;
-      else
-         Kind := Nkind (Parent (E));
-         return
-           Nkind_In (Kind, N_Formal_Object_Declaration,
-                           N_Formal_Package_Declaration,
-                           N_Formal_Type_Declaration)
-             or else Is_Formal_Subprogram (E);
-      end if;
-   end Is_Generic_Formal;
-
    ------------
    -- Is_LHS --
    ------------
Index: sem_util.ads
===================================================================
--- sem_util.ads	(revision 165810)
+++ sem_util.ads	(working copy)
@@ -733,11 +733,6 @@  package Sem_Util is
    --  means that the result returned is not crucial, but should err on the
    --  side of thinking things are fully initialized if it does not know.
 
-   function Is_Generic_Formal (E : Entity_Id) return Boolean;
-   --  Determine whether E is a generic formal parameter. In particular this is
-   --  used to set the visibility of generic formals of a generic package
-   --  declared with a box or with partial parametrization.
-
    function Is_Inherited_Operation (E : Entity_Id) return Boolean;
    --  E is a subprogram. Return True is E is an implicit operation inherited
    --  by a derived type declarations.