[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 17 Jul 2014 06:47:15 +0000 (08:47 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 17 Jul 2014 06:47:15 +0000 (08:47 +0200)
2014-07-17  Robert Dewar  <dewar@adacore.com>

* gnat_rm.texi: Document new restriction No_Long_Long_Integers.
* exp_ch4.adb (Make_Array_Comparison_Op): Add note that we
could do this by actually expanding a real generic.
* a-tags.ads: Add comments about performance.
* sprint.adb (Sprint_Node_Actual, case N_Object_Declaration):
Print Etype of defining identifier, rather than the object
definition. More information.

2014-07-17  Thomas Quinot  <quinot@adacore.com>

* exp_dist.adb: Minor documentation clarification.

2014-07-17  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_util.adb (Is_Aliased): Revert previous change.

2014-07-17  Vincent Celier  <celier@adacore.com>

* g-comlin.adb (Try_Help): New procedure.
(Getopt): Use new procedure Try_Help.
* g-comlin.ads (Try_Help): New procedure.

2014-07-17  Bob Duff  <duff@adacore.com>

* gnat_ugn.texi: Minor update.

From-SVN: r212728

24 files changed:
gcc/ada/ChangeLog
gcc/ada/a-tags.ads
gcc/ada/clean.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_dist.adb
gcc/ada/exp_util.adb
gcc/ada/g-comlin.adb
gcc/ada/g-comlin.ads
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/gnatbind.adb
gcc/ada/gnatchop.adb
gcc/ada/gnatfind.adb
gcc/ada/gnatls.adb
gcc/ada/gnatname.adb
gcc/ada/gnatxref.adb
gcc/ada/gprep.adb
gcc/ada/make.adb
gcc/ada/restrict.ads
gcc/ada/s-rident.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/sprint.adb

index f70dcf8e8f0b14b254b6f2d95993f3b160e9549f..2105a7ea78f72061d3ab29387aa4f0be44be6a11 100644 (file)
@@ -1,3 +1,31 @@
+2014-07-17  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_rm.texi: Document new restriction No_Long_Long_Integers.
+       * exp_ch4.adb (Make_Array_Comparison_Op): Add note that we
+       could do this by actually expanding a real generic.
+       * a-tags.ads: Add comments about performance.
+       * sprint.adb (Sprint_Node_Actual, case N_Object_Declaration):
+       Print Etype of defining identifier, rather than the object
+       definition. More information.
+
+2014-07-17  Thomas Quinot  <quinot@adacore.com>
+
+       * exp_dist.adb: Minor documentation clarification.
+
+2014-07-17  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * exp_util.adb (Is_Aliased): Revert previous change.
+
+2014-07-17  Vincent Celier  <celier@adacore.com>
+
+       * g-comlin.adb (Try_Help): New procedure.
+       (Getopt): Use new procedure Try_Help.
+       * g-comlin.ads (Try_Help): New procedure.
+
+2014-07-17  Bob Duff  <duff@adacore.com>
+
+       * gnat_ugn.texi: Minor update.
+
 2014-07-17  Robert Dewar  <dewar@adacore.com>
 
        * gnat_rm.texi: Improve documentation of Unrestricted_Access.
index 0a0a375c06117a6254a662649fccedbee52a55d9..9239c9985854b03e2af57174eaaf9b12595f3d33 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with System;
+--  The operations in this package provide the guarantee that all dispatching
+--  calls on primitive operations of tagged types and interfaces take constant
+--  time (in terms of source lines executed), that is to say, the cost of these
+--  calls is independent of the number of primitives of the type or interface,
+--  and independent of the number of ancestors or interface progenitors that a
+--  tagged type may have.
+
+--  The following subprograms of the public part of this package take constant
+--  time (in terms of source lines executed):
+
+--    Expanded_Name, Wide_Expanded_Name, Wide_Wide_Expanded_Name, External_Tag,
+--    Is_Descendant_At_Same_Level, Parent_Tag
+--    Descendant_Tag (when used with a library-level tagged type),
+--    Internal_Tag (when used with a library-level tagged type).
+
+--  The following subprograms of the public part of this package take non
+--  constant time (in terms of sources line executed):
+
+--    Descendant_Tag (when used with a locally defined tagged type)
+--    Internal_Tag (when used with a locally defined tagged type)
+--    Interface_Ancestor_Tagswith System
+
 with System.Storage_Elements;
 
 package Ada.Tags is
index dd216cd571887d8d6f0ba9528fc9babf275fbc14..0a7108d74a3afa10c6b4cb0c2280301153f2a1bb 100644 (file)
@@ -47,6 +47,7 @@ with Types;    use Types;
 
 with Ada.Command_Line;          use Ada.Command_Line;
 
+with GNAT.Command_Line;         use GNAT.Command_Line;
 with GNAT.Directory_Operations; use GNAT.Directory_Operations;
 with GNAT.IO;                   use GNAT.IO;
 with GNAT.OS_Lib;               use GNAT.OS_Lib;
@@ -1467,7 +1468,7 @@ package body Clean is
          if Argument_Count = 0 then
             Usage;
          else
-            Put_Line ("type ""gnatclean --help"" for help");
+            Try_Help;
          end if;
 
          return;
index 9a86fb48360f6850e63aada5fd32f7cf0964d881..3aec3b15e0e3461a08d0626e2b94f63df1aff66e 100644 (file)
@@ -11805,6 +11805,9 @@ package body Exp_Ch4 is
    --  do not need to generate an actual or formal generic part, just the
    --  instantiated function itself.
 
+   --  Perhaps we could have the actual generic available in the run-time,
+   --  obtained by rtsfind, and actually expand a real instantiation ???
+
    function Make_Array_Comparison_Op
      (Typ : Entity_Id;
       Nod : Node_Id) return Node_Id
index 9e8b32d98ca0caedcaa6042e8546176cbd42cf97..ae8a3900aecd005cb41eaba1f7b29a4826388f39 100644 (file)
@@ -2036,7 +2036,10 @@ package body Exp_Dist is
          Append_To (Decls, RPC_Receiver_Decl);
 
       else
-         --  Comments required here???
+         --  Case of RACW implementing a RAS with the GARLIC PCS: there is
+         --  no RPC receiver in that case, this is just an indication of
+         --  where to insert code in the tree (see comment in declaration of
+         --  type Stub_Structure).
 
          RPC_Receiver_Decl := Last (Decls);
       end if;
index 6eb4243bcd3cd58672c2a7d50c840b94e8b83906..acd10734d8bcab0ba0932ca4426d4c749440bbde 100644 (file)
@@ -4238,9 +4238,9 @@ package body Exp_Util is
          --  When a function call appears in Object.Operation format, the
          --  original representation has two possible forms depending on the
          --  availability of actual parameters:
-         --
-         --    Obj.Func_Call          --  N_Selected_Component
-         --    Obj.Func_Call (Param)  --  N_Indexed_Component
+
+         --    Obj.Func_Call           N_Selected_Component
+         --    Obj.Func_Call (Param)   N_Indexed_Component
 
          else
             if Nkind (Expr) = N_Indexed_Component then
@@ -4557,15 +4557,6 @@ package body Exp_Util is
       --  Start of processing for Is_Aliased
 
       begin
-         --  Aliasing in expression with actions does not matter because the
-         --  scope of the transient object is always limited by the scope of
-         --  the EWA. Such objects are always hooked and always finalized at
-         --  the end of the EWA's scope.
-
-         if Nkind (Rel_Node) = N_Expression_With_Actions then
-            return False;
-         end if;
-
          Stmt := First_Stmt;
          while Present (Stmt) loop
             if Nkind (Stmt) = N_Object_Declaration then
@@ -5295,18 +5286,34 @@ package body Exp_Util is
 
    function Is_Volatile_Reference (N : Node_Id) return Boolean is
    begin
-      if Nkind (N) in N_Has_Etype
-        and then Present (Etype (N))
-        and then Treat_As_Volatile (Etype (N))
-      then
+      --  Only source references are to be treated as volatile, internally
+      --  generated stuff cannot have volatile external effects.
+
+      if not Comes_From_Source (N) then
+         return False;
+
+      --  Never true for reference to a type
+
+      elsif Is_Entity_Name (N) and then Is_Type (Entity (N)) then
+         return False;
+
+      --  True if object reference with volatile type
+
+      elsif Is_Volatile_Object (N) then
          return True;
 
+      --  True if reference to volatile entity
+
       elsif Is_Entity_Name (N) then
          return Treat_As_Volatile (Entity (N));
 
+      --  True for slice of volatile array
+
       elsif Nkind (N) = N_Slice then
          return Is_Volatile_Reference (Prefix (N));
 
+      --  True if volatile component
+
       elsif Nkind_In (N, N_Indexed_Component, N_Selected_Component) then
          if (Is_Entity_Name (Prefix (N))
               and then Has_Volatile_Components (Entity (Prefix (N))))
@@ -5318,6 +5325,8 @@ package body Exp_Util is
             return Is_Volatile_Reference (Prefix (N));
          end if;
 
+      --  Otherwise false
+
       else
          return False;
       end if;
@@ -6844,9 +6853,7 @@ package body Exp_Util is
       --  (this happens because routines Duplicate_Subexpr_XX implicitly invoke
       --  Remove_Side_Effects).
 
-      if No (Exp_Type)
-        or else Ekind (Exp_Type) = E_Access_Attribute_Type
-      then
+      if No (Exp_Type) or else Ekind (Exp_Type) = E_Access_Attribute_Type then
          return;
 
       --  No action needed for side-effect free expressions
@@ -6913,9 +6920,12 @@ package body Exp_Util is
          Insert_Action (Exp, E);
 
       --  If the expression has the form v.all then we can just capture the
-      --  pointer, and then do an explicit dereference on the result.
+      --  pointer, and then do an explicit dereference on the result, but
+      --  this is not right if this is a volatile reference.
 
-      elsif Nkind (Exp) = N_Explicit_Dereference then
+      elsif Nkind (Exp) = N_Explicit_Dereference
+        and then not Is_Volatile_Reference (Exp)
+      then
          Def_Id := Make_Temporary (Loc, 'R', Exp);
          Res :=
            Make_Explicit_Dereference (Loc, New_Occurrence_Of (Def_Id, Loc));
@@ -6987,17 +6997,21 @@ package body Exp_Util is
       --  This is needed for correctness in the case of a volatile object of
       --  a non-volatile type because the Make_Reference call of the "default"
       --  approach would generate an illegal access value (an access value
-      --  cannot designate such an object - see Analyze_Reference). We skip
-      --  using this scheme if we have an object of a volatile type and we do
-      --  not have Name_Req set true (see comments for Side_Effect_Free).
-
-      --  In Ada 2012 a qualified expression is an object, but for purposes of
-      --  removing side effects it still need to be transformed into a separate
-      --  declaration, particularly if the expression is an aggregate.
+      --  cannot designate such an object - see Analyze_Reference).
 
       elsif Is_Object_Reference (Exp)
         and then Nkind (Exp) /= N_Function_Call
+
+        --  In Ada 2012 a qualified expression is an object, but for purposes
+        --  of removing side effects it still need to be transformed into a
+        --  separate declaration, particularly in the case of an aggregate.
+
         and then Nkind (Exp) /= N_Qualified_Expression
+
+        --  We skip using this scheme if we have an object of a volatile
+        --  type and we do not have Name_Req set true (see comments for
+        --  Side_Effect_Free).
+
         and then (Name_Req or else not Treat_As_Volatile (Exp_Type))
       then
          Def_Id := Make_Temporary (Loc, 'R', Exp);
@@ -8030,6 +8044,12 @@ package body Exp_Util is
    --  Start of processing for Side_Effect_Free
 
    begin
+      --  If volatile reference, always consider it to have side effects
+
+      if Is_Volatile_Reference (N) then
+         return False;
+      end if;
+
       --  Note on checks that could raise Constraint_Error. Strictly, if we
       --  take advantage of 11.6, these checks do not count as side effects.
       --  However, we would prefer to consider that they are side effects,
@@ -8043,12 +8063,17 @@ package body Exp_Util is
 
       if Is_Entity_Name (N) then
 
+         --  A type reference is always side effect free
+
+         if Is_Type (Entity (N)) then
+            return True;
+
          --  Variables are considered to be a side effect if Variable_Ref
          --  is set or if we have a volatile reference and Name_Req is off.
          --  If Name_Req is True then we can't help returning a name which
          --  effectively allows multiple references in any case.
 
-         if Is_Variable (N, Use_Original_Node => False) then
+         elsif Is_Variable (N, Use_Original_Node => False) then
             return not Variable_Ref
               and then (not Is_Volatile_Reference (N) or else Name_Req);
 
index 43592949a83c69b8bc71d8c55dd33d5351f12d38..d472ee52958f22359442067c3fa8730e3b11f5d0 100644 (file)
@@ -3534,10 +3534,7 @@ package body GNAT.Command_Line is
                    & ": unrecognized option '"
                    & Full_Switch (Parser)
                    & "'");
