diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-27 12:12:12 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-27 12:12:12 +0200 |
commit | 7e6060af807ad72d199506f9f61a8a70a27eccda (patch) | |
tree | 6cc10b9aca83490a0cc406439c527896eb6932d4 /gcc/ada/exp_ch7.adb | |
parent | 522aa6ee70820727d5be628b0f6b3cc7a185a14b (diff) | |
download | gcc-7e6060af807ad72d199506f9f61a8a70a27eccda.zip gcc-7e6060af807ad72d199506f9f61a8a70a27eccda.tar.gz gcc-7e6060af807ad72d199506f9f61a8a70a27eccda.tar.bz2 |
[multiple changes]
2017-04-27 Jerome Lambourg <lambourg@adacore.com>
* bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
2017-04-27 Justin Squirek <squirek@adacore.com>
* exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
Process_Component_List_For_Finalization as a local variable.
(Process_Component_For_Finalize): Add an extra parameter to avoid
global references.
(Process_Component_List_For_Finalization): Correct calls to
Process_Component_For_Finalize to take Num_Comps as a parameter.
From-SVN: r247310
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r-- | gcc/ada/exp_ch7.adb | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 9644633..8f52966 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -6935,7 +6935,6 @@ package body Exp_Ch7 is Counter : Int := 0; Finalizer_Data : Finalization_Exception_Data; - Num_Comps : Nat := 0; function Process_Component_List_For_Finalize (Comps : Node_Id) return List_Id; @@ -6951,25 +6950,28 @@ package body Exp_Ch7 is (Comps : Node_Id) return List_Id is procedure Process_Component_For_Finalize - (Decl : Node_Id; - Alts : List_Id; - Decls : List_Id; - Stmts : List_Id); + (Decl : Node_Id; + Alts : List_Id; + Decls : List_Id; + Stmts : List_Id; + Num_Comps : in out Nat); -- Process the declaration of a single controlled component. If -- flag Is_Local is enabled, create the corresponding label and -- jump circuitry. Alts is the list of case alternatives, Decls -- is the top level declaration list where labels are declared - -- and Stmts is the list of finalization actions. + -- and Stmts is the list of finalization actions. Num_Comps + -- denotes the current number of components needing finalization. ------------------------------------ -- Process_Component_For_Finalize -- ------------------------------------ procedure Process_Component_For_Finalize - (Decl : Node_Id; - Alts : List_Id; - Decls : List_Id; - Stmts : List_Id) + (Decl : Node_Id; + Alts : List_Id; + Decls : List_Id; + Stmts : List_Id; + Num_Comps : in out Nat) is Id : constant Entity_Id := Defining_Identifier (Decl); Typ : constant Entity_Id := Etype (Id); @@ -7075,6 +7077,7 @@ package body Exp_Ch7 is Jump_Block : Node_Id; Label : Node_Id; Label_Id : Entity_Id; + Num_Comps : Nat; Stmts : List_Id; Var_Case : Node_Id; @@ -7185,7 +7188,8 @@ package body Exp_Ch7 is and then Has_Access_Constraint (Decl_Id) and then No (Expression (Decl)) then - Process_Component_For_Finalize (Decl, Alts, Decls, Stmts); + Process_Component_For_Finalize + (Decl, Alts, Decls, Stmts, Num_Comps); end if; Prev_Non_Pragma (Decl); @@ -7212,7 +7216,8 @@ package body Exp_Ch7 is then null; else - Process_Component_For_Finalize (Decl, Alts, Decls, Stmts); + Process_Component_For_Finalize + (Decl, Alts, Decls, Stmts, Num_Comps); end if; end if; |