Commit 45969c97 by Arnaud Charlet Committed by Arnaud Charlet

gnat1drv.adb (Adjust_Global_Switches): Adjust settings.

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

	* gnat1drv.adb (Adjust_Global_Switches): Adjust settings.
	* sem.adb (Semantics): Remove special case.

From-SVN: r229230
parent 88ebcde5
2015-10-23 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Adjust settings.
* sem.adb (Semantics): Remove special case.
2015-10-23 Gary Dismukes <dismukes@adacore.com> 2015-10-23 Gary Dismukes <dismukes@adacore.com>
* bindgen.adb, restrict.adb: Minor spelling/grammar fixes. * bindgen.adb, restrict.adb: Minor spelling/grammar fixes.
......
...@@ -136,17 +136,34 @@ procedure Gnat1drv is ...@@ -136,17 +136,34 @@ procedure Gnat1drv is
Unnest_Subprogram_Mode := True; Unnest_Subprogram_Mode := True;
end if; end if;
-- -gnatd.V or -gnatd.u enables special C expansion mode -- -gnatd.u enables special C expansion mode
if Debug_Flag_Dot_VV or Debug_Flag_Dot_U then if Debug_Flag_Dot_U then
Modify_Tree_For_C := True; Modify_Tree_For_C := True;
end if; end if;
-- Other flags set if we are generating C code -- Set all flags required when generating C code (-gnatd.V)
if Debug_Flag_Dot_VV then if Debug_Flag_Dot_VV then
Generate_C_Code := True; Generate_C_Code := True;
Modify_Tree_For_C := True;
Unnest_Subprogram_Mode := True; Unnest_Subprogram_Mode := True;
-- Enable some restrictions systematically to simplify the generated
-- code. Note that restriction checks are also disabled in C mode,
-- see Restrict.Check_Restriction.
Restrict.Restrictions.Set (No_Exception_Registration) := True;
Restrict.Restrictions.Set (No_Initialize_Scalars) := True;
Restrict.Restrictions.Set (No_Task_Hierarchy) := True;
Restrict.Restrictions.Set (No_Abort_Statements) := True;
Restrict.Restrictions.Set (Max_Asynchronous_Select_Nesting) := True;
Restrict.Restrictions.Value (Max_Asynchronous_Select_Nesting) := 0;
-- Set operating mode to Generate_Code to benefit from full front-end
-- expansion (e.g. generics).
Operating_Mode := Generate_Code;
end if; end if;
-- -gnatd.E sets Error_To_Warning mode, causing selected error messages -- -gnatd.E sets Error_To_Warning mode, causing selected error messages
...@@ -229,6 +246,7 @@ procedure Gnat1drv is ...@@ -229,6 +246,7 @@ procedure Gnat1drv is
-- user specified Restrictions pragmas are ignored, see -- user specified Restrictions pragmas are ignored, see
-- Sem_Prag.Process_Restrictions_Or_Restriction_Warnings. -- Sem_Prag.Process_Restrictions_Or_Restriction_Warnings.
Restrict.Restrictions.Set (No_Exception_Registration) := True;
Restrict.Restrictions.Set (No_Initialize_Scalars) := True; Restrict.Restrictions.Set (No_Initialize_Scalars) := True;
Restrict.Restrictions.Set (No_Task_Hierarchy) := True; Restrict.Restrictions.Set (No_Task_Hierarchy) := True;
Restrict.Restrictions.Set (No_Abort_Statements) := True; Restrict.Restrictions.Set (No_Abort_Statements) := True;
......
...@@ -505,16 +505,14 @@ package body Restrict is ...@@ -505,16 +505,14 @@ package body Restrict is
-- In GNATprove mode restrictions are checked, except for -- In GNATprove mode restrictions are checked, except for
-- No_Initialize_Scalars, which is implicitly set in gnat1drv.adb. -- No_Initialize_Scalars, which is implicitly set in gnat1drv.adb.
-- Just checking, SPARK does not allow restrictions to be set ???
if CodePeer_Mode if CodePeer_Mode
or else (GNATprove_Mode and then R = No_Initialize_Scalars) or else (GNATprove_Mode and then R = No_Initialize_Scalars)
then then
return; return;
end if; end if;
-- In SPARK mode, issue an error for any use of class-wide, even if the -- In SPARK 05 mode, issue an error for any use of class-wide, even if
-- No_Dispatch restriction is not set. -- the No_Dispatch restriction is not set.
if R = No_Dispatch then if R = No_Dispatch then
Check_SPARK_05_Restriction ("class-wide is not allowed", N); Check_SPARK_05_Restriction ("class-wide is not allowed", N);
......
...@@ -1446,10 +1446,6 @@ package body Sem is ...@@ -1446,10 +1446,6 @@ package body Sem is
or else Debug_Flag_X or else Debug_Flag_X
-- Or if we are generating C code
or else Generate_C_Code
-- Or if in configuration run-time mode. We do this so we get -- Or if in configuration run-time mode. We do this so we get
-- error messages about missing entities in the run-time even -- error messages about missing entities in the run-time even
-- if we are compiling in -gnatc (no code generation) mode. -- if we are compiling in -gnatc (no code generation) mode.
......
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