diff options
Diffstat (limited to 'gcc/ada/exp_cg.adb')
-rw-r--r-- | gcc/ada/exp_cg.adb | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb index 122a40f..116dc64 100644 --- a/gcc/ada/exp_cg.adb +++ b/gcc/ada/exp_cg.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2010-2020, Free Software Foundation, Inc. -- +-- Copyright (C) 2010-2021, 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- -- @@ -23,25 +23,29 @@ -- -- ------------------------------------------------------------------------------ -with Atree; use Atree; -with Einfo; use Einfo; -with Elists; use Elists; -with Exp_Dbug; use Exp_Dbug; -with Exp_Tss; use Exp_Tss; -with Lib; use Lib; -with Namet; use Namet; -with Opt; use Opt; -with Output; use Output; -with Sem_Aux; use Sem_Aux; -with Sem_Disp; use Sem_Disp; -with Sem_Type; use Sem_Type; -with Sem_Util; use Sem_Util; -with Sinfo; use Sinfo; -with Sinput; use Sinput; -with Snames; use Snames; -with System; use System; +with Atree; use Atree; +with Einfo; use Einfo; +with Einfo.Entities; use Einfo.Entities; +with Einfo.Utils; use Einfo.Utils; +with Elists; use Elists; +with Exp_Dbug; use Exp_Dbug; +with Exp_Tss; use Exp_Tss; +with Lib; use Lib; +with Namet; use Namet; +with Opt; use Opt; +with Output; use Output; +with Sem_Aux; use Sem_Aux; +with Sem_Disp; use Sem_Disp; +with Sem_Type; use Sem_Type; +with Sem_Util; use Sem_Util; +with Sinfo; use Sinfo; +with Sinfo.Nodes; use Sinfo.Nodes; +with Sinfo.Utils; use Sinfo.Utils; +with Sinput; use Sinput; +with Snames; use Snames; +with System; use System; with Table; -with Uintp; use Uintp; +with Uintp; use Uintp; package body Exp_CG is @@ -376,7 +380,14 @@ package body Exp_CG is and then Nkind (Parent (Par)) /= N_Compilation_Unit loop Par := Parent (Par); - pragma Assert (Present (Par)); + + -- Par can legitimately be empty inside a class-wide + -- precondition; the "real" call will be found inside the + -- generated pragma. + + if No (Par) then + return; + end if; end loop; Set_Parent (Copy, Par); @@ -429,7 +440,7 @@ package body Exp_CG is procedure Write_Call_Info (Call : Node_Id) is Ctrl_Arg : constant Node_Id := Controlling_Argument (Call); Ctrl_Typ : constant Entity_Id := Base_Type (Etype (Ctrl_Arg)); - Prim : constant Entity_Id := Entity (Sinfo.Name (Call)); + Prim : constant Entity_Id := Entity (Sinfo.Nodes.Name (Call)); P : constant Node_Id := Parent (Call); begin @@ -559,13 +570,13 @@ package body Exp_CG is Write_Char ('"'); Write_Name (Chars (Parent_Typ)); - -- Note: Einfo prefix not needed if this routine is moved to + -- Note: Einfo.Entities prefix not needed if this routine is moved to -- exp_disp??? - if Present (Einfo.Interfaces (Typ)) - and then not Is_Empty_Elmt_List (Einfo.Interfaces (Typ)) + if Present (Einfo.Entities.Interfaces (Typ)) + and then not Is_Empty_Elmt_List (Einfo.Entities.Interfaces (Typ)) then - Elmt := First_Elmt (Einfo.Interfaces (Typ)); + Elmt := First_Elmt (Einfo.Entities.Interfaces (Typ)); while Present (Elmt) loop Write_Str (", "); Write_Name (Chars (Node (Elmt))); |