diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-19 11:02:48 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-19 11:02:48 +0000 |
commit | 757d44b946bf023f0ef0dbf9eb49a743c8d482e3 (patch) | |
tree | c5da7428ceb37eac13e1c97e08e78fc4ac813549 /gcc/ada/exp_ch4.adb | |
parent | 2ba655a7cdb7a68acb4377e360a6e8fb88caee50 (diff) | |
download | gcc-757d44b946bf023f0ef0dbf9eb49a743c8d482e3.tar.gz |
2014-02-19 Robert Dewar <dewar@adacore.com>
* exp_attr.adb (Expand_Min_Max_Attribute): Use Insert_Declaration
(Expand_Min_Max_Attribute): Use Matching_Standard_Type.
* exp_ch4.adb (Expand_N_Expression_With_Actions): Remove special
handling for the case of Modify_Tree_For_C, this approach did
not work.
* exp_util.adb (Matching_Standard_Type): New function
(Side_Effect_Free): New top level functions (from
Remove_Side_Effects).
* exp_util.ads (Side_Effect_Free): New top level functions
(moved from body).
* sinfo.ads: Minor comment updates.
2014-02-19 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Simple_Function_Return): If return
type is unconstrained and uses the secondary stack, mark the
enclosing function accordingly, to ensure that the value is not
prematurely removed.
2014-02-19 Hristian Kirtchev <kirtchev@adacore.com>
* par.adb Alphabetize the routines in Par.Sync.
(Resync_Past_Malformed_Aspect): New routine.
* par-ch13.adb (Get_Aspect_Specifications): Alphabetize local
variables. Code and comment reformatting. Detect missing
parentheses on aspects [Refined_]Global and [Refined_]Depends
with a non-null definition.
* par-sync.adb: Alphabetize all routines in this separate unit.
(Resync_Past_Malformed_Aspect): New routine.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index b9ff98c8886..512ebd838a4 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5067,14 +5067,6 @@ package body Exp_Ch4 is -------------------------------------- procedure Expand_N_Expression_With_Actions (N : Node_Id) is - procedure Insert_Declaration (Decl : Node_Id); - -- This is like Insert_Action, but inserts outside the expression in - -- which N appears. This is needed, because otherwise we can end up - -- inserting a declaration in the actions of a short circuit, and that - -- will not do, because that's likely where we (the expression with - -- actions) node came from the first place. We are only inserting a - -- declaration with no side effects, so it is harmless (and needed) - -- to insert at a higher point in the tree. function Process_Action (Act : Node_Id) return Traverse_Result; -- Inspect and process a single action of an expression_with_actions for @@ -5082,27 +5074,6 @@ package body Exp_Ch4 is -- generates code to clean them up when the context of the expression is -- evaluated or elaborated. - ------------------------ - -- Insert_Declaration -- - ------------------------ - - procedure Insert_Declaration (Decl : Node_Id) is - P : Node_Id; - - begin - -- Climb out of the current expression - - P := Decl; - loop - exit when Nkind (Parent (P)) not in N_Subexpr; - P := Parent (P); - end loop; - - -- Now do the insertion - - Insert_Action (P, Decl); - end Insert_Declaration; - -------------------- -- Process_Action -- -------------------- @@ -5135,11 +5106,7 @@ package body Exp_Ch4 is -- Local variables - Loc : Source_Ptr; Act : Node_Id; - Def : Entity_Id; - Exp : Node_Id; - Nxt : Node_Id; -- Start of processing for Expand_N_Expression_With_Actions @@ -5152,48 +5119,6 @@ package body Exp_Ch4 is Next (Act); end loop; - -- In Modify_Tree_For_C, we have trouble in C with object declarations - -- in the actions list (expressions are fine). So if we have an object - -- declaration, insert it higher in the tree, if necessary replacing it - -- with an assignment to capture initialization. - - if Modify_Tree_For_C then - Act := First (Actions (N)); - while Present (Act) loop - if Nkind (Act) = N_Object_Declaration then - Def := Defining_Identifier (Act); - Exp := Expression (Act); - Set_Constant_Present (Act, False); - Set_Expression (Act, Empty); - Insert_Declaration (Relocate_Node (Act)); - - Loc := Sloc (Act); - - -- Expression present, rewrite as assignment, get next action - - if Present (Exp) then - Rewrite (Act, - Make_Assignment_Statement (Loc, - Name => New_Occurrence_Of (Def, Loc), - Expression => Exp)); - Next (Act); - - -- No expression, remove action and move to next - - else - Nxt := Next (Act); - Remove (Act); - Act := Nxt; - end if; - - -- Not an object declaration, move to next action - - else - Next (Act); - end if; - end loop; - end if; - -- Deal with case where there are no actions. In this case we simply -- rewrite the node with its expression since we don't need the actions -- and the specification of this node does not allow a null action list. |