diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-13 10:43:56 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-13 10:43:56 +0100 |
commit | b0bf18adaa92fdedee13eb006bb6a5357a8ede72 (patch) | |
tree | c390cb8b07f0943a84e7b53ca79456d7b6034256 | |
parent | d65a80fd559aca749b54eb6affd71d2d84f410f8 (diff) | |
download | gcc-b0bf18adaa92fdedee13eb006bb6a5357a8ede72.zip gcc-b0bf18adaa92fdedee13eb006bb6a5357a8ede72.tar.gz gcc-b0bf18adaa92fdedee13eb006bb6a5357a8ede72.tar.bz2 |
[multiple changes]
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.
From-SVN: r244396
-rw-r--r-- | gcc/ada/ChangeLog | 48 | ||||
-rw-r--r-- | gcc/ada/exp_ch3.adb | 4 | ||||
-rw-r--r-- | gcc/ada/exp_ch7.adb | 8 | ||||
-rw-r--r-- | gcc/ada/exp_disp.adb | 4 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 12 | ||||
-rw-r--r-- | gcc/ada/expander.adb | 4 | ||||
-rw-r--r-- | gcc/ada/freeze.adb | 4 | ||||
-rw-r--r-- | gcc/ada/gnat1drv.adb | 5 | ||||
-rw-r--r-- | gcc/ada/s-mmosin-mingw.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch12.adb | 16 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch5.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 13 | ||||
-rw-r--r-- | gcc/ada/sem_ch7.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 16 |
17 files changed, 165 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9c04b30..0569679 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,53 @@ 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 no longer marked as Ghost at this level. (Mark_New_Ghost_Node): New routine. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 93ae83f..3fafb9c 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -7011,6 +7011,10 @@ package body Exp_Ch3 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 diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 6b994aa..131df4a 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -3455,6 +3455,10 @@ package body Exp_Ch7 is -- 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) @@ -4674,6 +4678,10 @@ package body Exp_Ch7 is -- 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) diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 034e199..770cb0f 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -3613,6 +3613,10 @@ package body Exp_Disp is -- ... -- 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); diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 8297013..3d09a96 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1191,6 +1191,10 @@ package body Exp_Util is -- 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; @@ -1924,6 +1928,10 @@ package body Exp_Util is -- 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); @@ -7899,6 +7907,10 @@ package body Exp_Util is -- 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; diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb index 64192b7..8bd95e3 100644 --- a/gcc/ada/expander.adb +++ b/gcc/ada/expander.adb @@ -77,6 +77,10 @@ package body Expander is -- 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; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index c601ac0..ff7ee8c 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -2002,6 +2002,10 @@ package body Freeze is -- 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; diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 8582b93..1bf10b6 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -286,6 +286,11 @@ procedure Gnat1drv is 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. diff --git a/gcc/ada/s-mmosin-mingw.adb b/gcc/ada/s-mmosin-mingw.adb index 0785f3c..11051fc 100644 --- a/gcc/ada/s-mmosin-mingw.adb +++ b/gcc/ada/s-mmosin-mingw.adb @@ -60,7 +60,7 @@ package body System.Mmap.OS_Interface is 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"); diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index 75d6e39..fc7bf7b 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -97,6 +97,10 @@ package body Sem is -- 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; @@ -1337,6 +1341,10 @@ package body Sem is -- 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; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 89b5586..185310f 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -3573,6 +3573,10 @@ package body Sem_Ch12 is -- 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); @@ -4839,6 +4843,10 @@ package body Sem_Ch12 is -- 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) @@ -10786,6 +10794,10 @@ package body Sem_Ch12 is -- 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; @@ -11204,6 +11216,10 @@ package body Sem_Ch12 is -- 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) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index bb57ad0..d159126 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -8244,6 +8244,10 @@ package body Sem_Ch13 is -- 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); @@ -8894,6 +8898,10 @@ package body Sem_Ch13 is -- 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 diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 99d8b58..e9f6fcd 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3303,6 +3303,10 @@ package body Sem_Ch3 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); @@ -19413,6 +19417,10 @@ package body Sem_Ch3 is -- 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; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 620b562..1a47be5 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -88,6 +88,10 @@ package body Sem_Ch5 is -- 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); diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 9d8792a..33233bd 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -1505,10 +1505,15 @@ package body Sem_Ch6 is -- 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 -- @@ -2136,6 +2141,10 @@ package body Sem_Ch6 is -- 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); diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index f5c02c8..4e1a27e 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -193,6 +193,10 @@ package body Sem_Ch7 is -- 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 diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 513b19b..1fc6f76 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -361,6 +361,10 @@ package body Sem_Prag is -- 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) @@ -2650,6 +2654,10 @@ package body Sem_Prag is -- 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); @@ -12466,6 +12474,10 @@ package body Sem_Prag is -- 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; @@ -23547,6 +23559,10 @@ package body Sem_Prag is -- 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) |