+2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * expander.adb (Expand): Add a warning about using return
+ statements in Ghost management code.
+ * exp_ch3.adb (Freeze_Type): Add a warning about using return
+ statements in Ghost management code.
+ * exp_ch7.adb (Build_Invariant_Procedure_Body,
+ Build_Invariant_Procedure_Declaration): Add a warning about
+ using return statements in Ghost management code.
+ * exp_disp.adb (Make_DT): Add a warning about using return
+ statements in Ghost management code.
+ * exp_util.adb (Build_DIC_Procedure_Body,
+ Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
+ warning about using return statements in Ghost management code.
+ * freeze.adb (Freeze_Entity): Add a warning about using return
+ statements in Ghost management code.
+ * sem.adb (Analyze, Do_Analyze): Add a warning about using return
+ statements in Ghost management code.
+ * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
+ a warning about using return statements in Ghost management code.
+ * sem_ch5.adb (Analyze_Assignment): Add a warning about using
+ return statements in Ghost management code.
+ * sem_ch6.adb (Analyze_Procedure_Call,
+ Analyze_Subprogram_Body_Helper): Add a warning about using return
+ statements in Ghost management code.
+ * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
+ using return statements in Ghost management code.
+ * sem_ch12.adb (Analyze_Package_Instantiation,
+ Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
+ Instantiate_Subprogram_Body): Add a warning about using return
+ statements in Ghost management code.
+ * sem_ch13.adb (Build_Predicate_Functions,
+ Build_Predicate_Function_Declarations): Add a warning about
+ using return statements in Ghost management code.
+ * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
+ Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
+ Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about
+ using return statements in Ghost management code.
+
+2017-01-13 Tristan Gingold <gingold@adacore.com>
+
+ * s-mmosin-mingw.adb: Fix pragma import.
+
+2017-01-13 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
+ codepeer mode.
+
2017-01-13 Hristian Kirtchev <kirtchev@adacore.com>
* atree.adb (Allocate_Initialize_Node): A newly created node is
-- for initialization) are chained in the Actions field list of the freeze
-- node using Append_Freeze_Actions.
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
function Freeze_Type (N : Node_Id) return Boolean is
procedure Process_RACW_Types (Typ : Entity_Id);
-- Validate and generate stubs for all RACW types associated with type
-- Build_Invariant_Procedure_Body --
------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Build_Invariant_Procedure_Body
(Typ : Entity_Id;
Partial_Invariant : Boolean := False)
-- Build_Invariant_Procedure_Declaration --
-------------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Build_Invariant_Procedure_Declaration
(Typ : Entity_Id;
Partial_Invariant : Boolean := False)
-- ...
-- end;
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
function Make_DT (Typ : Entity_Id; N : Node_Id := Empty) return List_Id is
Loc : constant Source_Ptr := Sloc (Typ);
-- Build_DIC_Procedure_Body --
------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Build_DIC_Procedure_Body (Typ : Entity_Id) is
procedure Add_DIC_Check
(DIC_Prag : Node_Id;
-- Build_DIC_Procedure_Declaration --
-------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Build_DIC_Procedure_Declaration (Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (Typ);
-- Make_Predicate_Call --
-------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
function Make_Predicate_Call
(Typ : Entity_Id;
Expr : Node_Id;
-- Expand --
------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Expand (N : Node_Id) is
Mode : Ghost_Mode_Type;
-- Freeze_Entity --
-------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
function Freeze_Entity
(E : Entity_Id;
N : Node_Id;
Debug_Generated_Code := False;
+ -- Disable Exception_Extra_Info (-gnateE) which generates more
+ -- complex trees with no added value, and may confuse CodePeer.
+
+ Exception_Extra_Info := False;
+
-- Turn cross-referencing on in case it was disabled (e.g. by -gnatD)
-- to support source navigation.
Mb : Natural;
Wcstr : Address;
Wc : Natural) return Integer;
- pragma Import (C, MultiByteToWideChar);
+ pragma Import (Stdcall, MultiByteToWideChar, "MultiByteToWideChar");
Current_Codepage : Interfaces.C.unsigned;
pragma Import (C, Current_Codepage, "__gnat_current_codepage");
-- Analyze --
-------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze (N : Node_Id) is
Mode : Ghost_Mode_Type;
Mode_Set : Boolean := False;
-- Do_Analyze --
----------------
+ -- WARNING: This routine manages Ghost regions. Return statements must
+ -- be replaced by gotos which jump to the end of the routine and restore
+ -- the Ghost mode.
+
procedure Do_Analyze is
Save_Ghost_Mode : constant Ghost_Mode_Type := Ghost_Mode;
-- Analyze_Package_Instantiation --
-----------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Package_Instantiation (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Gen_Id : constant Node_Id := Name (N);
-- Analyze_Subprogram_Instantiation --
--------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Subprogram_Instantiation
(N : Node_Id;
K : Entity_Kind)
-- Instantiate_Package_Body --
------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Instantiate_Package_Body
(Body_Info : Pending_Body_Info;
Inlined_Body : Boolean := False;
-- Instantiate_Subprogram_Body --
---------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Instantiate_Subprogram_Body
(Body_Info : Pending_Body_Info;
Body_Optional : Boolean := False)
-- the typPredicateM version of the function, in which any occurrence of a
-- Raise_Expression is converted to "return False".
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Build_Predicate_Functions (Typ : Entity_Id; N : Node_Id) is
Loc : constant Source_Ptr := Sloc (Typ);
-- Build_Predicate_Function_Declaration --
------------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
function Build_Predicate_Function_Declaration
(Typ : Entity_Id) return Node_Id
is
-- Analyze_Object_Declaration --
--------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Object_Declaration (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Id : constant Entity_Id := Defining_Identifier (N);
-- Process_Full_View --
-----------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Process_Full_View (N : Node_Id; Full_T, Priv_T : Entity_Id) is
procedure Collect_Implemented_Interfaces
(Typ : Entity_Id;
-- Analyze_Assignment --
------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Assignment (N : Node_Id) is
Lhs : constant Node_Id := Name (N);
Rhs : constant Node_Id := Expression (N);
-- Analyze_Procedure_Call --
----------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Procedure_Call (N : Node_Id) is
procedure Analyze_Call_And_Resolve;
- -- Do Analyze and Resolve calls for procedure call
- -- At end, check illegal order dependence.
+ -- Do Analyze and Resolve calls for procedure call. At the end, check
+ -- for illegal order dependence.
+ -- ??? where is the check for illegal order dependencies?
------------------------------
-- Analyze_Call_And_Resolve --
-- specification matters, and is used to create a proper declaration for
-- the subprogram, or to perform conformance checks.
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Subprogram_Body_Helper (N : Node_Id) is
Body_Spec : Node_Id := Specification (N);
Body_Id : Entity_Id := Defining_Entity (Body_Spec);
-- Analyze_Package_Body_Helper --
---------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Package_Body_Helper (N : Node_Id) is
procedure Hide_Public_Entities (Decls : List_Id);
-- Attempt to hide all public entities found in declarative list Decls
-- Analyze_Contract_Cases_In_Decl_Part --
-----------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Contract_Cases_In_Decl_Part
(N : Node_Id;
Freeze_Id : Entity_Id := Empty)
-- Analyze_Initial_Condition_In_Decl_Part --
--------------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Initial_Condition_In_Decl_Part (N : Node_Id) is
Pack_Decl : constant Node_Id := Find_Related_Package_Or_Body (N);
Pack_Id : constant Entity_Id := Defining_Entity (Pack_Decl);
-- The identifiers Assertions and Statement_Assertions are not
-- allowed, since they have special meaning for Check_Policy.
+ -- WARNING: The code below manages Ghost regions. Return statements
+ -- must be replaced by gotos which jump to the end of the code and
+ -- restore the Ghost mode.
+
when Pragma_Check => Check : declare
Cname : Name_Id;
Eloc : Source_Ptr;
-- Analyze_Pre_Post_Condition_In_Decl_Part --
---------------------------------------------
+ -- WARNING: This routine manages Ghost regions. Return statements must be
+ -- replaced by gotos which jump to the end of the routine and restore the
+ -- Ghost mode.
+
procedure Analyze_Pre_Post_Condition_In_Decl_Part
(N : Node_Id;
Freeze_Id : Entity_Id := Empty)