summaryrefslogtreecommitdiffstats
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:25:14 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:25:14 +0000
commit1627db8ae89b209b9ec401dcd567b05cff7481a3 (patch)
treeb4b5336d3c65b39c02da40bc438089f8b825404a /gcc/ada/exp_ch5.adb
parente1fd4acc89d92821923893b446bbed9794678eed (diff)
downloadppe42-gcc-1627db8ae89b209b9ec401dcd567b05cff7481a3.tar.gz
ppe42-gcc-1627db8ae89b209b9ec401dcd567b05cff7481a3.zip
* exp_ch4.adb (Expand_N_Attribute_Reference, Displace_Allocator_Pointer,
Expand_Allocator_Expression): Take into account VM_Target * exp_ch5.adb (Expand_N_Extended_Return_Statement): Do not use secondary stack when VM_Target /= No_VM git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb67
1 files changed, 33 insertions, 34 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 4de10742ca6..d77ec2341fe 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1523,9 +1523,7 @@ package body Exp_Ch5 is
-- Since P is going to be evaluated more than once, any subscripts
-- in P must have their evaluation forced.
- if (Nkind (Lhs) = N_Indexed_Component
- or else
- Nkind (Lhs) = N_Selected_Component)
+ if Nkind_In (Lhs, N_Indexed_Component, N_Selected_Component)
and then Is_Ref_To_Bit_Packed_Array (Prefix (Lhs))
then
declare
@@ -1562,9 +1560,8 @@ package body Exp_Ch5 is
loop
Set_Analyzed (Exp, False);
- if Nkind (Exp) = N_Selected_Component
- or else
- Nkind (Exp) = N_Indexed_Component
+ if Nkind_In
+ (Exp, N_Selected_Component, N_Indexed_Component)
then
Exp := Prefix (Exp);
else
@@ -1958,9 +1955,8 @@ package body Exp_Ch5 is
Actual_Rhs : Node_Id := Rhs;
begin
- while Nkind (Actual_Rhs) = N_Type_Conversion
- or else
- Nkind (Actual_Rhs) = N_Qualified_Expression
+ while Nkind_In (Actual_Rhs, N_Type_Conversion,
+ N_Qualified_Expression)
loop
Actual_Rhs := Expression (Actual_Rhs);
end loop;
@@ -2017,9 +2013,7 @@ package body Exp_Ch5 is
-- Skip this if left hand side is an array or record component
-- and elementary component validity checks are suppressed.
- if (Nkind (Lhs) = N_Selected_Component
- or else
- Nkind (Lhs) = N_Indexed_Component)
+ if Nkind_In (Lhs, N_Selected_Component, N_Indexed_Component)
and then not Validity_Check_Components
then
null;
@@ -2798,24 +2792,29 @@ package body Exp_Ch5 is
SS_Allocator := New_Copy_Tree (Heap_Allocator);
end if;
- Set_Storage_Pool
- (SS_Allocator, RTE (RE_SS_Pool));
- Set_Procedure_To_Call
- (SS_Allocator, RTE (RE_SS_Allocate));
-
- -- The allocator is returned on the secondary stack,
- -- so indicate that the function return, as well as
- -- the block that encloses the allocator, must not
- -- release it. The flags must be set now because the
- -- decision to use the secondary stack is done very
- -- late in the course of expanding the return statement,
- -- past the point where these flags are normally set.
-
- Set_Sec_Stack_Needed_For_Return (Parent_Function);
- Set_Sec_Stack_Needed_For_Return
- (Return_Statement_Entity (N));
- Set_Uses_Sec_Stack (Parent_Function);
- Set_Uses_Sec_Stack (Return_Statement_Entity (N));
+ -- The allocator is returned on the secondary stack. We
+ -- don't do this on VM targets, since the SS is not used.
+
+ if VM_Target = No_VM then
+ Set_Storage_Pool (SS_Allocator, RTE (RE_SS_Pool));
+ Set_Procedure_To_Call
+ (SS_Allocator, RTE (RE_SS_Allocate));
+
+ -- The allocator is returned on the secondary stack,
+ -- so indicate that the function return, as well as
+ -- the block that encloses the allocator, must not
+ -- release it. The flags must be set now because the
+ -- decision to use the secondary stack is done very
+ -- late in the course of expanding the return
+ -- statement, past the point where these flags are
+ -- normally set.
+
+ Set_Sec_Stack_Needed_For_Return (Parent_Function);
+ Set_Sec_Stack_Needed_For_Return
+ (Return_Statement_Entity (N));
+ Set_Uses_Sec_Stack (Parent_Function);
+ Set_Uses_Sec_Stack (Return_Statement_Entity (N));
+ end if;
-- Create an if statement to test the BIP_Alloc_Form
-- formal and initialize the access object to either the
@@ -3842,8 +3841,8 @@ package body Exp_Ch5 is
if Is_Tagged_Type (Utyp)
and then not Is_Class_Wide_Type (Utyp)
- and then (Nkind (Exp) = N_Type_Conversion
- or else Nkind (Exp) = N_Unchecked_Type_Conversion
+ and then (Nkind_In (Exp, N_Type_Conversion,
+ N_Unchecked_Type_Conversion)
or else (Is_Entity_Name (Exp)
and then Ekind (Entity (Exp)) in Formal_Kind))
then
@@ -3918,8 +3917,8 @@ package body Exp_Ch5 is
and then not Scope_Suppress (Accessibility_Check)
and then
(Is_Class_Wide_Type (Etype (Exp))
- or else Nkind (Exp) = N_Type_Conversion
- or else Nkind (Exp) = N_Unchecked_Type_Conversion
+ or else Nkind_In (Exp, N_Type_Conversion,
+ N_Unchecked_Type_Conversion)
or else (Is_Entity_Name (Exp)
and then Ekind (Entity (Exp)) in Formal_Kind)
or else Scope_Depth (Enclosing_Dynamic_Scope (Etype (Exp))) >
OpenPOWER on IntegriCloud