-         Put_Line (Standard_Error,
-                   "Try `"
-                   & Base_Name (Ada.Command_Line.Command_Name)
-                   & " --help` for more information.");
+         Try_Help;
 
          raise;
 
@@ -3588,4 +3585,20 @@ package body GNAT.Command_Line is
       end loop;
    end Build;
 
+   --------------
+   -- Try_Help --
+   --------------
+
+   --  Note: Any change to the message displayed should also be done in
+   --  gnatbind.adb that does not use this interface.
+
+   procedure Try_Help is
+   begin
+      Put_Line
+        (Standard_Error,
+         "try `" &
+         Base_Name (Ada.Command_Line.Command_Name) &
+         " --help` for more information.");
+   end Try_Help;
+
 end GNAT.Command_Line;
index c3bfe304b623592dc1b659addd89def86889b105..109e83638b8202a2ae308e404c34e433a81c2140 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---                     Copyright (C) 1999-2013, AdaCore                     --
+--                     Copyright (C) 1999-2014, AdaCore                     --
 --                                                                          --
 -- 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- --
@@ -1000,6 +1000,13 @@ package GNAT.Command_Line is
    --
    --  Expanded has the same meaning as in Start.
 
+   procedure Try_Help;
+   --  Output a message on standard error to indicate how to get the usage for
+   --  the executable. This procedure should only be called when the executable
+   --  accepts switch --help. When this procedure is called by executable xxx,
+   --  the following message is displayed on standard error:
+   --      try `xxx --help` for more information.
+
 private
 
    Max_Depth : constant := 100;
