[gcc/devel/c++-coroutines] [Ada] Remove obsolete code in Resolve_Call

Iain D Sandoe iains@gcc.gnu.org
Wed Jun 10 23:26:42 GMT 2020


https://gcc.gnu.org/g:e156631a27d599f118ef2d384c6974172cd0c74d

commit e156631a27d599f118ef2d384c6974172cd0c74d
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Mon Mar 9 10:14:53 2020 +0100

    [Ada] Remove obsolete code in Resolve_Call
    
    2020-06-10  Eric Botcazou  <ebotcazou@adacore.com>
    
    gcc/ada/
    
            * sem_ch4.adb (Analyze_Call): Use idiomatic condition.
            * sem_res.adb (Resolve_Call): Remove obsolete code.

Diff:
---
 gcc/ada/sem_ch4.adb |  3 +--
 gcc/ada/sem_res.adb | 20 --------------------
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 4ff08a523fb..3d3e2c7c122 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -1176,8 +1176,7 @@ package body Sem_Ch4 is
          --  type is an array, F (X) cannot be interpreted as an indirect call
          --  through the result of the call to F.
 
-         elsif Is_Access_Type (Etype (Nam))
-           and then Ekind (Designated_Type (Etype (Nam))) = E_Subprogram_Type
+         elsif Is_Access_Subprogram_Type (Base_Type (Etype (Nam)))
            and then
              (not Name_Denotes_Function
                or else Nkind (N) = N_Procedure_Call_Statement
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 6b4e2517cc3..d17231102a1 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6141,26 +6141,6 @@ package body Sem_Res is
          end loop;
       end if;
 
-      if Is_Access_Subprogram_Type (Base_Type (Etype (Nam)))
-        and then not Is_Access_Subprogram_Type (Base_Type (Typ))
-        and then Nkind (Subp) /= N_Explicit_Dereference
-        and then Present (Parameter_Associations (N))
-      then
-         --  The prefix is a parameterless function call that returns an access
-         --  to subprogram. If parameters are present in the current call, add
-         --  add an explicit dereference. We use the base type here because
-         --  within an instance these may be subtypes.
-
-         --  The dereference is added either in Analyze_Call or here. Should
-         --  be consolidated ???
-
-         Set_Is_Overloaded (Subp, False);
-         Set_Etype (Subp, Etype (Nam));
-         Insert_Explicit_Dereference (Subp);
-         Nam := Designated_Type (Etype (Nam));
-         Resolve (Subp, Nam);
-      end if;
-
       --  Check that a call to Current_Task does not occur in an entry body
 
       if Is_RTE (Nam, RE_Current_Task) then


More information about the Gcc-cvs mailing list