Commit 1c912574 by Arnaud Charlet

[multiple changes]

2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>

	* debug.adb (dA): Adjust comment.
	* gnat1drv.adb (Gnat1drv): Likewise.
	* opt.ads (List_Representation_Info_Extended): New variable.
	* repinfo.adb (List_Record_Info): Split implementation into...
	(Compute_Max_Length): ...this.	Recurse on records if requested.
	(List_Record_Layout): Likewise.
	* switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
	statement, accept '0' and set List_Representation_Info_Extended
	on 'e'.
	* usage.adb (Usage): Document new -gnatRe variant.

2017-09-08  Ed Schonberg  <schonberg@adacore.com>

	* sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
	Do not save the given entity in the global variable Default_Pool
	if the pragma appears within a generic unit.

2017-09-08  Bob Duff  <duff@adacore.com>

	* errout.adb (Delete_Warning): Do not
	decrement Warnings_Treated_As_Errors. This is called before
	Warnings_Treated_As_Errors has been incremented to account for
	this warning. Decrementing it here can lead to negative values
	of Warnings_Treated_As_Errors, raising Constraint_Error in
	checks-on builds, and causing the compiler to return an error
	code in checks-off builds.

From-SVN: r251873
parent f0478a53
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* debug.adb (dA): Adjust comment.
* gnat1drv.adb (Gnat1drv): Likewise.
* opt.ads (List_Representation_Info_Extended): New variable.
* repinfo.adb (List_Record_Info): Split implementation into...
(Compute_Max_Length): ...this. Recurse on records if requested.
(List_Record_Layout): Likewise.
* switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
statement, accept '0' and set List_Representation_Info_Extended
on 'e'.
* usage.adb (Usage): Document new -gnatRe variant.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
Do not save the given entity in the global variable Default_Pool
if the pragma appears within a generic unit.
2017-09-08 Bob Duff <duff@adacore.com>
* errout.adb (Delete_Warning): Do not
decrement Warnings_Treated_As_Errors. This is called before
Warnings_Treated_As_Errors has been incremented to account for
this warning. Decrementing it here can lead to negative values
of Warnings_Treated_As_Errors, raising Constraint_Error in
checks-on builds, and causing the compiler to return an error
code in checks-off builds.
2017-09-08 Arnaud Charlet <charlet@adacore.com> 2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect * sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
......
...@@ -357,7 +357,7 @@ package body Debug is ...@@ -357,7 +357,7 @@ package body Debug is
-- information for all internal type and object entities, as well -- information for all internal type and object entities, as well
-- as all user defined type and object entities including private -- as all user defined type and object entities including private
-- and incomplete types. This debug switch also automatically sets -- and incomplete types. This debug switch also automatically sets
-- the equivalent of -gnatR3m. -- the equivalent of -gnatRm.
-- dB Output debug encodings for types and variants. See Exp_Dbug for -- dB Output debug encodings for types and variants. See Exp_Dbug for
-- exact form of the generated output. -- exact form of the generated output.
......
...@@ -1434,10 +1434,6 @@ package body Errout is ...@@ -1434,10 +1434,6 @@ package body Errout is
if Errors.Table (E).Info then if Errors.Table (E).Info then
Warning_Info_Messages := Warning_Info_Messages - 1; Warning_Info_Messages := Warning_Info_Messages - 1;
end if; end if;
if Errors.Table (E).Warn_Err then
Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
end if;
end if; end if;
end Delete_Warning; end Delete_Warning;
......
...@@ -540,7 +540,7 @@ procedure Gnat1drv is ...@@ -540,7 +540,7 @@ procedure Gnat1drv is
Configurable_Run_Time_Mode := True; Configurable_Run_Time_Mode := True;
end if; end if;
-- Set -gnatR3m mode if debug flag A set -- Set -gnatRm mode if debug flag A set
if Debug_Flag_AA then if Debug_Flag_AA then
Back_Annotate_Rep_Info := True; Back_Annotate_Rep_Info := True;
......
...@@ -982,6 +982,11 @@ package Opt is ...@@ -982,6 +982,11 @@ package Opt is
-- Set true by -gnatRm switch. Causes information on mechanisms to be -- Set true by -gnatRm switch. Causes information on mechanisms to be
-- included in the representation output information. -- included in the representation output information.
List_Representation_Info_Extended : Boolean := False;
-- GNAT
-- Set true by -gnatRe switch. Causes extended information for record types
-- to be included in the representation output information.
List_Preprocessing_Symbols : Boolean := False; List_Preprocessing_Symbols : Boolean := False;
-- GNAT, GNATPREP -- GNAT, GNATPREP
-- Set to True if symbols for preprocessing a source are to be listed -- Set to True if symbols for preprocessing a source are to be listed
......
...@@ -14393,10 +14393,14 @@ package body Sem_Prag is ...@@ -14393,10 +14393,14 @@ package body Sem_Prag is
-- Record the pool name (or null). Freeze.Freeze_Entity for an -- Record the pool name (or null). Freeze.Freeze_Entity for an
-- access type will use this information to set the appropriate -- access type will use this information to set the appropriate
-- attributes of the access type. -- attributes of the access type. If the pragma appears in a
-- generic unit it is ignored, given that it may refer to a
-- local entity.
if not Inside_A_Generic then
Default_Pool := Pool; Default_Pool := Pool;
end if; end if;
end if;
end Default_Storage_Pool; end Default_Storage_Pool;
------------- -------------
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2016, Free Software Foundation, Inc. -- -- Copyright (C) 2001-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- --
...@@ -1143,19 +1143,24 @@ package body Switch.C is ...@@ -1143,19 +1143,24 @@ package body Switch.C is
while Ptr <= Max loop while Ptr <= Max loop
C := Switch_Chars (Ptr); C := Switch_Chars (Ptr);
if C in '1' .. '3' then case C is
when '0' .. '3' =>
List_Representation_Info := List_Representation_Info :=
Character'Pos (C) - Character'Pos ('0'); Character'Pos (C) - Character'Pos ('0');
elsif Switch_Chars (Ptr) = 's' then when 's' =>
List_Representation_Info_To_File := True; List_Representation_Info_To_File := True;
elsif Switch_Chars (Ptr) = 'm' then when 'm' =>
List_Representation_Info_Mechanisms := True; List_Representation_Info_Mechanisms := True;
else when 'e' =>
List_Representation_Info_Extended := True;
when others =>
Bad_Switch ("-gnatR" & Switch_Chars (Ptr .. Max)); Bad_Switch ("-gnatR" & Switch_Chars (Ptr .. Max));
end if; end case;
Ptr := Ptr + 1; Ptr := Ptr + 1;
end loop; end loop;
......
...@@ -392,7 +392,7 @@ begin ...@@ -392,7 +392,7 @@ begin
Write_Switch_Char ("R?"); Write_Switch_Char ("R?");
Write_Line Write_Line
("List rep info (?=0/1/2/3/m for none/types/all/variable/mechanisms)"); ("List rep info (?=0/1/2/3/e/m for none/types/all/symbolic/ext/mech)");
Write_Switch_Char ("R?s"); Write_Switch_Char ("R?s");
Write_Line ("List rep info to file.rep instead of standard output"); Write_Line ("List rep info to file.rep instead of standard output");
......
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