index 05b3cb44fe113ee8487a5696bc89be9fddd476e9..48d7ea41d2a662d18d06ffb3e977c051234da61c 100644 (file)
@@ -444,6 +444,7 @@ Partition-Wide Restrictions
 * No_Local_Allocators::
 * No_Local_Protected_Objects::
 * No_Local_Timing_Events::
+* No_Long_Long_Integers::
 * No_Nested_Finalization::
 * No_Protected_Type_Allocators::
 * No_Protected_Types::
@@ -9918,6 +9919,7 @@ then all compilation units in the partition must obey the restriction).
 * No_Local_Allocators::
 * No_Local_Protected_Objects::
 * No_Local_Timing_Events::
+* No_Long_Long_Integers::
 * No_Nested_Finalization::
 * No_Protected_Type_Allocators::
 * No_Protected_Types::
@@ -10367,6 +10369,14 @@ only declared at the library level.
 [RM D.7] All objects of type Ada.Timing_Events.Timing_Event are
 declared at the library level.
 
+@node No_Long_Long_Integers
+@unnumberedsubsec No_Long_Long_Integers
+@findex No_Long_Long_Integers
+[GNAT] This partition-wide restriction forbids any explicit reference to
+type Standard.Long_Long_Integer, and also forbids declaring range types whose
+implicit base type is Long_Long_Integer, and modular types whose size exceeds
+Long_Integer'Size.
+
 @node No_Nested_Finalization
 @unnumberedsubsec No_Nested_Finalization
 @findex No_Nested_Finalization
