Commit 7e6060af by Arnaud Charlet

[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
parent 522aa6ee
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.
2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch8.adb (Find_Direct_Name): Account for the case where * sem_ch8.adb (Find_Direct_Name): Account for the case where
......
...@@ -2853,7 +2853,9 @@ package body Bindgen is ...@@ -2853,7 +2853,9 @@ package body Bindgen is
-- used: System.OS_Interface should always be used by any tasking -- used: System.OS_Interface should always be used by any tasking
-- application. -- application.
if not Opt.No_Libgnarl then
Check_Package (With_GNARL, "system.os_interface%s"); Check_Package (With_GNARL, "system.os_interface%s");
end if;
-- Ditto for the use of restricted tasking -- Ditto for the use of restricted tasking
......
...@@ -6935,7 +6935,6 @@ package body Exp_Ch7 is ...@@ -6935,7 +6935,6 @@ package body Exp_Ch7 is
Counter : Int := 0; Counter : Int := 0;
Finalizer_Data : Finalization_Exception_Data; Finalizer_Data : Finalization_Exception_Data;
Num_Comps : Nat := 0;
function Process_Component_List_For_Finalize function Process_Component_List_For_Finalize
(Comps : Node_Id) return List_Id; (Comps : Node_Id) return List_Id;
...@@ -6954,12 +6953,14 @@ package body Exp_Ch7 is ...@@ -6954,12 +6953,14 @@ package body Exp_Ch7 is
(Decl : Node_Id; (Decl : Node_Id;
Alts : List_Id; Alts : List_Id;
Decls : List_Id; Decls : List_Id;
Stmts : List_Id); Stmts : List_Id;
Num_Comps : in out Nat);
-- Process the declaration of a single controlled component. If -- Process the declaration of a single controlled component. If
-- flag Is_Local is enabled, create the corresponding label and -- flag Is_Local is enabled, create the corresponding label and
-- jump circuitry. Alts is the list of case alternatives, Decls -- jump circuitry. Alts is the list of case alternatives, Decls
-- is the top level declaration list where labels are declared -- 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 -- -- Process_Component_For_Finalize --
...@@ -6969,7 +6970,8 @@ package body Exp_Ch7 is ...@@ -6969,7 +6970,8 @@ package body Exp_Ch7 is
(Decl : Node_Id; (Decl : Node_Id;
Alts : List_Id; Alts : List_Id;
Decls : List_Id; Decls : List_Id;
Stmts : List_Id) Stmts : List_Id;
Num_Comps : in out Nat)
is is
Id : constant Entity_Id := Defining_Identifier (Decl); Id : constant Entity_Id := Defining_Identifier (Decl);
Typ : constant Entity_Id := Etype (Id); Typ : constant Entity_Id := Etype (Id);
...@@ -7075,6 +7077,7 @@ package body Exp_Ch7 is ...@@ -7075,6 +7077,7 @@ package body Exp_Ch7 is
Jump_Block : Node_Id; Jump_Block : Node_Id;
Label : Node_Id; Label : Node_Id;
Label_Id : Entity_Id; Label_Id : Entity_Id;
Num_Comps : Nat;
Stmts : List_Id; Stmts : List_Id;
Var_Case : Node_Id; Var_Case : Node_Id;
...@@ -7185,7 +7188,8 @@ package body Exp_Ch7 is ...@@ -7185,7 +7188,8 @@ package body Exp_Ch7 is
and then Has_Access_Constraint (Decl_Id) and then Has_Access_Constraint (Decl_Id)
and then No (Expression (Decl)) and then No (Expression (Decl))
then then
Process_Component_For_Finalize (Decl, Alts, Decls, Stmts); Process_Component_For_Finalize
(Decl, Alts, Decls, Stmts, Num_Comps);
end if; end if;
Prev_Non_Pragma (Decl); Prev_Non_Pragma (Decl);
...@@ -7212,7 +7216,8 @@ package body Exp_Ch7 is ...@@ -7212,7 +7216,8 @@ package body Exp_Ch7 is
then then
null; null;
else else
Process_Component_For_Finalize (Decl, Alts, Decls, Stmts); Process_Component_For_Finalize
(Decl, Alts, Decls, Stmts, Num_Comps);
end if; end if;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -447,6 +447,9 @@ procedure Gnatbind is ...@@ -447,6 +447,9 @@ procedure Gnatbind is
elsif Argv (2 .. Argv'Last) = "nostdinc" then elsif Argv (2 .. Argv'Last) = "nostdinc" then
Opt.No_Stdinc := True; Opt.No_Stdinc := True;
elsif Argv (2 .. Argv'Last) = "nognarl" then
Opt.No_Libgnarl := True;
-- -static -- -static
elsif Argv (2 .. Argv'Last) = "static" then elsif Argv (2 .. Argv'Last) = "static" then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -1147,6 +1147,10 @@ package Opt is ...@@ -1147,6 +1147,10 @@ package Opt is
-- GNATMAKE, GNATBIND, GNATFIND, GNATXREF -- GNATMAKE, GNATBIND, GNATFIND, GNATXREF
-- Set to True if no default library search dirs added to search list. -- Set to True if no default library search dirs added to search list.
No_Libgnarl : Boolean := False;
-- GNATBIND
-- Set to True if libgnarl is not available in the runtime.
No_Strict_Aliasing : Boolean := False; No_Strict_Aliasing : Boolean := False;
-- GNAT -- GNAT
-- Set True if pragma No_Strict_Aliasing with no parameters encountered. -- Set True if pragma No_Strict_Aliasing with no parameters encountered.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment