diff options
Diffstat (limited to 'gcc/ada/exp_ch8.adb')
-rw-r--r-- | gcc/ada/exp_ch8.adb | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb index c1fc7e8..f6f62d7 100644 --- a/gcc/ada/exp_ch8.adb +++ b/gcc/ada/exp_ch8.adb @@ -44,100 +44,6 @@ with Tbuild; use Tbuild; package body Exp_Ch8 is - ------------------- - -- Evaluate_Name -- - ------------------- - - procedure Evaluate_Name (Nam : Node_Id) is - K : constant Node_Kind := Nkind (Nam); - - begin - -- For an explicit dereference, we simply force the evaluation of the - -- name expression. The dereference provides a value that is the address - -- for the renamed object, and it is precisely this value that we want - -- to preserve. - - if K = N_Explicit_Dereference then - Force_Evaluation (Prefix (Nam)); - - -- For a selected component, we simply evaluate the prefix - - elsif K = N_Selected_Component then - Evaluate_Name (Prefix (Nam)); - - -- For an indexed component, or an attribute reference, we evaluate the - -- prefix, which is itself a name, recursively, and then force the - -- evaluation of all the subscripts (or attribute expressions). - - elsif Nkind_In (K, N_Indexed_Component, N_Attribute_Reference) then - Evaluate_Name (Prefix (Nam)); - - declare - E : Node_Id; - - begin - E := First (Expressions (Nam)); - while Present (E) loop - Force_Evaluation (E); - - if Original_Node (E) /= E then - Set_Do_Range_Check (E, Do_Range_Check (Original_Node (E))); - end if; - - Next (E); - end loop; - end; - - -- For a slice, we evaluate the prefix, as for the indexed component - -- case and then, if there is a range present, either directly or as the - -- constraint of a discrete subtype indication, we evaluate the two - -- bounds of this range. - - elsif K = N_Slice then - Evaluate_Name (Prefix (Nam)); - - declare - DR : constant Node_Id := Discrete_Range (Nam); - Constr : Node_Id; - Rexpr : Node_Id; - - begin - if Nkind (DR) = N_Range then - Force_Evaluation (Low_Bound (DR)); - Force_Evaluation (High_Bound (DR)); - - elsif Nkind (DR) = N_Subtype_Indication then - Constr := Constraint (DR); - - if Nkind (Constr) = N_Range_Constraint then - Rexpr := Range_Expression (Constr); - - Force_Evaluation (Low_Bound (Rexpr)); - Force_Evaluation (High_Bound (Rexpr)); - end if; - end if; - end; - - -- For a type conversion, the expression of the conversion must be the - -- name of an object, and we simply need to evaluate this name. - - elsif K = N_Type_Conversion then - Evaluate_Name (Expression (Nam)); - - -- For a function call, we evaluate the call - - elsif K = N_Function_Call then - Force_Evaluation (Nam); - - -- The remaining cases are direct name, operator symbol and character - -- literal. In all these cases, we do nothing, since we want to - -- reevaluate each time the renamed object is used. - - else - return; - end if; - end Evaluate_Name; - --------------------------------------------- -- Expand_N_Exception_Renaming_Declaration -- --------------------------------------------- |