index 501b576caf0e2883129c4e9715d9ab4a519d8e7c..5d0c8e4d468afe62a75e3cdf58ab5afb4d78738b 100644 (file)
@@ -14620,6 +14620,13 @@ as output file.
 The output may be redirected by the following switches:
 
 @table @option
+@item ^--output-dir=@var{dir}^/OUTPUT_DIR=@var{dir}^
+@cindex @option{^--output-dir^/OUTPUT_DIR^} (@command{gnatpp})
+Generate output file in directory @file{dir} with the same name as the input
+file. If @file{dir} is the same as the directory containing the input file,
+the input file is not processed; use @option{^-rnb^/REPLACE_NO_BACKUP^}
+if you want to update the input file in place.
+
 @item ^-pipe^/STANDARD_OUTPUT^
 @cindex @option{^-pipe^/STANDARD_OUTPUT^} (@command{gnatpp})
 Send the output to @code{Standard_Output}
@@ -14745,6 +14752,13 @@ Indicates that external variable @var{name} in the argument project
 has the value @var{value}. Has no effect if no project is specified as
 tool argument.
 
+@item --incremental
+@cindex @option{--incremental} @command{gnatpp}
+Incremental processing on a per-file basis. Source files are only
+processed if they have been modified, or if files they depend on have
+been modified. This is similar to the way gnatmake/gprbuild only
+compiles files that need to be recompiled.
+
 @item --pp-off=@var{xxx}
 @cindex @option{--pp-off} @command{gnatpp}
 Use @code{--xxx} as the command to turn off pretty printing, instead
