aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch8.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-11-07 17:20:14 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2011-11-07 17:20:14 +0100
commitcc570be69335a3d3c36c14eabc99bf0049e7f9be (patch)
tree6788b159094d3e15bb388510e484debf113ebeb7 /gcc/ada/exp_ch8.adb
parentda80a6464e2f41f4e139fcd182fdaa00a024851e (diff)
downloadgcc-cc570be69335a3d3c36c14eabc99bf0049e7f9be.zip
gcc-cc570be69335a3d3c36c14eabc99bf0049e7f9be.tar.gz
gcc-cc570be69335a3d3c36c14eabc99bf0049e7f9be.tar.bz2
[multiple changes]
2011-11-07 Hristian Kirtchev <kirtchev@adacore.com> * exp_alfa.adb: Remove with and use clause for Exp_Ch8. Add with and use clause for Exp_Util. Remove local constant Disable_Processing_Of_Renamings. (Expand_Alfa_N_Object_Renaming_Declaration): The expansion of object renamings has been reenabled. (Expand_Possible_Renaming): The expansion of identifier and expanded names has been reenabled. Perform the substitutions only for entities that denote an object. * exp_ch8.ads, exp_ch8.adb (Evaluate_Name): Moved to Exp_Util. * exp_util.adb (Evaluate_Name): Moved from Exp_Ch8. (Remove_Side_Effects): Alphabetize local variables. Add a guard to avoid the infinite expansion of an expression in Alfa mode. Add processing for function calls in Alfa mode. * exp_util.ads (Evaliate_Name): Moved from Exp_Ch8. 2011-11-07 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_Entity): If the entity is an access to subprogram whose designated type is itself a subprogram type, its own return type must be decorated with size information. From-SVN: r181091
Diffstat (limited to 'gcc/ada/exp_ch8.adb')
-rw-r--r--gcc/ada/exp_ch8.adb94
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 --
---------------------------------------------