diff options
author | Thomas Quinot <quinot@adacore.com> | 2008-05-20 14:50:52 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-05-20 14:50:52 +0200 |
commit | 4b1c635450494b9aa044f355cb4fb87fcc0841eb (patch) | |
tree | 2d97f29ba15bb1b120dae1b2612fc1ef333715f9 /gcc/ada/sem_dist.adb | |
parent | ff81221b5bd3b8101301e4eaaa15bde8b0553b00 (diff) | |
download | gcc-4b1c635450494b9aa044f355cb4fb87fcc0841eb.zip gcc-4b1c635450494b9aa044f355cb4fb87fcc0841eb.tar.gz gcc-4b1c635450494b9aa044f355cb4fb87fcc0841eb.tar.bz2 |
sem_dist.ads, [...] (Is_RACW_Stub_Type_Operation): New subprogram.
2008-05-20 Thomas Quinot <quinot@adacore.com>
* sem_dist.ads, sem_dist.adb (Is_RACW_Stub_Type_Operation): New
subprogram.
* sem_type.adb
(Add_One_Interp): Ignore any interpretation that is a primitive
operation of an RACW stub type (these primitives are only executed
through dispatching, never through static calls).
(Collect_Interps): When only one interpretation has been found, set N's
Entity and Etype to that interpretation, otherwise Entity and Etype may
still refer to an interpretation that was ignored by Add_One_Interp,
in which case would end up with being marked as not overloaded but with
an Entity attribute not pointing to its (unique) correct interpretation.
From-SVN: r135642
Diffstat (limited to 'gcc/ada/sem_dist.adb')
-rw-r--r-- | gcc/ada/sem_dist.adb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ada/sem_dist.adb b/gcc/ada/sem_dist.adb index 50cf65a..0be68ed 100644 --- a/gcc/ada/sem_dist.adb +++ b/gcc/ada/sem_dist.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, 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- -- @@ -35,6 +35,7 @@ with Namet; use Namet; with Opt; use Opt; with Rtsfind; use Rtsfind; with Sem; use Sem; +with Sem_Disp; use Sem_Disp; with Sem_Eval; use Sem_Eval; with Sem_Res; use Sem_Res; with Sem_Util; use Sem_Util; @@ -268,12 +269,33 @@ package body Sem_Dist is end if; end Is_All_Remote_Call; + --------------------------------- + -- Is_RACW_Stub_Type_Operation -- + --------------------------------- + + function Is_RACW_Stub_Type_Operation (Op : Entity_Id) return Boolean is + Dispatching_Type : Entity_Id; + + begin + case Ekind (Op) is + when E_Function | E_Procedure => + Dispatching_Type := Find_Dispatching_Type (Op); + return Present (Dispatching_Type) + and then Is_RACW_Stub_Type (Dispatching_Type) + and then not Is_Internal (Op); + + when others => + return False; + end case; + end Is_RACW_Stub_Type_Operation; + ------------------------------------ -- Package_Specification_Of_Scope -- ------------------------------------ function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id is N : Node_Id := Parent (E); + begin while Nkind (N) /= N_Package_Specification loop N := Parent (N); |