aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/opt.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-11-14 11:42:16 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-11-14 11:42:16 +0000
commitb5f581cdbba4f24c762f9e7d9741b7488bf752d7 (patch)
tree5af1525aee24f35942aac5c1bc00d30f8acfe008 /gcc/ada/opt.ads
parent4faf522bacd66cd03826c645b30c68f0fd785177 (diff)
downloadgcc-b5f581cdbba4f24c762f9e7d9741b7488bf752d7.zip
gcc-b5f581cdbba4f24c762f9e7d9741b7488bf752d7.tar.gz
gcc-b5f581cdbba4f24c762f9e7d9741b7488bf752d7.tar.bz2
[Ada] More complete information level for -gnatR output
This adds a 4th information level for the -gnatR output, where relevant compiler-generated types are listed in addition to the information already output by -gnatR3. For the following package P: package P is type Arr0 is array (Positive range <>) of Boolean; type Rec (D1 : Positive; D2 : Boolean) is record C1 : Integer; C2 : Arr0 (1 .. D1); case D2 is when False => C3 : Character; when True => C4 : String (1 .. 3); C5 : Float; end case; end record; type Arr1 is array (1 .. 8) of Rec (1, True); end P; the output generated by -gnatR4 must be: Representation information for unit P (spec) -------------------------------------------- for Arr0'Alignment use 1; for Arr0'Component_Size use 8; for Rec'Object_Size use 17179869344; for Rec'Value_Size use (if (#2 != 0) then ((((#1 + 15) & -4) + 8) * 8) else ((((#1 + 15) & -4) + 1) * 8) end); for Rec'Alignment use 4; for Rec use record D1 at 0 range 0 .. 31; D2 at 4 range 0 .. 7; C1 at 8 range 0 .. 31; C2 at 12 range 0 .. ((#1 * 8)) - 1; C3 at ((#1 + 15) & -4) range 0 .. 7; C4 at ((#1 + 15) & -4) range 0 .. 23; C5 at (((#1 + 15) & -4) + 4) range 0 .. 31; end record; for Arr1'Size use 1536; for Arr1'Alignment use 4; for Arr1'Component_Size use 192; for Tarr1c'Size use 192; for Tarr1c'Alignment use 4; for Tarr1c use record D1 at 0 range 0 .. 31; D2 at 4 range 0 .. 7; C1 at 8 range 0 .. 31; C2 at 12 range 0 .. 7; C4 at 16 range 0 .. 23; C5 at 20 range 0 .. 31; end record; 2018-11-14 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnatR): Document new -gnatR4 level. * gnat_ugn.texi: Regenerate. * opt.ads (List_Representation_Info): Bump upper bound to 4. * repinfo.adb: Add with clause for GNAT.HTable. (Relevant_Entities_Size): New constant. (Entity_Header_Num): New type. (Entity_Hash): New function. (Relevant_Entities): New set implemented with GNAT.HTable. (List_Entities): Also list compiled-generated entities present in the Relevant_Entities set. Consider that the Component_Type of an array type is relevant. (List_Rep_Info): Reset Relevant_Entities for each unit. * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4. * switch-m.adb (Normalize_Compiler_Switches): Likewise * usage.adb (Usage): Likewise. From-SVN: r266131
Diffstat (limited to 'gcc/ada/opt.ads')
-rw-r--r--gcc/ada/opt.ads11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index 2614303..668d413 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -986,26 +986,27 @@ package Opt is
-- the list of object dependencies (-M switch). Output depends if -a switch
-- is used or not. This list can be used directly in a Makefile.
- List_Representation_Info : Int range 0 .. 3 := 0;
+ List_Representation_Info : Int range 0 .. 4 := 0;
-- GNAT
-- Set non-zero by -gnatR switch to list representation information.
-- The settings are as follows:
--
-- 0 = no listing of representation information (default as above)
- -- 1 = list rep info for user defined record and array types
- -- 2 = list rep info for all user defined types and objects
+ -- 1 = list rep info for user-defined record and array types
+ -- 2 = list rep info for all user-defined types and objects
-- 3 = like 2, but variable fields are decoded symbolically
+ -- 4 = like 3, but list rep info for relevant compiler-generated types
List_Representation_Info_To_File : Boolean := False;
-- GNAT
- -- Set true by -gnatRs switch. Causes information from -gnatR/1/2/3/m to be
+ -- Set true by -gnatRs switch. Causes information from -gnatR[1-4]m to be
-- written to file.rep (where file is the name of the source file) instead
-- of stdout. For example, if file x.adb is compiled using -gnatR2s then
-- representation info is written to x.adb.ref.
List_Representation_Info_To_JSON : Boolean := False;
-- GNAT
- -- Set true by -gnatRj switch. Causes information from -gnatR/1/2/3/m to be
+ -- Set true by -gnatRj switch. Causes information from -gnatR[1-4]m to be
-- output in the JSON data interchange format.
List_Representation_Info_Mechanisms : Boolean := False;