@@ -14769,14 +14783,21 @@ files.
 
 @item ^-j^/PROCESSES=^@var{n}
 @cindex @option{^-j^/PROCESSES^} (@command{gnatpp})
-Use @var{n} processes to carry out the tree creations (internal representations
-of the argument sources). On a multiprocessor machine this speeds up processing
-of big sets of argument sources. If @var{n} is 0, then the maximum number of
-parallel tree creations is the number of core processors on the platform.
-This option cannot be used together with @option{^-r^/REPLACE^},
+Without @option{--incremental}, use @var{n} processes to carry out the
+tree creations (internal representations of the argument sources). On
+a multiprocessor machine this speeds up processing of big sets of
+argument sources. If @var{n} is 0, then the maximum number of parallel
+tree creations is the number of core processors on the platform. This
+option cannot be used together with @option{^-r^/REPLACE^},
 @option{^-rf^/OVERRIDING_REPLACE^} or
 @option{^-rnb^/REPLACE_NO_BACKUP^} option.
 
+With @option{--incremental}, use @var{n} @command{gnatpp} processes to
+perform pretty-printing in parallel. @var{n} = 0 means the same as
+above. In this case, @option{^-r^/REPLACE^},
+@option{^-rf^/OVERRIDING_REPLACE^} or
+@option{^-rnb^/REPLACE_NO_BACKUP^} options are allowed.
+
 @cindex @option{^-t^/TIME^} (@command{gnatpp})
 @item ^-t^/TIME^
 Print out execution time.
@@ -15155,16 +15176,15 @@ that conforms to the schema.
 Usage:
 
 @smallexample
-gnat2xml [options] files
+gnat2xml [options] filenames [-files filename] [-cargs gcc_switches]
 @end smallexample
 
-``files'' are the Ada source file names.
-
 @noindent
-Options:
+options:
 @smallexample
 -h
 --help -- generate usage information and quit, ignoring all other options
+--version -- print version and quit, ignoring all other options
 
 -P @file{file} -- indicates the name of the project file that describes
       the set of sources to be processed. The exact set of argument
@@ -15186,25 +15206,25 @@ Options:
 --incremental -- incremental processing on a per-file basis. Source files are
       only processed if they have been modified, or if files they depend
       on have been modified. This is similar to the way gnatmake/gprbuild
-      only compiles files that need to be recompiled. You need to use a project
-      file for this to work.
+      only compiles files that need to be recompiled.
 
 --output-dir=@var{dir} -- generate one .xml file for each Ada source file, in
       directory @file{dir}. (Default is to generate the XML to standard
       output.)
 
+-I <include-dir>
+    directories to search for dependencies
+    You can also set the ADA_INCLUDE_PATH environment variable for this.
+
 --compact -- debugging version, with interspersed source, and a more
       compact representation of "sloc". This version does not conform
       to any schema.
 
--I <include-dir>
-    directories to search for dependencies
-    You can also set the ADA_INCLUDE_PATH environment variable for this.
+-files=filename - the name of a text file containing a list
+                  of Ada source files to process
 
 -q -- quiet
-
--v -- verbose (print out the command line options, and the names of
-      output files as they are generated).
+-v -- verbose
 
 -cargs ... -- options to pass to gcc
 @end smallexample
@@ -15217,7 +15237,7 @@ sources is all the immediate units of the argument project.
 Example:
 
 @smallexample
-gnat2xml -v -mxml-files *.ad[sb] -cargs -gnat2012
+gnat2xml -v -output-dir=xml-files *.ad[sb]
 @end smallexample
 
 @noindent
index 527fc4cae9d0bcf7adf2967cad9eb0e4285d926b..82da0655c4c0a8a8674afec4bd2e7d34efb3bd38 100644 (file)
@@ -672,7 +672,7 @@ begin
       if Argument_Count = 0 then
          Bindusg.Display;
       else
-         Write_Line ("type ""gnatbind --help"" for help");
+         Write_Line ("try `gnatbind --help` for more information.");
       end if;
 
       Exit_Program (E_Fatal);
index 6017c563af106a9aea143a4584609fb134270952..3d953a2ec3db00dbacc7539cfef2e4600c646bbf 100644 (file)
@@ -1251,7 +1251,7 @@ procedure Gnatchop is
          if Argument_Count = 0 then
             Usage;
          else
-            Put_Line ("type ""gnatchop --help"" for help");
+            Try_Help;
          end if;
 
          return False;
index a09df21a9282b3cfc75349a32ff2855467c668c5..adde08407fb4584243af801a2f2034b78b5f3a8a 100644 (file)
@@ -228,7 +228,7 @@ procedure Gnatfind is
                end if;
 
             when others =>
-               Put_Line ("type ""gnatfind --help"" for help");
+               Try_Help;
                raise Usage_Error;
          end case;
       end loop;
@@ -268,18 +268,18 @@ procedure Gnatfind is
       when GNAT.Command_Line.Invalid_Switch =>
          Ada.Text_IO.Put_Line ("Invalid switch : "
                                & GNAT.Command_Line.Full_Switch);
-         Put_Line ("type ""gnatfind --help"" for help");
+         Try_Help;
          raise Usage_Error;
 
       when GNAT.Command_Line.Invalid_Parameter =>
          Ada.Text_IO.Put_Line ("Parameter missing for : "
                                & GNAT.Command_Line.Full_Switch);
-         Put_Line ("type ""gnatfind --help"" for help");
+         Try_Help;
          raise Usage_Error;
 
       when Xref_Lib.Invalid_Argument =>
          Ada.Text_IO.Put_Line ("Invalid line or column in the pattern");
-         Put_Line ("type ""gnatfind --help"" for help");
+         Try_Help;
          raise Usage_Error;
    end Parse_Cmd_Line;
 
@@ -352,7 +352,7 @@ begin
       if Argument_Count = 0 then
          Write_Usage;
       else
-         Put_Line ("type ""gnatfind --help"" for help");
+         Try_Help;
          raise Usage_Error;
       end if;
    end if;
@@ -382,7 +382,7 @@ begin
       Ada.Text_IO.Put_Line ("Error: for type hierarchy output you must "
                             & "specify only one file.");
       Ada.Text_IO.New_Line;
-      Put_Line ("type ""gnatfind --help"" for help");
+      Try_Help;
       raise Usage_Error;
    end if;
 
index 4df2503bde081d476ecf98fdaf6fd16f510b31bc..4a7c2176a62dc0caa8ded3ada1b06f6632260f67 100644 (file)
@@ -47,7 +47,8 @@ with Types;       use Types;
 
 with Ada.Command_Line; use Ada.Command_Line;
 
-with GNAT.Case_Util; use GNAT.Case_Util;
+with GNAT.Command_Line; use GNAT.Command_Line;
+with GNAT.Case_Util;    use GNAT.Case_Util;
 
 procedure Gnatls is
    pragma Ident (Gnat_Static_Version_String);
@@ -1601,7 +1602,7 @@ begin
       Set_Standard_Error;
       Write_Str ("Can't use -l with another switch");
       Write_Eol;
-      Write_Line ("type ""gnatls --help"" for help");
+      Try_Help;
       Exit_Program (E_Fatal);
    end if;
 
@@ -1753,7 +1754,7 @@ begin
          if Argument_Count = 0 then
             Usage;
          else
-            Write_Line ("type ""gnatls --help"" for help");
+            Try_Help;
          end if;
       end if;
 
index efc842780c3532c1865d8c99edf84736b0e071ce..47ed2e5dad580cd44298ec7116ddc853ff6bcb1c 100644 (file)
@@ -26,6 +26,7 @@
 with Ada.Command_Line;  use Ada.Command_Line;
 with Ada.Text_IO;       use Ada.Text_IO;
 
+with GNAT.Command_Line; use GNAT.Command_Line;
 with GNAT.Dynamic_Tables;
 with GNAT.OS_Lib;       use GNAT.OS_Lib;
 
