[multiple changes]

2013-10-14  Robert Dewar  <dewar@adacore.com>

	* exp_prag.adb, exp_ch11.adb, s-exctab.adb: Minor reformatting.
	* usage.adb: Add line for -gnateu switch.

2013-10-14  Vincent Celier  <celier@adacore.com>

	* lib-writ.ads: Add comments to indicate that a path name in
	D lines may be quoted if the path name includes directories
	with spaces.

2013-10-14  Robert Dewar  <dewar@adacore.com>

	* debug.adb: Document -gnatd.E.
	* gnat1drv.adb (Adjust_Global_Switches): Set Error_To_Warning
	if -gnatd.E set.
	* opt.ads (Error_To_Warning): New switch.
	* osint.adb: Minor reformatting.
	* sem_warn.adb (Warn_On_Overlapping_Actuals): Overlap is error
	in some cases in Ada 2012 mode (unless Error_To_Warning) is set.
	* sem_warn.ads (Warn_On_Overlapping_Actuals): Document error
	in Ada 2012 mode.

2013-10-14  Tristan Gingold  <gingold@adacore.com>

	* cstand.adb: Add a comment for Standard_Exception_Type.

2013-10-14  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch4.adb (Process_Transient_Object): If a transient scope
	has already been created, use the corresponding Node_To_Be_Wrapped
	as the insertion point for the controlled actions.

From-SVN: r203539
This commit is contained in:
Arnaud Charlet 2013-10-14 15:10:22 +02:00
parent e443f14204
commit 0247964def
14 changed files with 133 additions and 38 deletions

View File

@ -1,3 +1,36 @@
2013-10-14 Robert Dewar <dewar@adacore.com>
* exp_prag.adb, exp_ch11.adb, s-exctab.adb: Minor reformatting.
* usage.adb: Add line for -gnateu switch.
2013-10-14 Vincent Celier <celier@adacore.com>
* lib-writ.ads: Add comments to indicate that a path name in
D lines may be quoted if the path name includes directories
with spaces.
2013-10-14 Robert Dewar <dewar@adacore.com>
* debug.adb: Document -gnatd.E.
* gnat1drv.adb (Adjust_Global_Switches): Set Error_To_Warning
if -gnatd.E set.
* opt.ads (Error_To_Warning): New switch.
* osint.adb: Minor reformatting.
* sem_warn.adb (Warn_On_Overlapping_Actuals): Overlap is error
in some cases in Ada 2012 mode (unless Error_To_Warning) is set.
* sem_warn.ads (Warn_On_Overlapping_Actuals): Document error
in Ada 2012 mode.
2013-10-14 Tristan Gingold <gingold@adacore.com>
* cstand.adb: Add a comment for Standard_Exception_Type.
2013-10-14 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Process_Transient_Object): If a transient scope
has already been created, use the corresponding Node_To_Be_Wrapped
as the insertion point for the controlled actions.
2013-10-14 Tristan Gingold <gingold@adacore.com>
* cstand.adb (Create_Standard): Change Import_Code component

View File

@ -1448,9 +1448,9 @@ package body CStand is
(Type_Definition (Parent (Standard_Duration))));
-- Normally it does not matter that nodes in package Standard are
-- not marked as analyzed. The Scalar_Range of the fixed-point
-- type Standard_Duration is an exception, because of the special
-- test made in Freeze.Freeze_Fixed_Point_Type.
-- not marked as analyzed. The Scalar_Range of the fixed-point type
-- Standard_Duration is an exception, because of the special test
-- made in Freeze.Freeze_Fixed_Point_Type.
Set_Analyzed (Scalar_Range (Standard_Duration));
@ -1471,6 +1471,10 @@ package body CStand is
-- Build standard exception type. Note that the type name here is
-- actually used in the generated code, so it must be set correctly.
-- The type Standard_Exception_Type must be consistent with the type
-- System.Standard_Library.Exception_Data, as the latter is what is
-- known by the run-time. Components of the record are documented in
-- the declaration in System.Standard_Library.
Standard_Exception_Type := New_Standard_Entity;
Set_Ekind (Standard_Exception_Type, E_Record_Type);

View File

