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>
* sem_ch8.adb (Find_Direct_Name): Account for the case where
......
......@@ -2853,7 +2853,9 @@ package body Bindgen is
-- used: System.OS_Interface should always be used by any tasking
-- application.
Check_Package (With_GNARL, "system.os_interface%s");
if not Opt.No_Libgnarl then
Check_Package (With_GNARL, "system.os_interface%s");
end if;
-- Ditto for the use of restricted tasking
......
......@@ -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;
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -447,6 +447,9 @@ procedure Gnatbind is
elsif Argv (2 .. Argv'Last) = "nostdinc" then
Opt.No_Stdinc := True;
elsif Argv (2 .. Argv'Last) = "nognarl" then
Opt.No_Libgnarl := True;
-- -static
elsif Argv (2 .. Argv'Last) = "static" then
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -1147,6 +1147,10 @@ package Opt is
-- GNATMAKE, GNATBIND, GNATFIND, GNATXREF
-- 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;
-- GNAT
-- 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