diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-31 16:39:17 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-31 16:39:17 +0100 |
commit | a54ffd6cb9056b98ec4f188122b370e29ddd30d0 (patch) | |
tree | cf41dba58aade03b495fc9aee9e400ce1e93476c /gcc/ada/sem_util.adb | |
parent | 408249b2e2bc8ddc31d9041c31c3782392b54c3f (diff) | |
download | gcc-a54ffd6cb9056b98ec4f188122b370e29ddd30d0.zip gcc-a54ffd6cb9056b98ec4f188122b370e29ddd30d0.tar.gz gcc-a54ffd6cb9056b98ec4f188122b370e29ddd30d0.tar.bz2 |
[multiple changes]
2014-01-31 Robert Dewar <dewar@adacore.com>
* sem_ch4.adb: Minor reformatting.
2014-01-31 Robert Dewar <dewar@adacore.com>
* exp_ch2.adb: New calling sequence for Is_LHS.
* frontend.adb: Add call to Process_Deferred_References.
* lib-xref.ads, lib-xref.adb (Process_Deferred_References): New.
(Deferred_References): New table.
* sem_ch8.adb (Find_Direct_Name): Make deferred reference table
entries.
(Find_Expanded_Name): Ditto.
* sem_res.adb: New calling sequence for Is_LHS.
* sem_util.ads, sem_util.adb (Is_LHS): New calling sequence.
* sem_warn.adb: Call Process_Deferred_References before issuing
warnings.
2014-01-31 Tristan Gingold <gingold@adacore.com>
* exp_util.adb (Corresponding_Runtime_Package): Restrict the
use of System_Tasking_Protected_Objects_Single_Entry.
* exp_ch9.adb (Build_Simple_Entry_Call): Remove Mode parameter
of Protected_Single_Entry_Call.
(Expand_N_Timed_Entry_Call): Remove single_entry case.
* exp_disp.adb (Make_Disp_Asynchronous_Select_Body): Remove
single_entry case.
(Make_Disp_Timed_Select_Body): Likewise.
* rtsfind.ads (RE_Timed_Protected_Single_Entry_Call): Remove.
* s-tposen.adb (Send_Program_Error, PO_Do_Or_Queue): Remove
Self_Id parameter.
(Wakeup_Entry_Caller): Remove Self_ID and New_State parameters.
(Wait_For_Completion_With_Timeout): Remove.
(Protected_Single_Entry_Call): Remove Mode parameter
(always Simple_Call).
(Service_Entry): Remove Self_Id constant (not used anymore).
(Timed_Protected_Single_Entry_Call): Remove.
* s-tposen.ads (Timed_Protected_Single_Entry_Call): Remove.
(Protected_Single_Entry_Call): Remove Mode parameter.
From-SVN: r207349
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 85c8592..12704a6 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -5587,7 +5587,8 @@ package body Sem_Util is -- we exclude overloaded calls, since we don't know enough to be sure -- of giving the right answer in this case. - if Is_Entity_Name (Name (Call)) + if Nkind_In (Call, N_Function_Call, N_Procedure_Call_Statement) + and then Is_Entity_Name (Name (Call)) and then Present (Entity (Name (Call))) and then Is_Overloadable (Entity (Name (Call))) and then not Is_Overloaded (Name (Call)) @@ -9982,14 +9983,18 @@ package body Sem_Util is -- We seem to have a lot of overlapping functions that do similar things -- (testing for left hand sides or lvalues???). - function Is_LHS (N : Node_Id) return Boolean is + function Is_LHS (N : Node_Id) return Is_LHS_Result is P : constant Node_Id := Parent (N); begin -- Return True if we are the left hand side of an assignment statement if Nkind (P) = N_Assignment_Statement then - return Name (P) = N; + if Name (P) = N then + return Yes; + else + return No; + end if; -- Case of prefix of indexed or selected component or slice @@ -10002,23 +10007,16 @@ package body Sem_Util is -- what we really have is N.all.Q (or N.all(Q .. R)). In either -- case this makes N.all a left hand side but not N itself. - -- Here follows a worrisome kludge. If Etype (N) is not set, which - -- for sure happens in the call from Find_Direct_Name, that means we - -- don't know if N is of an access type, so we can't give an accurate - -- answer. For now, we assume we do not have an access type, which - -- means for example that P.Q.R := X will look like a modification - -- of P, even if P.Q eventually turns out to be an access type. The - -- consequence is at least that in some cases we incorrectly identify - -- a reference as a modification. It is not clear if there are any - -- other bad consequences. ??? + -- If we don't know the type yet, this is the case where we return + -- Unknown, since the answer depends on the type which is unknown. if No (Etype (N)) then - return False; + return Unknown; -- We have an Etype set, so we can check it elsif Is_Access_Type (Etype (N)) then - return False; + return No; -- OK, not access type case, so just test whole expression @@ -10029,7 +10027,7 @@ package body Sem_Util is -- All other cases are not left hand sides else - return False; + return No; end if; end Is_LHS; |