diff options
author | Ed Schonberg <schonberg@adacore.com> | 2013-04-23 09:58:23 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-23 11:58:23 +0200 |
commit | 0fbcb11c6251ed09ef715f9552e27321059cef35 (patch) | |
tree | 6a1ea022beb7e6eb04a80af7cd17a8d04eec02c7 /gcc/ada/sem_aux.adb | |
parent | 20a65dcba9a95dd40a8794324e833d5ff9f07544 (diff) | |
download | gcc-0fbcb11c6251ed09ef715f9552e27321059cef35.zip gcc-0fbcb11c6251ed09ef715f9552e27321059cef35.tar.gz gcc-0fbcb11c6251ed09ef715f9552e27321059cef35.tar.bz2 |
sem_aux.adb [...] (Effectively_has_Constrained_Partial_View): Rename subprogram as Object_Type_Has_Constrained_Partial_View...
2013-04-23 Ed Schonberg <schonberg@adacore.com>
* sem_aux.adb sem_aux.ads (Effectively_has_Constrained_Partial_View):
Rename subprogram as Object_Type_Has_Constrained_Partial_View, better
description of purpose.
* checks.adb (Apply_Discriminant_Check): Use above renaming.
* sem_ch4.adb (Analyze_Allocator): Check Has_Constrained_Partial_View
of the base type, rather than using the Object_Type predicate.
* sem_attr.adb (Analyze_Attribute, case 'Access): Use above renaming.
* sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): ditto.
* exp_attr.adb (Expand_N_Attribute_Reference, case 'Constrained): Ditto.
* exp_ch4.adb (Expand_N_Allocator): Ditto.
From-SVN: r198188
Diffstat (limited to 'gcc/ada/sem_aux.adb')
-rw-r--r-- | gcc/ada/sem_aux.adb | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index 556156a..23b8f59 100644 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -151,25 +151,6 @@ package body Sem_Aux is end if; end Constant_Value; - ---------------------------------------------- - -- Effectively_Has_Constrained_Partial_View -- - ---------------------------------------------- - - function Effectively_Has_Constrained_Partial_View - (Typ : Entity_Id; - Scop : Entity_Id) return Boolean - is - begin - return Has_Constrained_Partial_View (Typ) - or else (In_Generic_Body (Scop) - and then Is_Generic_Type (Base_Type (Typ)) - and then Is_Private_Type (Base_Type (Typ)) - and then not Is_Tagged_Type (Typ) - and then not (Is_Array_Type (Typ) - and then not Is_Constrained (Typ)) - and then Has_Discriminants (Typ)); - end Effectively_Has_Constrained_Partial_View; - ----------------------------- -- Enclosing_Dynamic_Scope -- ----------------------------- @@ -630,25 +611,6 @@ package body Sem_Aux is return Present (Get_Rep_Pragma (E, Nam1, Nam2, Check_Parents)); end Has_Rep_Pragma; - ------------------------------- - -- Initialization_Suppressed -- - ------------------------------- - - function Initialization_Suppressed (Typ : Entity_Id) return Boolean is - begin - return Suppress_Initialization (Typ) - or else Suppress_Initialization (Base_Type (Typ)); - end Initialization_Suppressed; - - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize is - begin - Obsolescent_Warnings.Init; - end Initialize; - --------------------- -- In_Generic_Body -- --------------------- @@ -686,6 +648,25 @@ package body Sem_Aux is return False; end In_Generic_Body; + ------------------------------- + -- Initialization_Suppressed -- + ------------------------------- + + function Initialization_Suppressed (Typ : Entity_Id) return Boolean is + begin + return Suppress_Initialization (Typ) + or else Suppress_Initialization (Base_Type (Typ)); + end Initialization_Suppressed; + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize is + begin + Obsolescent_Warnings.Init; + end Initialize; + --------------------- -- Is_By_Copy_Type -- --------------------- @@ -828,38 +809,6 @@ package body Sem_Aux is end if; end Is_Generic_Formal; - --------------------------- - -- Is_Indefinite_Subtype -- - --------------------------- - - function Is_Indefinite_Subtype (Ent : Entity_Id) return Boolean is - K : constant Entity_Kind := Ekind (Ent); - - begin - if Is_Constrained (Ent) then - return False; - - elsif K in Array_Kind - or else K in Class_Wide_Kind - or else Has_Unknown_Discriminants (Ent) - then - return True; - - -- Known discriminants: indefinite if there are no default values - - elsif K in Record_Kind - or else Is_Incomplete_Or_Private_Type (Ent) - or else Is_Concurrent_Type (Ent) - then - return (Has_Discriminants (Ent) - and then - No (Discriminant_Default_Value (First_Discriminant (Ent)))); - - else - return False; - end if; - end Is_Indefinite_Subtype; - ------------------------------- -- Is_Immutably_Limited_Type -- ------------------------------- @@ -959,6 +908,38 @@ package body Sem_Aux is end if; end Is_Immutably_Limited_Type; + --------------------------- + -- Is_Indefinite_Subtype -- + --------------------------- + + function Is_Indefinite_Subtype (Ent : Entity_Id) return Boolean is + K : constant Entity_Kind := Ekind (Ent); + + begin + if Is_Constrained (Ent) then + return False; + + elsif K in Array_Kind + or else K in Class_Wide_Kind + or else Has_Unknown_Discriminants (Ent) + then + return True; + + -- Known discriminants: indefinite if there are no default values + + elsif K in Record_Kind + or else Is_Incomplete_Or_Private_Type (Ent) + or else Is_Concurrent_Type (Ent) + then + return (Has_Discriminants (Ent) + and then + No (Discriminant_Default_Value (First_Discriminant (Ent)))); + + else + return False; + end if; + end Is_Indefinite_Subtype; + --------------------- -- Is_Limited_Type -- --------------------- @@ -1147,6 +1128,25 @@ package body Sem_Aux is return N; end Number_Discriminants; + ---------------------------------------------- + -- Object_Type_Has_Constrained_Partial_View -- + ---------------------------------------------- + + function Object_Type_Has_Constrained_Partial_View + (Typ : Entity_Id; + Scop : Entity_Id) return Boolean + is + begin + return Has_Constrained_Partial_View (Typ) + or else (In_Generic_Body (Scop) + and then Is_Generic_Type (Base_Type (Typ)) + and then Is_Private_Type (Base_Type (Typ)) + and then not Is_Tagged_Type (Typ) + and then not (Is_Array_Type (Typ) + and then not Is_Constrained (Typ)) + and then Has_Discriminants (Typ)); + end Object_Type_Has_Constrained_Partial_View; + --------------- -- Tree_Read -- --------------- |