with Einfo.Utils; use Einfo.Utils;
with Elists; use Elists;
with Errout; use Errout;
-with Expander; use Expander;
with Exp_Ch6; use Exp_Ch6;
with Exp_Ch7; use Exp_Ch7;
with Exp_Tss; use Exp_Tss;
procedure Build_Body_To_Inline (N : Node_Id; Spec_Id : Entity_Id) is
Decl : constant Node_Id := Unit_Declaration_Node (Spec_Id);
- Analysis_Status : constant Boolean := Full_Analysis;
Original_Body : Node_Id;
Body_To_Analyze : Node_Id;
Max_Size : constant := 10;
Append (Body_To_Analyze, Declarations (N));
end if;
- -- The body to inline is preanalyzed. In GNATprove mode we must disable
- -- full analysis as well so that light expansion does not take place
- -- either, and name resolution is unaffected.
-
- Expander_Mode_Save_And_Set (False);
- Full_Analysis := False;
+ Start_Generic;
Analyze (Body_To_Analyze);
Push_Scope (Defining_Entity (Body_To_Analyze));
End_Scope;
Remove (Body_To_Analyze);
- Expander_Mode_Restore;
- Full_Analysis := Analysis_Status;
+ End_Generic;
-- Restore environment if previously saved
and then Chars (Spec_Id) = Name_uParent
and then Chars (Scope (Spec_Id)) = Name_uPostconditions
then
- -- This situation occurs only when preanalyzing the inlined body
+ -- This situation occurs only when analyzing the body-to-inline
- pragma Assert (not Full_Analysis);
+ pragma Assert (Inside_A_Generic);
Spec_Id := Scope (Spec_Id);
pragma Assert (Is_Inlined (Spec_Id));