@@ -289,7 +290,7 @@ procedure Gnatname is
                       Patterns.Last
                         (Arguments.Table (Arguments.Last).Foreign_Patterns) = 0
                   then
-                     Put_Line ("type ""gnatname --help"" for help");
+                     Try_Help;
                      return;
                   end if;
 
@@ -621,8 +622,8 @@ begin
    then
       if Argument_Count = 0 then
          Usage;
-      else
-         Put_Line ("type ""gnatname --help"" for help");
+      elsif not Usage_Output then
+         Try_Help;
       end if;
 
       return;
index 2912b4f5db1815307ce795a15c61172ce6ec2869..1611ed9b30e9d05b1d8b5232ad751288440c746a 100644 (file)
@@ -210,7 +210,7 @@ procedure Gnatxref is
                end if;
 
             when others =>
-               Put_Line ("type ""gnatxref --help"" for help");
+               Try_Help;
                raise Usage_Error;
          end case;
       end loop;
@@ -227,7 +227,7 @@ procedure Gnatxref is
             if Ada.Strings.Fixed.Index (S, ":") /= 0 then
                Ada.Text_IO.Put_Line
                  ("Only file names are allowed on the command line");
-               Put_Line ("type ""gnatxref --help"" for help");
+               Try_Help;
                raise Usage_Error;
             end if;
 
@@ -240,13 +240,13 @@ procedure Gnatxref is
       when GNAT.Command_Line.Invalid_Switch =>
          Ada.Text_IO.Put_Line ("Invalid switch : "
                                & GNAT.Command_Line.Full_Switch);
-         Put_Line ("type ""gnatxref --help"" for help");
+         Try_Help;
          raise Usage_Error;
 
       when GNAT.Command_Line.Invalid_Parameter =>
          Ada.Text_IO.Put_Line ("Parameter missing for : "
                                & GNAT.Command_Line.Full_Switch);
-         Put_Line ("type ""gnatxref --help"" for help");
+         Try_Help;
          raise Usage_Error;
    end Parse_Cmd_Line;
 
@@ -304,7 +304,7 @@ begin
       if Argument_Count = 0 then
          Write_Usage;
       else
-         Put_Line ("type ""gnatxref --help"" for help");
+         Try_Help;
          raise Usage_Error;
       end if;
    end if;
index 63286cad1fc856ca5cfd91c8d5a825bbc5c3c2fb..c4bf8e91a522f7842cbcec9cc0519ca4affccaa8 100644 (file)
@@ -209,7 +209,7 @@ package body GPrep is
          if Argument_Count = 0 then
             Usage;
          else
-            Put_Line ("type ""gnatprep --help"" for help");
+            GNAT.Command_Line.Try_Help;
          end if;
 
          return;
@@ -218,7 +218,7 @@ package body GPrep is
 
          --  No output file specified, exit
 
-         Put_Line ("type ""gnatprep --help"" for help");
+         GNAT.Command_Line.Try_Help;
          return;
       end if;
 
@@ -773,7 +773,7 @@ package body GPrep is
             when GNAT.Command_Line.Invalid_Switch =>
                Write_Str ("Invalid Switch: -");
                Write_Line (GNAT.Command_Line.Full_Switch);
-               Put_Line ("type ""gnatprep --help"" for help");
+               GNAT.Command_Line.Try_Help;
                OS_Exit (1);
          end;
       end loop;
index 15b6330142910614a393b44b46b1df3d7472d15b..a426df6c63aff5eee1013cd6767d18010a90ba52 100644 (file)
@@ -73,6 +73,7 @@ with Ada.Directories;
 with Ada.Exceptions;            use Ada.Exceptions;
 
 with GNAT.Case_Util;            use GNAT.Case_Util;
+with GNAT.Command_Line;         use GNAT.Command_Line;
 with GNAT.Directory_Operations; use GNAT.Directory_Operations;
 with GNAT.Dynamic_HTables;      use GNAT.Dynamic_HTables;
 with GNAT.OS_Lib;               use GNAT.OS_Lib;
@@ -5861,7 +5862,7 @@ package body Make is
             if Argument_Count = 0 then
                Usage;
             else
-               Write_Line ("type ""gnatmake --help"" for help");
+               Try_Help;
             end if;
 
             Finish_Program (Project_Tree, E_Success);
