diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2018-05-29 09:39:44 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-29 09:39:44 +0000 |
commit | de9b2a969ebc6ebce82331c67c895a0f99b0cc78 (patch) | |
tree | c90bd22413cd1052b8920b6617ad5eb786a55764 | |
parent | ce09c3c07f3bae669c0152ba4d72a708cfe27d0f (diff) | |
download | gcc-de9b2a969ebc6ebce82331c67c895a0f99b0cc78.zip gcc-de9b2a969ebc6ebce82331c67c895a0f99b0cc78.tar.gz gcc-de9b2a969ebc6ebce82331c67c895a0f99b0cc78.tar.bz2 |
[Ada] Adjustment of behavior of new -gnatRj switch
This decouples -gnatRj from the destination, either standard output or file,
so that it only toggles the format of the representation information.
2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
Control): Adjust description of -gnatRj.
* gnat_ugn.texi: Regenerate.
* opt.ads (List_Representation_Info_To_JSON): Likewise.
* repinfo.adb (List_Rep_Info): Do not automatically create a file
if List_Representation_Info_To_JSON is true.
* switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
check between -gnatRj and -gnatRs.
* usage.adb (Usage): Adjust description of -gnatRj.
From-SVN: r260873
-rw-r--r-- | gcc/ada/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst | 16 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 16 | ||||
-rw-r--r-- | gcc/ada/opt.ads | 3 | ||||
-rw-r--r-- | gcc/ada/repinfo.adb | 27 | ||||
-rw-r--r-- | gcc/ada/switch-c.adb | 10 | ||||
-rw-r--r-- | gcc/ada/usage.adb | 4 |
7 files changed, 49 insertions, 39 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6aea3c0..08dfb85 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2018-05-29 Eric Botcazou <ebotcazou@adacore.com> + + * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging + Control): Adjust description of -gnatRj. + * gnat_ugn.texi: Regenerate. + * opt.ads (List_Representation_Info_To_JSON): Likewise. + * repinfo.adb (List_Rep_Info): Do not automatically create a file + if List_Representation_Info_To_JSON is true. + * switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility + check between -gnatRj and -gnatRs. + * usage.adb (Usage): Adjust description of -gnatRj. + 2018-05-29 Pascal Obry <obry@adacore.com> * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index bbcef08..4800138 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -5813,16 +5813,16 @@ Debugging Control subprogram conventions and parameter passing mechanisms for all the subprograms are included. + If the switch is followed by a ``j`` (e.g., :switch:`-gnatRj`), then + the output is in the JSON data interchange format specified by the + ECMA-404 standard. The semantic description of this JSON output is + available in the specification of the Repinfo unit present in the + compiler sources. + If the switch is followed by an ``s`` (e.g., :switch:`-gnatR3s`), then the output is to a file with the name :file:`file.rep` where file is - the name of the corresponding source file. - - If the switch is followed by a ``j`` (e.g., :switch:`-gnatR3j`), then - the output is to a file with the name :file:`file.json` where file is - the name of the corresponding source file, and it uses the JSON data - interchange format specified by the ECMA-404 standard. The semantic - description of this JSON output is available in the specification of - the Repinfo unit present in the compiler sources. + the name of the corresponding source file, except if `j`` is also + specified, in which case the file name is :file:`file.json`. Note that it is possible for record components to have zero size. In this case, the component clause uses an obvious extension of permitted diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 3fb6af5..0b6a408 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -15041,16 +15041,16 @@ If the switch is followed by an @code{m} (e.g. @code{-gnatRm}), then subprogram conventions and parameter passing mechanisms for all the subprograms are included. +If the switch is followed by a @code{j} (e.g., @code{-gnatRj}), then +the output is in the JSON data interchange format specified by the +ECMA-404 standard. The semantic description of this JSON output is +available in the specification of the Repinfo unit present in the +compiler sources. + If the switch is followed by an @code{s} (e.g., @code{-gnatR3s}), then the output is to a file with the name @code{file.rep} where file is -the name of the corresponding source file. - -If the switch is followed by a @code{j} (e.g., @code{-gnatR3j}), then -the output is to a file with the name @code{file.json} where file is -the name of the corresponding source file, and it uses the JSON data -interchange format specified by the ECMA-404 standard. The semantic -description of this JSON output is available in the specification of -the Repinfo unit present in the compiler sources. +the name of the corresponding source file, except if @cite{j`} is also +specified, in which case the file name is @code{file.json}. Note that it is possible for record components to have zero size. In this case, the component clause uses an obvious extension of permitted diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 235ca3d..7e23d1d 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -1006,8 +1006,7 @@ package Opt is List_Representation_Info_To_JSON : Boolean := False; -- GNAT -- Set true by -gnatRj switch. Causes information from -gnatR/1/2/3/m to be - -- written to file.json (where file is the name of the source file) in the - -- JSON data interchange format. + -- output in the JSON data interchange format. List_Representation_Info_Mechanisms : Boolean := False; -- GNAT diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index 6c35423..1a85c8f 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -1711,20 +1711,21 @@ package body Repinfo is -- Normal case, list to standard output - if not List_Representation_Info_To_File - and then not List_Representation_Info_To_JSON - then - Write_Eol; - Write_Str ("Representation information for unit "); - Write_Unit_Name (Unit_Name (U)); - Col := Column; - Write_Eol; - - for J in 1 .. Col - 1 loop - Write_Char ('-'); - end loop; + if not List_Representation_Info_To_File then + if not List_Representation_Info_To_JSON then + Write_Eol; + Write_Str ("Representation information for unit "); + Write_Unit_Name (Unit_Name (U)); + Col := Column; + Write_Eol; + + for J in 1 .. Col - 1 loop + Write_Char ('-'); + end loop; + + Write_Eol; + end if; - Write_Eol; List_Entities (Cunit_Entity (U), Bytes_Big_Endian); -- List representation information to file diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index be8fb61..ab7c2b3 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -1227,12 +1227,10 @@ package body Switch.C is Ptr := Ptr + 1; end loop; - if List_Representation_Info_To_JSON then - if List_Representation_Info_To_File then - Osint.Fail ("-gnatRs is incompatible with -gnatRj"); - elsif List_Representation_Info_Extended then - Osint.Fail ("-gnatRe is incompatible with -gnatRj"); - end if; + if List_Representation_Info_To_JSON + and then List_Representation_Info_Extended + then + Osint.Fail ("-gnatRe is incompatible with -gnatRj"); end if; -- -gnats (syntax check only) diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index a07629e..a065244 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -403,10 +403,10 @@ begin Write_Switch_Char ("R?"); Write_Line ("List rep info (?=0/1/2/3/e/m for none/types/all/symbolic/ext/mech)"); + Write_Switch_Char ("R?j"); + Write_Line ("List rep info in the JSON data interchange format"); Write_Switch_Char ("R?s"); Write_Line ("List rep info to file.rep instead of standard output"); - Write_Switch_Char ("R?j"); - Write_Line ("List rep info to file.json instead of standard output"); -- Line for -gnats switch |