aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-09-10 11:18:47 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-25 15:07:19 +0000
commit19e7eae5b917d782d20d59f3cbe3c344a06aafb7 (patch)
tree9ce172ecdff263011b199d8930143ca5fb481a51 /gcc/ada/sem_ch5.adb
parentbb20000c9f7fbe58e6630196dbfdf0a2ac440c34 (diff)
downloadgcc-19e7eae5b917d782d20d59f3cbe3c344a06aafb7.zip
gcc-19e7eae5b917d782d20d59f3cbe3c344a06aafb7.tar.gz
gcc-19e7eae5b917d782d20d59f3cbe3c344a06aafb7.tar.bz2
[Ada] Renamed_Or_Alias cleanup
gcc/ada/ * einfo-utils.ads, einfo-utils.adb (Alias, Set_Alias, Renamed_Entity, Set_Renamed_Entity, Renamed_Object, Set_Renamed_Object): Add assertions that reflect how these are supposed to be used and what they are supposed to return. (Renamed_Entity_Or_Object): New getter. (Set_Renamed_Object_Of_Possibly_Void): Setter that allows N to be E_Void. * checks.adb (Ensure_Valid): Use Renamed_Entity_Or_Object because this is called for both cases. * exp_dbug.adb (Debug_Renaming_Declaration): Use Renamed_Entity_Or_Object because this is called for both cases. Add assertions. * exp_util.adb (Possible_Bit_Aligned_Component): Likewise. * freeze.adb (Freeze_All_Ent): Likewise. * sem_ch5.adb (Within_Function): Likewise. * exp_attr.adb (Calculate_Header_Size): Call Renamed_Entity instead of Renamed_Object. * exp_ch11.adb (Expand_N_Raise_Statement): Likewise. * repinfo.adb (Find_Declaration): Likewise. * sem_ch10.adb (Same_Unit, Process_Spec_Clauses, Analyze_With_Clause, Install_Parents): Likewise. * sem_ch12.adb (Build_Local_Package, Needs_Body_Instantiated, Build_Subprogram_Renaming, Check_Formal_Package_Instance, Check_Generic_Actuals, In_Enclosing_Instance, Denotes_Formal_Package, Process_Nested_Formal, Check_Initialized_Types, Map_Formal_Package_Entities, Restore_Nested_Formal): Likewise. * sem_ch6.adb (Report_Conflict): Likewise. * sem_ch8.adb (Analyze_Exception_Renaming, Analyze_Generic_Renaming, Analyze_Package_Renaming, Is_Primitive_Operator_In_Use, Declared_In_Actual, Note_Redundant_Use): Likewise. * sem_warn.adb (Find_Package_Renaming): Likewise. * sem_elab.adb (Ultimate_Variable): Call Renamed_Object instead of Renamed_Entity. * exp_ch6.adb (Get_Function_Id): Call Set_Renamed_Object_Of_Possibly_Void, because the defining identifer is still E_Void at this point. * sem_util.adb (Function_Call_Or_Allocator_Level): Likewise. Remove redundant (unreachable) code. (Is_Object_Renaming, Is_Valid_Renaming): Call Renamed_Object instead of Renamed_Entity. (Get_Fullest_View): Call Renamed_Entity instead of Renamed_Object. (Copy_Node_With_Replacement): Call Set_Renamed_Object_Of_Possibly_Void because the defining entity is sometimes E_Void. * exp_ch5.adb (Expand_N_Assignment_Statement): Protect a call to Renamed_Object with Is_Object to avoid assertion failure. * einfo.ads: Minor comment fixes. * inline.adb: Minor comment fixes. * tbuild.ads: Minor comment fixes.
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 45d2457..e62161a 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -682,6 +682,7 @@ package body Sem_Ch5 is
Ent := Lhs;
while Nkind (Ent) in N_Has_Entity
and then Present (Entity (Ent))
+ and then Is_Object (Entity (Ent))
and then Present (Renamed_Object (Entity (Ent)))
loop
Ent := Renamed_Object (Entity (Ent));