[gcc(refs/users/guojiufu/heads/guojiufu-branch)] [Ada] Add gnatname use for multiple units files support

Jiu Fu Guo guojiufu@gcc.gnu.org
Wed Jun 10 03:43:31 GMT 2020


https://gcc.gnu.org/g:591bdee0fa1087daeab3c0f901d5139c6776469d

commit 591bdee0fa1087daeab3c0f901d5139c6776469d
Author: Philippe Gil <gil@adacore.com>
Date:   Mon Feb 3 14:56:23 2020 +0100

    [Ada] Add gnatname use for multiple units files support
    
    2020-06-08  Philippe Gil  <gil@adacore.com>
    
    gcc/ada/
    
            * doc/gnat_ugn/the_gnat_compilation_model.rst: in "Handling
            Files with Multiple Units" part documents gnatname use for
            unmodified files handling and gnatchop use for files
            refactoring.
            * gnat_ugn.texi: Regenerate.

Diff:
---
 .../doc/gnat_ugn/the_gnat_compilation_model.rst    | 27 +++++++++-------------
 gcc/ada/gnat_ugn.texi                              | 27 +++++++++-------------
 2 files changed, 22 insertions(+), 32 deletions(-)

diff --git a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
index 0b587efac12..69fc95db15d 100644
--- a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
+++ b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst
@@ -1067,23 +1067,18 @@ The basic compilation model of GNAT requires that a file submitted to the
 compiler have only one unit and there be a strict correspondence
 between the file name and the unit name.
 
-The ``gnatchop`` utility allows both of these rules to be relaxed,
-allowing GNAT to process files which contain multiple compilation units
-and files with arbitrary file names. ``gnatchop``
-reads the specified file and generates one or more output files,
-containing one unit per file. The unit and the file name correspond,
-as required by GNAT.
-
-If you want to permanently restructure a set of 'foreign' files so that
-they match the GNAT rules, and do the remaining development using the
-GNAT structure, you can simply use ``gnatchop`` once, generate the
-new set of files and work with them from that point on.
+If you want to keep your files with multiple units,
+perhaps to maintain compatibility with some other Ada compilation system,
+you can use ``gnatname`` to generate or update your project files.
+Generated or modified project files can be processed by GNAT.
+
+See :ref:`Handling_Arbitrary_File_Naming_Conventions_with_gnatname`
+for more details on how to use `gnatname`.
 
-Alternatively, if you want to keep your files in the 'foreign' format,
-perhaps to maintain compatibility with some other Ada compilation
-system, you can set up a procedure where you use ``gnatchop`` each
-time you compile, regarding the source files that it writes as temporary
-files that you throw away.
+Alternatively, if you want to permanently restructure a set of 'foreign'
+files so that they match the GNAT rules, and do the remaining development
+using the GNAT structure, you can simply use ``gnatchop`` once, generate the
+new set of files and work with them from that point on.
 
 Note that if your file containing multiple units starts with a byte order
 mark (BOM) specifying UTF-8 encoding, then the files generated by gnatchop
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 703b7378310..1cbaf2f0a6a 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -21,7 +21,7 @@
 
 @copying
 @quotation
-GNAT User's Guide for Native Platforms , May 04, 2020
+GNAT User's Guide for Native Platforms , May 05, 2020
 
 AdaCore
 
@@ -2632,23 +2632,18 @@ The basic compilation model of GNAT requires that a file submitted to the
 compiler have only one unit and there be a strict correspondence
 between the file name and the unit name.
 
-The @code{gnatchop} utility allows both of these rules to be relaxed,
-allowing GNAT to process files which contain multiple compilation units
-and files with arbitrary file names. @code{gnatchop}
-reads the specified file and generates one or more output files,
-containing one unit per file. The unit and the file name correspond,
-as required by GNAT.
+If you want to keep your files with multiple units,
+perhaps to maintain compatibility with some other Ada compilation system,
+you can use @code{gnatname} to generate or update your project files.
+Generated or modified project files can be processed by GNAT.
 
-If you want to permanently restructure a set of 'foreign' files so that
-they match the GNAT rules, and do the remaining development using the
-GNAT structure, you can simply use @code{gnatchop} once, generate the
-new set of files and work with them from that point on.
+See @ref{59,,Handling Arbitrary File Naming Conventions with gnatname}
+for more details on how to use @cite{gnatname}.
 
-Alternatively, if you want to keep your files in the 'foreign' format,
-perhaps to maintain compatibility with some other Ada compilation
-system, you can set up a procedure where you use @code{gnatchop} each
-time you compile, regarding the source files that it writes as temporary
-files that you throw away.
+Alternatively, if you want to permanently restructure a set of 'foreign'
+files so that they match the GNAT rules, and do the remaining development
+using the GNAT structure, you can simply use @code{gnatchop} once, generate the
+new set of files and work with them from that point on.
 
 Note that if your file containing multiple units starts with a byte order
 mark (BOM) specifying UTF-8 encoding, then the files generated by gnatchop


More information about the Gcc-cvs mailing list