Subp : Entity_Id;
Orig_Subp : Entity_Id)
is
- Loc : constant Source_Ptr := Sloc (N);
- Is_Predef : constant Boolean :=
- Is_Predefined_Unit (Get_Source_Unit (Subp));
- Orig_Bod : constant Node_Id :=
+ Decls : constant List_Id := New_List;
+ Is_Predef : constant Boolean :=
+ Is_Predefined_Unit (Get_Source_Unit (Subp));
+ Loc : constant Source_Ptr := Sloc (N);
+ Orig_Bod : constant Node_Id :=
Body_To_Inline (Unit_Declaration_Node (Subp));
+
Uses_Back_End : constant Boolean :=
- Back_End_Inlining and then Optimization_Level > 0;
+ Back_End_Inlining and then Optimization_Level > 0;
-- The back-end expansion is used if the target supports back-end
-- inlining and some level of optimixation is required; otherwise
-- the inlining takes place fully as a tree expansion.
Blk : Node_Id;
Decl : Node_Id;
- Decls : constant List_Id := New_List;
- Exit_Lab : Entity_Id := Empty;
+ Exit_Lab : Entity_Id := Empty;
F : Entity_Id;
A : Node_Id;
- Lab_Decl : Node_Id := Empty;
+ Lab_Decl : Node_Id := Empty;
Lab_Id : Node_Id;
New_A : Node_Id;
- Num_Ret : Nat := 0;
+ Num_Ret : Nat := 0;
Ret_Type : Entity_Id;
+ Temp : Entity_Id;
+ Temp_Typ : Entity_Id;
+
+ Is_Unc : Boolean;
+ Is_Unc_Decl : Boolean;
+ -- If the type returned by the function is unconstrained and the call
+ -- can be inlined, special processing is required.
+
+ Return_Object : Entity_Id := Empty;
+ -- Entity in declaration in an extended_return_statement
Targ : Node_Id := Empty;
-- The target of the call. If context is an assignment statement then
Targ1 : Node_Id := Empty;
-- A separate target used when the return type is unconstrained
- Temp : Entity_Id;
- Temp_Typ : Entity_Id;
-
- Return_Object : Entity_Id := Empty;
- -- Entity in declaration in an extended_return_statement
-
- Is_Unc : Boolean;
- Is_Unc_Decl : Boolean;
- -- If the type returned by the function is unconstrained and the call
- -- can be inlined, special processing is required.
-
procedure Declare_Postconditions_Result;
-- When generating C code, declare _Result, which may be used in the
-- inlined _Postconditions procedure to verify the return value.
begin
First_Decl := First (Declarations (Blk));
- -- If the body is a single extended return statement,
- -- the resulting block is a nested block.
+ -- If the body is a single extended return statement,the
+ -- resulting block is a nested block.
if No (First_Decl) then
- First_Decl := First
- (Statements (Handled_Statement_Sequence (Blk)));
+ First_Decl :=
+ First (Statements (Handled_Statement_Sequence (Blk)));
if Nkind (First_Decl) = N_Block_Statement then
First_Decl := First (Declarations (First_Decl));
end if;
end if;
+ -- No front-end inlining possible
+
if Nkind (First_Decl) /= N_Object_Declaration then
- return; -- No front-end inlining possible,
+ return;
end if;
if Nkind (Parent (N)) /= N_Assignment_Statement then
-- Search for the equality primitive; return Empty if the primitive is
-- not found.
+ ------------------
+ -- Find_Eq_Prim --
+ ------------------
+
function Find_Eq_Prim (Prims_List : Elist_Id) return Entity_Id is
- Prim_E : Elmt_Id := First_Elmt (Prims_List);
- Prim : Entity_Id;
+ Prim : Entity_Id;
+ Prim_Elmt : Elmt_Id;
begin
- while Present (Prim_E) loop
- Prim := Node (Prim_E);
+ Prim_Elmt := First_Elmt (Prims_List);
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
-- Locate primitive equality with the right signature
return Prim;
end if;
- Next_Elmt (Prim_E);
+ Next_Elmt (Prim_Elmt);
end loop;
return Empty;
-- Local Variables
- Full_Type : Entity_Id;
Eq_Prim : Entity_Id;
+ Full_Type : Entity_Id;
-- Start of processing for Find_Primitive_Eq
begin
-- No marker needs to be created when switch -gnatH (legacy elaboration
-- checking mode enabled) is in effect because the legacy ABE mechanism
- -- does use markers.
+ -- does not use markers.
if Legacy_Elaboration_Checks then
return False;