aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2017-01-13 09:34:48 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-13 10:34:48 +0100
commitd65a80fd559aca749b54eb6affd71d2d84f410f8 (patch)
tree5dd4560e392930b55539c9078451e000762bf3ea /gcc/ada/sem_ch12.adb
parent3c3b9090f86bef51e5b023616d1cfdcfa39f82b7 (diff)
downloadgcc-d65a80fd559aca749b54eb6affd71d2d84f410f8.zip
gcc-d65a80fd559aca749b54eb6affd71d2d84f410f8.tar.gz
gcc-d65a80fd559aca749b54eb6affd71d2d84f410f8.tar.bz2
atree.adb (Allocate_Initialize_Node): A newly created node is no longer marked as Ghost at this level.
2017-01-13 Hristian Kirtchev <kirtchev@adacore.com> * atree.adb (Allocate_Initialize_Node): A newly created node is no longer marked as Ghost at this level. (Mark_New_Ghost_Node): New routine. (New_Copy): Mark the copy as Ghost. (New_Entity): Mark the entity as Ghost. (New_Node): Mark the node as Ghost. * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now apply to unanalyzed entities. (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed entities. (Set_Is_Checked_Ghost_Entity): This attribute now applies to all entities as well as unanalyzed entities. (Set_Is_Ignored_Ghost_Entity): This attribute now applies to all entities as well as unanalyzed entities. * expander.adb Add with and use clauses for Ghost. (Expand): Install and revert the Ghost region associated with the node being expanded. * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code. (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code. (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code. (Expand_Freeze_Record_Type): Remove all Ghost-related code. (Freeze_Type): Install and revert the Ghost region associated with the type being frozen. * exp_ch5.adb Remove with and use clauses for Ghost. (Expand_N_Assignment_Statement): Remove all Ghost-related code. * exp_ch6.adb Remove with and use clauses for Ghost. (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code. (Expand_N_Subprogram_Body): Remove all Ghost-related code. * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the Ghost region of the working type. (Build_Invariant_Procedure_Declaration): Install and revert the Ghost region of the working type. (Expand_N_Package_Body): Remove all Ghost-related code. * exp_ch8.adb Remove with and use clauses for Ghost. (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related code. (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code. (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code. (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related code. * exp_ch13.adb Remove with and use clauses for Ghost. (Expand_N_Freeze_Entity): Remove all Ghost-related code. * exp_disp.adb (Make_DT): Install and revert the Ghost region of the tagged type. Move the generation of various entities within the Ghost region of the type. * exp_prag.adb Remove with and use clauses for Ghost. (Expand_Pragma_Check): Remove all Ghost-related code. (Expand_Pragma_Contract_Cases): Remove all Ghost-related code. (Expand_Pragma_Initial_Condition): Remove all Ghost-related code. (Expand_Pragma_Loop_Variant): Remove all Ghost-related code. * exp_util.adb (Build_DIC_Procedure_Body): Install and revert the Ghost region of the working types. (Build_DIC_Procedure_Declaration): Install and revert the Ghost region of the working type. (Make_Invariant_Call): Install and revert the Ghost region of the associated type. (Make_Predicate_Call): Reimplemented. Install and revert the Ghost region of the associated type. * freeze.adb (Freeze_Entity): Install and revert the Ghost region of the entity being frozen. (New_Freeze_Node): Removed. * ghost.adb Remove with and use clauses for Opt. (Check_Ghost_Completion): Update the parameter profile and all references to formal parameters. (Ghost_Entity): Update the comment on usage. (Install_Ghost_Mode): New routines. (Is_Ghost_Assignment): New routine. (Is_Ghost_Declaration): New routine. (Is_Ghost_Pragma): New routine. (Is_Ghost_Procedure_Call): New routine. (Is_Ghost_Renaming): Removed. (Is_OK_Declaration): Reimplemented. (Is_OK_Pragma): Reimplemented. (Is_OK_Statement): Reimplemented. (Is_Subject_To_Ghost): Update the comment on usage. (Mark_And_Set_Ghost_Assignment): New routine. (Mark_And_Set_Ghost_Body): New routine. (Mark_And_Set_Ghost_Completion): New routine. (Mark_And_Set_Ghost_Declaration): New routine. (Mark_And_Set_Ghost_Instantiation): New routine. (Mark_And_Set_Ghost_Procedure_Call): New routine. (Mark_Full_View_As_Ghost): Removed. (Mark_Ghost_Declaration_Or_Body): New routine. (Mark_Ghost_Pragma): New routine. (Mark_Ghost_Renaming): New routine. (Mark_Pragma_As_Ghost): Removed. (Mark_Renaming_As_Ghost): Removed. (Propagate_Ignored_Ghost_Code): Update the comment on usage. (Prune_Node): Freeze nodes no longer need special pruning, they are processed by the general ignored Ghost code mechanism. (Restore_Ghost_Mode): New routine. (Set_Ghost_Mode): Reimplemented. (Set_Ghost_Mode_From_Entity): Removed. * ghost.ads Add with and use clauses for Ghost. (Check_Ghost_Completion): Update the parameter profile along with the comment on usage. (Install_Ghost_Mode): New routine. (Is_Ghost_Assignment): New routine. (Is_Ghost_Declaration): New routine. (Is_Ghost_Pragma): New routine. (Is_Ghost_Procedure_Call): New routine. (Mark_And_Set_Ghost_Assignment): New routine. (Mark_And_Set_Ghost_Body): New routine. (Mark_And_Set_Ghost_Completion): New routine. (Mark_And_Set_Ghost_Declaration): New routine. (Mark_And_Set_Ghost_Instantiation): New routine. (Mark_And_Set_Ghost_Procedure_Call): New routine. (Mark_Full_View_As_Ghost): Removed. (Mark_Ghost_Pragma): New routine. (Mark_Ghost_Renaming): New routine. (Mark_Pragma_As_Ghost): Removed. (Mark_Renaming_As_Ghost): Removed. (Restore_Ghost_Mode): New routine. (Set_Ghost_Mode): Redefined. (Set_Ghost_Mode_From_Entity): Removed. * sem.adb (Analyze): Install and revert the Ghost region of the node being analyzed. (Do_Analyze): Change the way a clean Ghost region is installed and reverted. * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove all Ghost-related code. (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code. (Analyze_Number_Declaration): Remove all Ghost-related code. (Analyze_Object_Declaration): Install and revert the Ghost region of a deferred object declaration's completion. (Array_Type_Declaration): Remove all Ghost-related code. (Build_Derived_Type): Update the comment on the propagation of Ghost attributes from a parent to a derived type. (Derive_Subprogram): Remove all Ghost-related code. (Make_Class_Wide_Type): Remove all Ghost-related code. (Make_Implicit_Base): Remove all Ghost-related code. (Process_Full_View): Install and revert the Ghost region of the partial view. There is no longer need to check the Ghost completion here. * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost region of the left hand side. * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove all Ghost-related code. (Analyze_Expression_Function): Remove all Ghost-related code. (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code. (Analyze_Procedure_Call): Install and revert the Ghost region of the procedure being called. (Analyze_Subprogram_Body_Helper): Install and revert the Ghost region of the spec or body. (Analyze_Subprogram_Declaration): Remove all Ghost-related code. (Build_Subprogram_Declaration): Remove all Ghost-related code. (Find_Corresponding_Spec): Remove all Ghost-related code. (Process_Formals): Remove all Ghost-related code. * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert the Ghost region of the spec. (Analyze_Package_Declaration): Remove all Ghost-related code. * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Object_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. * sem_ch11.adb Remove with and use clauses for Ghost. (Analyze_Exception_Declaration): Remove all Ghost-related code. * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all Ghost-related code. (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related code. (Analyze_Package_Instantiation): Install and revert the Ghost region of the package instantiation. (Analyze_Subprogram_Instantiation): Install and revert the Ghost region of the subprogram instantiation. (Instantiate_Package_Body): Code clean up. Install and revert the Ghost region of the package body. (Instantiate_Subprogram_Body): Code clean up. Install and revert the Ghost region of the subprogram body. * sem_ch13.adb (Build_Predicate_Functions): Install and revert the Ghost region of the related type. (Build_Predicate_Function_Declaration): Code clean up. Install and rever the Ghost region of the related type. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Install and revert the Ghost region of the pragma. (Analyze_Initial_Condition_In_Decl_Part): Install and revert the Ghost region of the pragma. (Analyze_Pragma): Install and revert the Ghost region of various pragmas. Mark a pragma as Ghost when it is related to a Ghost entity or encloses a Ghost entity. (Analyze_Pre_Post_Condition): Install and revert the Ghost region of the pragma. (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the Ghost region of the pragma. * sem_res.adb (Resolve): Remove all Ghost-related code. * sem_util.adb (Is_Declaration): Reimplemented. (Is_Declaration_Other_Than_Renaming): New routine. * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine. * sinfo.adb (Is_Checked_Ghost_Pragma): New routine. (Is_Ghost_Pragma): Removed. (Is_Ignored_Ghost_Pragma): New routine. (Set_Is_Checked_Ghost_Pragma): New routine. (Set_Is_Ghost_Pragma): Removed. (Set_Is_Ignored_Ghost_Pragma): New routine. * sinfo.ads: Update the documentation on Ghost mode and Ghost regions. New attributes Is_Checked_Ghost_Pragma and Is_Ignored_Ghost_Pragma along with usages in nodes. Remove attribute Is_Ghost_Pragma along with usages in nodes. (Is_Checked_Ghost_Pragma): New routine along with pragma Inline. (Is_Ghost_Pragma): Removed along with pragma Inline. (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline. (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline. (Set_Is_Ghost_Pragma): Removed along with pragma Inline. (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline. From-SVN: r244395
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb158
1 files changed, 93 insertions, 65 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 603c543..89b5586 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -3331,13 +3331,6 @@ package body Sem_Ch12 is
Set_Ekind (Id, E_Generic_Package);
Set_Etype (Id, Standard_Void_Type);
- -- A generic package declared within a Ghost region is rendered Ghost
- -- (SPARK RM 6.9(2)).
-
- if Ghost_Mode > None then
- Set_Is_Ghost_Entity (Id);
- end if;
-
-- Analyze aspects now, so that generated pragmas appear in the
-- declarations before building and analyzing the generic copy.
@@ -3548,13 +3541,6 @@ package body Sem_Ch12 is
Set_Etype (Id, Standard_Void_Type);
end if;
- -- A generic subprogram declared within a Ghost region is rendered Ghost
- -- (SPARK RM 6.9(2)).
-
- if Ghost_Mode > None then
- Set_Is_Ghost_Entity (Id);
- end if;
-
-- For a library unit, we have reconstructed the entity for the unit,
-- and must reset it in the library tables. We also make sure that
-- Body_Required is set properly in the original compilation unit node.
@@ -3676,6 +3662,8 @@ package body Sem_Ch12 is
-- Local declarations
+ Mode : Ghost_Mode_Type;
+
Vis_Prims_List : Elist_Id := No_Elist;
-- List of primitives made temporarily visible in the instantiation
-- to match the visibility of the formal type
@@ -3746,6 +3734,13 @@ package body Sem_Ch12 is
Check_Generic_Child_Unit (Gen_Id, Parent_Installed);
Gen_Unit := Entity (Gen_Id);
+ -- A package instantiation is Ghost when it is subject to pragma Ghost
+ -- or the generic template is Ghost. Set the mode now to ensure that
+ -- any nodes generated during analysis and expansion are marked as
+ -- Ghost.
+
+ Mark_And_Set_Ghost_Instantiation (N, Gen_Unit, Mode);
+
-- Verify that it is the name of a generic package
-- A visibility glitch: if the instance is a child unit and the generic
@@ -4437,6 +4432,8 @@ package body Sem_Ch12 is
Analyze_Aspect_Specifications (N, Act_Decl_Id);
end if;
+ Restore_Ghost_Mode (Mode);
+
exception
when Instantiation_Error =>
if Parent_Installed then
@@ -4451,6 +4448,8 @@ package body Sem_Ch12 is
SPARK_Mode := Save_SM;
SPARK_Mode_Pragma := Save_SMP;
Style_Check := Save_Style_Check;
+
+ Restore_Ghost_Mode (Mode);
end Analyze_Package_Instantiation;
--------------------------
@@ -5084,6 +5083,8 @@ package body Sem_Ch12 is
-- Local variables
+ Mode : Ghost_Mode_Type;
+
Save_IPSM : constant Boolean := Ignore_Pragma_SPARK_Mode;
-- Save flag Ignore_Pragma_SPARK_Mode for restore on exit
@@ -5126,6 +5127,13 @@ package body Sem_Ch12 is
Check_Generic_Child_Unit (Gen_Id, Parent_Installed);
Gen_Unit := Entity (Gen_Id);
+ -- A subprogram instantiation is Ghost when it is subject to pragma
+ -- Ghost or the generic template is Ghost. Set the mode now to ensure
+ -- that any nodes generated during analysis and expansion are marked as
+ -- Ghost.
+
+ Mark_And_Set_Ghost_Instantiation (N, Gen_Unit, Mode);
+
Generate_Reference (Gen_Unit, Gen_Id);
if Nkind (Gen_Id) = N_Identifier
@@ -5137,7 +5145,7 @@ package body Sem_Ch12 is
if Etype (Gen_Unit) = Any_Type then
Restore_Env;
- return;
+ goto Leave;
end if;
-- Verify that it is a generic subprogram of the right kind, and that
@@ -5322,8 +5330,8 @@ package body Sem_Ch12 is
Error_Msg_NE
("access parameter& is controlling,", N, Formal);
Error_Msg_NE
- ("\corresponding parameter of & must be "
- & "explicitly null-excluding", N, Gen_Id);
+ ("\corresponding parameter of & must be explicitly "
+ & "null-excluding", N, Gen_Id);
end if;
Next_Formal (Formal);
@@ -5386,6 +5394,8 @@ package body Sem_Ch12 is
Analyze_Aspect_Specifications (N, Act_Decl_Id);
end if;
+ Restore_Ghost_Mode (Mode);
+
exception
when Instantiation_Error =>
if Parent_Installed then
@@ -5399,6 +5409,8 @@ package body Sem_Ch12 is
Ignore_Pragma_SPARK_Mode := Save_IPSM;
SPARK_Mode := Save_SM;
SPARK_Mode_Pragma := Save_SMP;
+
+ Restore_Ghost_Mode (Mode);
end Analyze_Subprogram_Instantiation;
-------------------------
@@ -10780,32 +10792,17 @@ package body Sem_Ch12 is
Body_Optional : Boolean := False)
is
Act_Decl : constant Node_Id := Body_Info.Act_Decl;
+ Act_Decl_Id : constant Entity_Id := Defining_Entity (Act_Decl);
+ Act_Spec : constant Node_Id := Specification (Act_Decl);
Inst_Node : constant Node_Id := Body_Info.Inst_Node;
- Loc : constant Source_Ptr := Sloc (Inst_Node);
-
Gen_Id : constant Node_Id := Name (Inst_Node);
Gen_Unit : constant Entity_Id := Get_Generic_Entity (Inst_Node);
Gen_Decl : constant Node_Id := Unit_Declaration_Node (Gen_Unit);
- Act_Spec : constant Node_Id := Specification (Act_Decl);
- Act_Decl_Id : constant Entity_Id := Defining_Entity (Act_Spec);
+ Loc : constant Source_Ptr := Sloc (Inst_Node);
Save_IPSM : constant Boolean := Ignore_Pragma_SPARK_Mode;
Save_Style_Check : constant Boolean := Style_Check;
- Act_Body : Node_Id;
- Act_Body_Id : Entity_Id;
- Act_Body_Name : Node_Id;
- Gen_Body : Node_Id;
- Gen_Body_Id : Node_Id;
- Par_Ent : Entity_Id := Empty;
- Par_Vis : Boolean := False;
-
- Parent_Installed : Boolean := False;
-
- Vis_Prims_List : Elist_Id := No_Elist;
- -- List of primitives made temporarily visible in the instantiation
- -- to match the visibility of the formal type
-
procedure Check_Initialized_Types;
-- In a generic package body, an entity of a generic private type may
-- appear uninitialized. This is suspicious, unless the actual is a
@@ -10874,6 +10871,23 @@ package body Sem_Ch12 is
end loop;
end Check_Initialized_Types;
+ -- Local variables
+
+ Act_Body : Node_Id;
+ Act_Body_Id : Entity_Id;
+ Act_Body_Name : Node_Id;
+ Gen_Body : Node_Id;
+ Gen_Body_Id : Node_Id;
+ Mode : Ghost_Mode_Type;
+ Par_Ent : Entity_Id := Empty;
+ Par_Vis : Boolean := False;
+
+ Parent_Installed : Boolean := False;
+
+ Vis_Prims_List : Elist_Id := No_Elist;
+ -- List of primitives made temporarily visible in the instantiation
+ -- to match the visibility of the formal type.
+
-- Start of processing for Instantiate_Package_Body
begin
@@ -10886,6 +10900,12 @@ package body Sem_Ch12 is
return;
end if;
+ -- The package being instantiated may be subject to pragma Ghost. Set
+ -- the mode now to ensure that any nodes generated during instantiation
+ -- are properly marked as Ghost.
+
+ Set_Ghost_Mode (Act_Decl_Id, Mode);
+
Expander_Mode_Save_And_Set (Body_Info.Expander_Status);
-- Re-establish the state of information on which checks are suppressed.
@@ -10911,7 +10931,7 @@ package body Sem_Ch12 is
if not Unit_Requires_Body (Defining_Entity (Gen_Decl))
and then Body_Optional
then
- return;
+ goto Leave;
else
Load_Parent_Of_Generic
(Inst_Node, Specification (Gen_Decl), Body_Optional);
@@ -11175,6 +11195,9 @@ package body Sem_Ch12 is
end if;
Expander_Mode_Restore;
+
+ <<Leave>>
+ Restore_Ghost_Mode (Mode);
end Instantiate_Package_Body;
---------------------------------
@@ -11186,13 +11209,12 @@ package body Sem_Ch12 is
Body_Optional : Boolean := False)
is
Act_Decl : constant Node_Id := Body_Info.Act_Decl;
+ Act_Decl_Id : constant Entity_Id := Defining_Entity (Act_Decl);
Inst_Node : constant Node_Id := Body_Info.Inst_Node;
- Loc : constant Source_Ptr := Sloc (Inst_Node);
Gen_Id : constant Node_Id := Name (Inst_Node);
Gen_Unit : constant Entity_Id := Get_Generic_Entity (Inst_Node);
Gen_Decl : constant Node_Id := Unit_Declaration_Node (Gen_Unit);
- Act_Decl_Id : constant Entity_Id :=
- Defining_Unit_Name (Specification (Act_Decl));
+ Loc : constant Source_Ptr := Sloc (Inst_Node);
Pack_Id : constant Entity_Id :=
Defining_Unit_Name (Parent (Act_Decl));
@@ -11204,6 +11226,7 @@ package body Sem_Ch12 is
Act_Body_Id : Entity_Id;
Gen_Body : Node_Id;
Gen_Body_Id : Node_Id;
+ Mode : Ghost_Mode_Type;
Pack_Body : Node_Id;
Par_Ent : Entity_Id := Empty;
Par_Vis : Boolean := False;
@@ -11222,6 +11245,12 @@ package body Sem_Ch12 is
return;
end if;
+ -- The subprogram being instantiated may be subject to pragma Ghost. Set
+ -- the mode now to ensure that any nodes generated during instantiation
+ -- are properly marked as Ghost.
+
+ Set_Ghost_Mode (Act_Decl_Id, Mode);
+
Expander_Mode_Save_And_Set (Body_Info.Expander_Status);
-- Re-establish the state of information on which checks are suppressed.
@@ -11248,7 +11277,7 @@ package body Sem_Ch12 is
Set_Interface_Name (Act_Decl_Id, Interface_Name (Gen_Unit));
Set_Convention (Act_Decl_Id, Convention (Gen_Unit));
Set_Has_Completion (Act_Decl_Id);
- return;
+ goto Leave;
-- For other cases, compile the body
@@ -11273,12 +11302,11 @@ package body Sem_Ch12 is
if Expander_Active
and then Operating_Mode = Generate_Code
then
- Error_Msg_N
- ("missing proper body for instantiation", Gen_Body);
+ Error_Msg_N ("missing proper body for instantiation", Gen_Body);
end if;
Set_Has_Completion (Act_Decl_Id);
- return;
+ goto Leave;
end if;
Save_Env (Gen_Unit, Act_Decl_Id);
@@ -11410,27 +11438,25 @@ package body Sem_Ch12 is
and then Nkind (Parent (Inst_Node)) /= N_Compilation_Unit
then
if Body_Optional then
- return;
+ goto Leave;
elsif Ekind (Act_Decl_Id) = E_Procedure then
Act_Body :=
Make_Subprogram_Body (Loc,
- Specification =>
- Make_Procedure_Specification (Loc,
- Defining_Unit_Name =>
- Make_Defining_Identifier (Loc, Chars (Act_Decl_Id)),
- Parameter_Specifications =>
- New_Copy_List
- (Parameter_Specifications (Parent (Act_Decl_Id)))),
-
- Declarations => Empty_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements =>
- New_List (
- Make_Raise_Program_Error (Loc,
- Reason =>
- PE_Access_Before_Elaboration))));
+ Specification =>
+ Make_Procedure_Specification (Loc,
+ Defining_Unit_Name =>
+ Make_Defining_Identifier (Loc, Chars (Act_Decl_Id)),
+ Parameter_Specifications =>
+ New_Copy_List
+ (Parameter_Specifications (Parent (Act_Decl_Id)))),
+
+ Declarations => Empty_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Raise_Program_Error (Loc,
+ Reason => PE_Access_Before_Elaboration))));
else
Ret_Expr :=
@@ -11444,9 +11470,9 @@ package body Sem_Ch12 is
Make_Subprogram_Body (Loc,
Specification =>
Make_Function_Specification (Loc,
- Defining_Unit_Name =>
+ Defining_Unit_Name =>
Make_Defining_Identifier (Loc, Chars (Act_Decl_Id)),
- Parameter_Specifications =>
+ Parameter_Specifications =>
New_Copy_List
(Parameter_Specifications (Parent (Act_Decl_Id))),
Result_Definition =>
@@ -11455,9 +11481,8 @@ package body Sem_Ch12 is
Declarations => Empty_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
- Statements =>
- New_List
- (Make_Simple_Return_Statement (Loc, Ret_Expr))));
+ Statements => New_List (
+ Make_Simple_Return_Statement (Loc, Ret_Expr))));
end if;
Pack_Body :=
@@ -11471,6 +11496,9 @@ package body Sem_Ch12 is
end if;
Expander_Mode_Restore;
+
+ <<Leave>>
+ Restore_Ghost_Mode (Mode);
end Instantiate_Subprogram_Body;
----------------------