@ -122,7 +122,7 @@ package body Debug is
-- d.B
-- d.C Generate concatenation call, do not generate inline code
-- d.D SPARK strict mode
-- d.E
-- d.E Turn selected errors into warnings
-- d.F SPARK mode
-- d.G Frame condition mode for gnat2why
-- d.H
@ -581,22 +581,26 @@ package body Debug is
-- d.w This flag turns off the scanning of loops to detect possible
-- infinite loops.
-- d.A There seems to be a problem with ASIS if we activate the circuit
-- for reading and writing the aspect specification hash table, so
-- for now, this is controlled by the debug flag d.A. The hash table
-- is only written and read if this flag is set.
-- d.x No exception handlers in generated code. This causes exception
-- handlers to be eliminated from the generated code. They are still
-- fully compiled and analyzed, they just get eliminated from the
-- code generation step.
-- d.A There seems to be a problem with ASIS if we activate the circuit
-- for reading and writing the aspect specification hash table, so
-- for now, this is controlled by the debug flag d.A. The hash table
-- is only written and read if this flag is set.
-- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
-- where we would normally generate inline concatenation code.
-- d.D SPARK strict mode. Interpret compiler permissions as strictly as
-- possible in SPARK mode.
--
-- d.E Turn selected errors into warnings. This debug switch causes a
-- specific set of error messages into warnings. Setting this switch
-- causes Opt.Error_To_Warning to be set to True.
-- d.F SPARK mode. Generate AST in a form suitable for formal
-- verification, as well as additional cross reference information in
-- ALI files to compute effects of subprograms. Note that ALI files

View File

@ -1166,18 +1166,17 @@ package body Exp_Ch11 is
-- Generates:
-- exceptE : constant String := "A.B.EXCEP"; -- static data
-- except : exception_data := (
-- Handled_By_Other => False,
-- Lang => 'A',
-- Name_Length => exceptE'Length,
-- Full_Name => exceptE'Address,
-- HTable_Ptr => null,
-- Foreign_Data => null,
-- Raise_Hook => null,
-- );
-- except : exception_data :=
-- (Handled_By_Other => False,
-- Lang => 'A',
-- Name_Length => exceptE'Length,
-- Full_Name => exceptE'Address,
-- HTable_Ptr => null,
-- Foreign_Data => null,
-- Raise_Hook => null);
-- (protecting test only needed if not at library level)
--
-- exceptF : Boolean := True -- static data
-- if exceptF then
-- exceptF := False;

View File

@ -12159,11 +12159,22 @@ package body Exp_Ch4 is
Top : Node_Id;
begin
-- In most cases an expression that creates a controlled object
-- generates a transient scope around it. If this is the case then
-- other controlled values can reuse it.
if Scope_Is_Transient then
return Node_To_Be_Wrapped;
-- In some cases, such as return statements, no transient scope is
-- generated, in which case we have to look up in the tree to find
-- the proper list on which to place the transient.
-- When the node is inside a case/if expression, the lifetime of any
-- temporary controlled object is extended. Find a suitable insertion
-- node by locating the topmost case or if expressions.
if Within_Case_Or_If_Expression (N) then
elsif Within_Case_Or_If_Expression (N) then
Par := N;
Top := N;
while Present (Par) loop

View File