index ef5c2c727cfa47260670cd54e8dc2566e84e3003..c71eb2b1caac855a5cddd11d749a5374e863f57e 100644 (file)
@@ -129,7 +129,7 @@ package Restrict is
       No_Implicit_Loops                  => True,
       No_Initialize_Scalars              => True,
       No_Local_Protected_Objects         => True,
-      No_Long_Long_Integer               => True,
+      No_Long_Long_Integers              => True,
       No_Protected_Type_Allocators       => True,
       No_Relative_Delay                  => True,
       No_Requeue_Statements              => True,
index 181530d117b8c8b37782c4ba5d81d4868a9126c6..3e6e25ca77b133fa7057457249901012a40f20b4 100644 (file)
@@ -124,7 +124,7 @@ package System.Rident is
       No_Local_Allocators,                       -- (RM H.4(8))
       No_Local_Timing_Events,                    -- (RM D.7(10.2/2))
       No_Local_Protected_Objects,                -- Ada 2012 (D.7(10/1.3))
-      No_Long_Long_Integer                     -- GNAT
+      No_Long_Long_Integers,                     -- GNAT
       No_Nested_Finalization,                    -- (RM D.7(4))
       No_Protected_Type_Allocators,              -- Ada 2012 (D.7 (10.3/2))
       No_Protected_Types,                        -- (RM H.4(5))
index 8c6747261241598f75b5d6f4b1a2ee5cbd612727..1a02abf2ffcb037c5d36ad75b45fc875585f163a 100644 (file)
@@ -17446,7 +17446,7 @@ package body Sem_Ch3 is
       end if;
 
       if M_Val > 2 ** Standard_Long_Integer_Size then
-         Check_Restriction (No_Long_Long_Integer, Mod_Expr);
+         Check_Restriction (No_Long_Long_Integers, Mod_Expr);
       end if;
 
       Set_Modulus (T, M_Val);
@@ -20626,7 +20626,7 @@ package body Sem_Ch3 is
             Base_Typ := Base_Type (Standard_Long_Integer);
 
          elsif Can_Derive_From (Standard_Long_Long_Integer) then
-            Check_Restriction (No_Long_Long_Integer, Def);
+            Check_Restriction (No_Long_Long_Integers, Def);
             Base_Typ := Base_Type (Standard_Long_Long_Integer);
 
          else
index d85e903419cad220d72973d062ede30683472acf..7ac496c202ddc941d5e6fbd9081a1ec26ddb408e 100644 (file)
@@ -15981,7 +15981,7 @@ package body Sem_Util is
       end if;
 
       if Val = Standard_Long_Long_Integer then
-         Check_Restriction (No_Long_Long_Integer, Post_Node);
+         Check_Restriction (No_Long_Long_Integers, Post_Node);
       end if;
 
       --  Check for violation of No_Dynamic_Attachment
index efaa63cac0c3f7e597c7c81efddd15fa0003527c..623e99228d833980a7751547ce4ef0fa473be3ae 100644 (file)
@@ -1796,7 +1796,7 @@ package Sem_Util is
    --    If restriction No_Dynamic_Attachment is set, then it checks that the
    --    entity is not one of the restricted names for this restriction.
    --
-   --    If restriction No_Long_Long_Integer is set, then it checks that the
+   --    If restriction No_Long_Long_Integers is set, then it checks that the
    --    entity is not Standard.Long_Long_Integer.
    --
    --    If restriction No_Implementation_Identifiers is set, then it checks
index 8e33462d3445e3ee112c3b956d10353f7094cd66..f2ad1ec6f451d7fb1921b89bc0b237b456584855 100644 (file)
@@ -2247,7 +2247,15 @@ package body Sprint is
                      Write_Str_With_Col_Check ("not null ");
                   end if;
 
-                  Sprint_Node (Object_Definition (Node));
+                  --  Print type, we used to print the Object_Definition from
+                  --  the node, but it is much more useful to print the Etype
+                  --  of the defining identifier. For example, this will be a
+                  --  clear reference to the Itype with the bounds in the case
+                  --  of an unconstrained array type like String. The object
+                  --  after all is constrained, even if its nominal subtype is
+                  --  unconstrained.
+
+                  Sprint_Node (Etype (Def_Id));
 
                   if Present (Expression (Node)) then
                      Write_Str (" := ");