diff options
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index d5c5ce7c595..2ae6418baf7 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -5664,8 +5664,7 @@ package body Sem_Ch12 is (Related_Instance (Instance)))); else Gen_Id := - Generic_Parent - (Specification (Unit_Declaration_Node (Instance))); + Generic_Parent (Package_Specification (Instance)); end if; Parent_Scope := Scope (Gen_Id); @@ -8365,7 +8364,7 @@ package body Sem_Ch12 is -- of its generic parent. if Is_Generic_Instance (Par) then - Gen := Generic_Parent (Specification (Unit_Declaration_Node (Par))); + Gen := Generic_Parent (Package_Specification (Par)); Gen_E := First_Entity (Gen); end if; @@ -8449,8 +8448,7 @@ package body Sem_Ch12 is ------------------ procedure Install_Spec (Par : Entity_Id) is - Spec : constant Node_Id := - Specification (Unit_Declaration_Node (Par)); + Spec : constant Node_Id := Package_Specification (Par); begin -- If this parent of the child instance is a top-level unit, @@ -8519,8 +8517,7 @@ package body Sem_Ch12 is First_Par := Inst_Par; - Gen_Par := - Generic_Parent (Specification (Unit_Declaration_Node (Inst_Par))); + Gen_Par := Generic_Parent (Package_Specification (Inst_Par)); First_Gen := Gen_Par; @@ -8538,9 +8535,7 @@ package body Sem_Ch12 is Inst_Par := Renamed_Entity (Inst_Par); end if; - Gen_Par := - Generic_Parent - (Specification (Unit_Declaration_Node (Inst_Par))); + Gen_Par := Generic_Parent (Package_Specification (Inst_Par)); if Present (Gen_Par) then Prepend_Elmt (Inst_Par, Ancestors); @@ -9009,7 +9004,7 @@ package body Sem_Ch12 is end if; if Nkind (Parent (Actual_Pack)) = N_Defining_Program_Unit_Name then - Parent_Spec := Specification (Unit_Declaration_Node (Actual_Pack)); + Parent_Spec := Package_Specification (Actual_Pack); else Parent_Spec := Parent (Actual_Pack); end if; @@ -12571,8 +12566,7 @@ package body Sem_Ch12 is elsif S = Current_Scope and then Is_Generic_Instance (S) then declare Par : constant Entity_Id := - Generic_Parent - (Specification (Unit_Declaration_Node (S))); + Generic_Parent (Package_Specification (S)); begin if Present (Par) and then P = Scope (Par) |