@ -713,7 +713,7 @@ package body Exp_Prag is
else
Code :=
Make_Function_Call (Loc,
Name =>
Name =>
New_Reference_To (RTE (RE_Import_Address), Loc),
Parameter_Associations => New_List
(Make_String_Literal (Loc,

View File

@ -117,6 +117,13 @@ procedure Gnat1drv is
Relaxed_RM_Semantics := True;
end if;
-- -gnatd.E sets Error_To_Warning mode, causing selected error messages
-- to be treated as warnings instead of errors.
if Debug_Flag_Dot_EE then
Error_To_Warning := True;
end if;
-- Disable CodePeer_Mode in Check_Syntax, since we need front-end
-- expansion.

View File

@ -777,6 +777,13 @@ package Lib.Writ is
-- D source-name time-stamp checksum [subunit-name] line:file-name
-- source-name also includes preprocessing data file and preprocessing
-- definition file. These preprocessing files may be given as full
-- path names instead of simple file names. If a full path name
-- includes a directory with spaces, the path name is quoted (quote
-- characters (") added at start and end, and any internal quotes are
-- doubled).
-- The time-stamp field contains the time stamp of the corresponding
-- source file. See types.ads for details on time stamp representation.

View File

@ -516,6 +516,13 @@ package Opt is
-- to make a single long message, and then this message is split up into
-- multiple lines not exceeding the specified length. Set by -gnatj=nn.
Error_To_Warning : Boolean := False;
-- GNAT
-- If True, then certain error messages (e.g. parameter overlap messages
-- for procedure calls in Ada 2012 mode) are treated as warnings instead
-- of errors. Set by debug flag -gnatd.E. A search for Error_To_Warning
-- will identify affected messages.
Exception_Handler_Encountered : Boolean := False;
-- GNAT
-- This flag is set true if the parser encounters an exception handler.

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2013, 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- --
@ -1044,8 +1044,8 @@ package body Osint is
procedure Fail (S : String) is
begin
-- We use Output in case there is a special output set up.
-- In this case Set_Standard_Error will have no immediate effect.
-- We use Output in case there is a special output set up. In this case
-- Set_Standard_Error will have no immediate effect.
Set_Standard_Error;
Osint.Write_Program_Name;

View File

@ -67,15 +67,12 @@ package body System.Exception_Table is
S1 : constant Big_String_Ptr := To_Ptr (A);
S2 : constant Big_String_Ptr := To_Ptr (B);
J : Integer := 1;
begin
loop
if S1 (J) /= S2 (J) then
return False;
elsif S1 (J) = ASCII.NUL then
return True;
else
J := J + 1;
end if;

View File

@ -3410,12 +3410,26 @@ package body Sem_Warn is
then
null;
-- Here we may need to issue message
-- Here we may need to issue overlap message
else
Error_Msg_Warn :=
-- Overlap checking is an error only in Ada 2012. For
-- earlier versions of Ada, this is a warning.
Ada_Version < Ada_2012
or else not Is_Elementary_Type (Etype (Form1));
-- Overlap is only illegal in Ada 2012 in the case of
-- elementary types (passed by copy). For other types,
-- we always have a warning in all Ada versions.
or else not Is_Elementary_Type (Etype (Form1))
-- Finally, debug flag -gnatd.E changes the error to a
-- warning even in Ada 2012 mode.
or else Error_To_Warning;
declare
Act : Node_Id;
@ -3457,23 +3471,28 @@ package body Sem_Warn is
then
if Act1 = First_Actual (N) then
Error_Msg_FE
("`IN OUT` prefix overlaps with "
& "actual for&?I?", Act1, Form);
("<`IN OUT` prefix overlaps with "
& "actual for&", Act1, Form);
else
-- For greater clarity, give name of formal
Error_Msg_Node_2 := Form;
Error_Msg_FE
("writable actual for & overlaps with "
& "actual for&?I?", Act1, Form);
("<writable actual for & overlaps with "
& "actual for&", Act1, Form);
end if;
else
-- For greater clarity, give name of formal
Error_Msg_Node_2 := Form;
-- This is one of the messages
Error_Msg_FE
("writable actual for & overlaps with "
& "actual for&?I?", Act1, Form1);
("<writable actual for & overlaps with "
& "actual for&", Act1, Form1);
end if;
end;
end if;

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1999-2011, Free Software Foundation, Inc. --
-- Copyright (C) 1999-2013, 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- --
@ -198,7 +198,9 @@ package Sem_Warn is
procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id);
-- Called on a subprogram call. Checks whether an IN OUT actual that is
-- not by-copy may overlap with another actual, thus leading to aliasing
-- in the body of the called subprogram.
-- in the body of the called subprogram. This is indeed a warning in Ada
-- versions prior to Ada 2012, but, unless Opt.Error_To_Warning is set by
-- use of debug flag -gnatd.E, this is illegal and generates an error.
procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id);
-- This is called after resolving an indexed component or a slice. Name

View File

@ -251,6 +251,11 @@ begin
Write_Switch_Char ("eT=?");
Write_Line ("Read target dependent information file ?, e.g. gnateT=tdf");
-- Line for -gnateu switch
Write_Switch_Char ("eu");
Write_Line ("Ignore unrecognized style/validity/warning switches");
-- Line for -gnateV switch
Write_Switch_Char ("eV");