]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
a-reatim.adb: Documentation addition
authorRobert Dewar <dewar@adacore.com>
Wed, 6 Jun 2007 10:52:32 +0000 (12:52 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Jun 2007 10:52:32 +0000 (12:52 +0200)
2007-04-20  Robert Dewar  <dewar@adacore.com>

* a-reatim.adb: Documentation addition

* g-cgideb.adb: Minor code reorganization

* tree_io.adb, treepr.adb, cstand.adb, krunch.adb, par.adb,
mdll-utl.adb, par-ch5.adb, par-tchk.adb, s-exctab.ads, s-memory.ads,
s-osprim.ads, s-restri.ads, s-soflin.ads: Minor reformatting.

* debug.ads, debug.adb (Get_Debug_Flag_K): Remove unused obsolete
function.  Change name New_Scope to Push_Scope
(Get_Debug_Flag_K): Remove unused obsolete function.

* exp_ch8.adb, inline.adb, sem_ch8.ads: Change name New_Scope to
Push_Scope.

* makeusg.adb: Update Copyright notice
Add line for switch -aP

* makeusg.adb: Fix wording of some usage messages

* s-assert.adb (Raise_Assert_Failure): Add call to
Debug_Raise_Assert_Failure.

* s-unstyp.ads (type Packed_Bytes2): Change alignment to use 'Min
(2, Standard'Alignment) for compatibility with AAMP (where alignment
is restricted to 1).

* s-wchjis.adb: Remove use of System.Pure_Exceptions

* tbuild.ads, tbuild.adb (Make_Implicit_Exception_Handler): Set the
node location to No_Location when we're not debugging the expanded
code.

From-SVN: r125478

26 files changed:
gcc/ada/a-reatim.adb
gcc/ada/cstand.adb
gcc/ada/debug.adb
gcc/ada/debug.ads
gcc/ada/exp_ch8.adb
gcc/ada/g-cgideb.adb
gcc/ada/inline.adb
gcc/ada/krunch.adb
gcc/ada/makeusg.adb
gcc/ada/mdll-utl.adb
gcc/ada/par-ch5.adb
gcc/ada/par-tchk.adb
gcc/ada/par.adb
gcc/ada/s-assert.adb
gcc/ada/s-exctab.ads
gcc/ada/s-memory.ads
gcc/ada/s-osprim.ads
gcc/ada/s-restri.ads
gcc/ada/s-soflin.ads
gcc/ada/s-unstyp.ads
gcc/ada/s-wchjis.adb
gcc/ada/sem_ch8.ads
gcc/ada/tbuild.adb
gcc/ada/tbuild.ads
gcc/ada/tree_io.adb
gcc/ada/treepr.adb

index 1049c10dd15fc92a37d83d0218b75d691dbc993a..2ca4472a5eaef0a7740c457d58405153d256c57d 100644 (file)
@@ -241,6 +241,11 @@ package body Ada.Real_Time is
 
    function To_Time_Span (D : Duration) return Time_Span is
    begin
+      --  Note regarding AI-00432 requiring range checking on this conversion.
+      --  In almost all versions of GNAT (and all to which this version of the
+      --  Ada.Real_Time package apply), the range of Time_Span and Duration are
+      --  the same, so there is no issue of overflow.
+
       return Time_Span (D);
    end To_Time_Span;
 
index fecaa2a34ab5669ddbd66e5fff69cb6f404077ec..565c36870e66bf1be14f6420c146cde1b9bba307 100644 (file)
@@ -430,7 +430,7 @@ package body CStand is
       --    range False .. True
 
       --  where the occurrences of the literals must point to the
-      --  corresponding  definition.
+      --  corresponding definition.
 
       R_Node := New_Node (N_Range, Stloc);
       B_Node := New_Node (N_Identifier, Stloc);
index e0823fa70c54e33ffb6b13c2b37550ca22744d2e..1ddd1f6ded88b1c51100dbf1638a6d151a61fdf0 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -326,7 +326,7 @@ package body Debug is
    --       an interepretation is incompatible with the context.
 
    --  dw   Write semantic scope stack messages. Each time a scope is created
-   --       or removed, a message is output (see the Sem_Ch8.New_Scope and
+   --       or removed, a message is output (see the Sem_Ch8.Push_Scope and
    --       Sem_Ch8.Pop_Scope subprograms).
 
    --  dx   Force expansion on, even if no code being generated. Normally the
@@ -604,15 +604,6 @@ package body Debug is
    --  dw  Prints the list of units withed by the unit currently explored
    --      during the main loop of Make.Compile_Sources.
 
-   ----------------------
-   -- Get_Debug_Flag_K --
-   ----------------------
-
-   function Get_Debug_Flag_K return Boolean is
-   begin
-      return Debug_Flag_K;
-   end Get_Debug_Flag_K;
-
    --------------------
    -- Set_Debug_Flag --
    --------------------
index 2a1ae50ce978f64c415959665ae141585cd68550..4c7bd51876ab398173ea70ce594cb7f4c16005be 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -179,10 +179,6 @@ package Debug is
    Debug_Flag_Dot_8 : Boolean := False;
    Debug_Flag_Dot_9 : Boolean := False;
 
-   function Get_Debug_Flag_K return Boolean;
-   --  This function is called from C code to get the setting of the K flag
-   --  (it does not work to try to access a constant object directly).
-
    procedure Set_Debug_Flag (C : Character; Val : Boolean := True);
    --  Where C is 0-9, A-Z, or a-z, sets the corresponding debug flag to
    --  the given value. In the checks off version of debug, the call to
index 03408a77c075946513349f92a37f7fe4a571f622..6a00a3b73b5954a73ef279778b839cfca8143873 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -310,7 +310,7 @@ package body Exp_Ch8 is
                Aux : constant Node_Id := Aux_Decls_Node (Parent (N));
 
             begin
-               New_Scope (Standard_Standard);
+               Push_Scope (Standard_Standard);
 
                if No (Actions (Aux)) then
                   Set_Actions (Aux, New_List (Decl));
index 6b8020fb4cad0482c536c3ea6b3a06fdd704b89e..c3a0945c67c43f96453cbfa6a2274b41e06bd32f 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                     Copyright (C) 2000-2006, AdaCore                     --
+--                     Copyright (C) 2000-2007, 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- --
@@ -131,12 +131,11 @@ package body GNAT.CGI.Debug is
          Result : Unbounded_String;
 
       begin
-         Result := Result
-           & Title (Mode, "CGI complete runtime environment");
-
-         Result := Result
-           & Header (Mode, "CGI parameters:")
-           & New_Line (Mode);
+         Result :=
+           To_Unbounded_String
+             (Title (Mode, "CGI complete runtime environment")
+              & Header (Mode, "CGI parameters:")
+              & New_Line (Mode));
 
          for K in 1 .. Argument_Count loop
             Result := Result
index f39bbbaf34483b0885947c9ff39b64c426bf3fc4..c9b43ba187cffa984c7dd2fa0d66af70095e6dab 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -33,6 +33,7 @@ with Exp_Tss;  use Exp_Tss;
 with Fname;    use Fname;
 with Fname.UF; use Fname.UF;
 with Lib;      use Lib;
+with Namet;    use Namet;
 with Nlists;   use Nlists;
 with Opt;      use Opt;
 with Sem_Ch8;  use Sem_Ch8;
@@ -246,12 +247,24 @@ package body Inline is
       -----------------
 
       function Must_Inline return Boolean is
-         Scop : Entity_Id := Current_Scope;
+         Scop : Entity_Id;
          Comp : Node_Id;
 
       begin
          --  Check if call is in main unit
 
+         Scop := Current_Scope;
+
+         --  Do not try to inline if scope is standard. This could happen, for
+         --  example, for a call to Add_Global_Declaration, and it causes
+         --  trouble to try to inline at this level.
+
+         if Scop = Standard_Standard then
+            return False;
+         end if;
+
+         --  Otherwise lookup scope stack to outer scope
+
          while Scope (Scop) /= Standard_Standard
            and then not Is_Child_Unit (Scop)
          loop
@@ -259,7 +272,6 @@ package body Inline is
          end loop;
 
          Comp := Parent (Scop);
-
          while Nkind (Comp) /= N_Compilation_Unit loop
             Comp := Parent (Comp);
          end loop;
@@ -271,8 +283,7 @@ package body Inline is
             return True;
          end if;
 
-         --  Call is not in main unit. See if it's in some inlined
-         --  subprogram.
+         --  Call is not in main unit. See if it's in some inlined subprogram
 
          Scop := Current_Scope;
          while Scope (Scop) /= Standard_Standard
@@ -289,7 +300,6 @@ package body Inline is
          end loop;
 
          return False;
-
       end Must_Inline;
 
    --  Start of processing for Add_Inlined_Body
@@ -563,7 +573,7 @@ package body Inline is
       Analyzing_Inlined_Bodies := False;
 
       if Serious_Errors_Detected = 0 then
-         New_Scope (Standard_Standard);
+         Push_Scope (Standard_Standard);
 
          J := 0;
          while J <= Inlined_Bodies.Last
@@ -609,7 +619,7 @@ package body Inline is
                         Error_Msg_N
                           ("one or more inlined subprograms accessed in $!",
                            Comp_Unit);
-                        Error_Msg_Name_1 :=
+                        Error_Msg_File_1 :=
                           Get_File_Name (Bname, Subunit => False);
                         Error_Msg_N ("\but file{ was not found!", Comp_Unit);
                         raise Unrecoverable_Error;
@@ -860,7 +870,7 @@ package body Inline is
             end if;
          end if;
 
-         New_Scope (Scop);
+         Push_Scope (Scop);
          Expand_Cleanup_Actions (Decl);
          End_Scope;
 
@@ -935,7 +945,7 @@ package body Inline is
       if Serious_Errors_Detected = 0 then
 
          Expander_Active := (Operating_Mode = Opt.Generate_Code);
-         New_Scope (Standard_Standard);
+         Push_Scope (Standard_Standard);
          To_Clean := New_Elmt_List;
 
          if Is_Generic_Unit (Cunit_Entity (Main_Unit)) then
index f15a7a6bdda40d3a97204940afa59fad3c4e45b0..bb6326e06f80cd706b3b0fc7d71d67bf97fc93d0 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -130,7 +130,7 @@ begin
      and then (B1 = 'a' or else B1 = 'g' or else B1 = 'i' or else B1 = 's')
      and then Len <= Maxlen
    then
-      --  When VMS is the host, it is always also the target.
+      --  When VMS is the host, it is always also the target
 
       if Hostparm.OpenVMS or else VMS_On_Target then
          Len := Len + 1;
index 027a4cfa47339890938ff9e98fd24cb6685d8153..a61bf07895f09feaf5fdc564436cefcaaf063e4c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -203,17 +203,17 @@ begin
 
    --  Line for -we
 
-   Write_Str ("  -we      treat all Warnings as Errors");
+   Write_Str ("  -we      Treat all warnings as errors");
    Write_Eol;
 
    --  Line for -wn
 
-   Write_Str ("  -wn      Normal Warning mode (cancels -we/-ws)");
+   Write_Str ("  -wn      Normal warning mode (cancels -we/-ws)");
    Write_Eol;
 
    --  Line for -ws
 
-   Write_Str ("  -ws      Suppress all Warnings");
+   Write_Str ("  -ws      Suppress all warnings");
    Write_Eol;
 
    --  Line for -x
@@ -246,7 +246,12 @@ begin
 
    --  Source and Library search path switches
 
-   Write_Str ("Source and Library search path switches:");
+   Write_Str ("Project, Source and Library search path switches:");
+   Write_Eol;
+
+   --  Line for -aP
+
+   Write_Str ("  -aPdir    Add directory dir to project search path");
    Write_Eol;
 
    --  Line for -aL
index 7939199d206cafac6aa7fc336bf617321d63611b..294bbc101a360d98d1a1700c9c2a7bbcf142dc47 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -100,6 +100,7 @@ package body MDLL.Utl is
       Bas_Opt    : aliased String := "--base-file";
       Bas_V      : aliased String := Base_File;
       No_Suf_Opt : aliased String := "-k";
+
    begin
       Arguments (1 .. 4) := (1 => Def_Opt'Unchecked_Access,
                              2 => Def_V'Unchecked_Access,
@@ -141,7 +142,6 @@ package body MDLL.Utl is
          Exceptions.Raise_Exception
            (Tools_Error'Identity, Dlltool_Name & " execution error.");
       end if;
-
    end Dlltool;
 
    ---------
@@ -286,7 +286,7 @@ package body MDLL.Utl is
          --  Delete binder files
          declare
             Base_Name : constant String :=
-              Directory_Operations.Base_Name (Ali, ".ali");
+                          Directory_Operations.Base_Name (Ali, ".ali");
          begin
             OS_Lib.Delete_File ("b~" & Base_Name & ".ads", Success);
             OS_Lib.Delete_File ("b~" & Base_Name & ".adb", Success);
index 17c546de144fc8cb08c5efcdf46b30921878ac16..bab2637150e7b158f20f0dfbf07ec81e3eff1ff3 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -602,8 +602,8 @@ package body Ch5 is
                         Statement_Required := False;
 
                      --  A slash following an identifier or a selected
-                     --  component in this situation is most likely a
-                     --  period (have a look at the keyboard :-)
+                     --  component in this situation is most likely a period
+                     --  (see location of keys on keyboard).
 
                      elsif Token = Tok_Slash
                        and then (Nkind (Name_Node) = N_Identifier
index 01ade90ee8167e649ce8be897ae41f8fbb73fe1b..a87d6a09f9a5bd2a41f322848815e6f4627fe2df 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -417,26 +417,25 @@ package body Tchk is
          return;
 
       --  An interesting little kludge here. If the previous token is a
-      --  semicolon, then there is no way that we can legitimately need
-      --  another semicolon. This could only arise in an error situation
-      --  where an error has already been signalled. By simply ignoring
-      --  the request for a semicolon in this case, we avoid some spurious
-      --  missing semicolon messages.
+      --  semicolon, then there is no way that we can legitimately need another
+      --  semicolon. This could only arise in an error situation where an error
+      --  has already been signalled. By simply ignoring the request for a
+      --  semicolon in this case, we avoid some spurious missing semicolon
+      --  messages.
 
       elsif Prev_Token = Tok_Semicolon then
          return;
 
-      --  If the current token is | then this is a reasonable
-      --  place to suggest the possibility of a "C" confusion :-)
+      --  If the current token is | then this is a reasonable place to suggest
+      --  the possibility of a "C" confusion.
 
       elsif Token = Tok_Vertical_Bar then
          Error_Msg_SC ("unexpected occurrence of ""'|"", did you mean OR'?");
          Resync_Past_Semicolon;
          return;
 
-      --  Deal with pragma. If pragma is not at start of line, it is
-      --  considered misplaced otherwise we treat it as a normal
-      --  missing semicolong case.
+      --  Deal with pragma. If pragma is not at start of line, it is considered
+      --  misplaced otherwise we treat it as a normal missing semicolong case.
 
       elsif Token = Tok_Pragma
         and then not Token_Is_At_Start_Of_Line
index bebc66970fd289f1a5e1d01deea5ac4b66b6b33a..f33d8addd259003d117311fbb9abb8d2832d226f 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -184,7 +184,7 @@ is
    --   of such a nested region. Again, like case 2, this causes us to miss
    --   some nested cases, but it doesn't seen worth the effort to stack and
    --   unstack the SIS information. Maybe we will reconsider this if we ever
-   --   get a complaint about a missed case :-)
+   --   get a complaint about a missed case.
 
    --   4. We encounter a valid pragma INTERFACE or IMPORT that effectively
    --   supplies the missing body. In this case we reset the entry.
index 17a0a7ef967c5963393805391fe1614929fc23fe..8123e6ca18150007e2d615d1250d732a1da05cf7 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2005 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.          --
 --                                                                          --
 -- 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- --
@@ -32,6 +32,7 @@
 ------------------------------------------------------------------------------
 
 with Ada.Exceptions;
+with System.Exceptions;
 
 package body System.Assertions is
 
@@ -41,6 +42,7 @@ package body System.Assertions is
 
    procedure Raise_Assert_Failure (Msg : String) is
    begin
+      System.Exceptions.Debug_Raise_Assert_Failure;
       Ada.Exceptions.Raise_Exception (Assert_Failure'Identity, Msg);
    end Raise_Assert_Failure;
 
index a1bcde8c5a830a8e5c24a74e10be91b58febfce9..db0f392f19e6628f86a7cf044e697b8fe5fdc6e9 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1996-2005 Free Software Foundation, Inc.          --
+--          Copyright (C) 1996-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -62,7 +62,7 @@ package System.Exception_Table is
    --  does not exist yet, null is returned.
 
    function Registered_Exceptions_Count return Natural;
-   --  Return the number of currently registered exceptions.
+   --  Return the number of currently registered exceptions
 
    type Exception_Data_Array is array (Natural range <>)
      of SSL.Exception_Data_Ptr;
@@ -70,6 +70,6 @@ package System.Exception_Table is
    procedure Get_Registered_Exceptions
      (List : out Exception_Data_Array;
       Last : out Integer);
-   --  Return the list of registered exceptions.
+   --  Return the list of registered exceptions
 
 end System.Exception_Table;
index 8cbca408bbf4ade8c99209b1456b1ae493767a80..87b28ace46c3031ffa4842e084e0bc8d852ef89a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2001-2003 Free Software Foundation, Inc.          --
+--          Copyright (C) 2001-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -75,8 +75,7 @@ package System.Memory is
 
    function Realloc
      (Ptr  : System.Address;
-      Size : size_t)
-      return System.Address;
+      Size : size_t) return System.Address;
    --  This is the low level reallocation routine. It takes an existing
    --  block address returned by a previous call to Alloc or Realloc,
    --  and reallocates the block. The size can either be increased or
index 917f109ad3bcb1c16db4f63c803d444a75ac2a85..6259c8a12d04790ec2280c701c55447f5e540c1c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  S p e c                                 --
 --                                                                          --
---          Copyright (C) 1998-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1998-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNARL 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- --
@@ -47,7 +47,7 @@ package System.OS_Primitives is
                                         Duration'Last);
    --  Max of half a year delay, needed to prevent exceptions for large delay
    --  values. It seems unlikely that any test will notice this restriction,
-   --  except in the case of applications setting the clock at at run time (see
+   --  except in the case of applications setting the clock at run time (see
    --  s-tastim.adb). Also note that a larger value might cause problems (e.g
    --  overflow, or more likely OS limitation in the primitives used). In the
    --  case where half a year is too long (which occurs in high integrity mode
index d56a19f53642ce49064f1ab61197b1050987c0e7..f1909e3cc5c177bc607da78216f368cdca98fbb4 100644 (file)
@@ -44,6 +44,7 @@ with System.Rident;
 
 package System.Restrictions is
    pragma Preelaborate;
+
    pragma Discard_Names;
    package Rident is new System.Rident;
 
index 6da5c586a9c044d7ef68571b76c251fe4961de71..bc78052904e84d372a6d39e334f928e21c910467 100644 (file)
@@ -52,8 +52,7 @@ package System.Soft_Links is
 
    function Current_Target_Exception return EO;
    pragma Import
-     (Ada, Current_Target_Exception,
-      "__gnat_current_target_exception");
+     (Ada, Current_Target_Exception, "__gnat_current_target_exception");
    --  Import this subprogram from the private part of Ada.Exceptions
 
    --  First we have the access subprogram types used to establish the links.
index 2b813ef4d4284288354b98ac72011ed6508e7041..8207469a4d73404332dc14e4017e1ace3bebbf8b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2005 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -63,24 +63,24 @@ package System.Unsigned_Types is
    --  for details.
 
    type Packed_Bytes2 is new Packed_Bytes1;
-   for Packed_Bytes2'Alignment use 2;
+   for Packed_Bytes2'Alignment use Integer'Min (2, Standard'Maximum_Alignment);
    --  This is the type used to implement packed arrays where an alignment
-   --  of 2 is helpful for maximum efficiency of the get and set routines
-   --  in the corresponding library unit. This is true of all component
-   --  sizes that are even but not divisible by 4 (other than 2 for which
-   --  we use direct masking operations). In such cases, the clusters can
-   --  be assumed to be 2-byte aligned if the array is aligned. See for
+   --  of 2 (is possible) is helpful for maximum efficiency of the get and
+   --  set routines in the corresponding library unit. This is true of all
+   --  component sizes that are even but not divisible by 4 (other than 2 for
+   --  which we use direct masking operations). In such cases, the clusters
+   --  can be assumed to be 2-byte aligned if the array is aligned. See for
    --  example System.Pack_10 in file s-pack10).
 
    type Packed_Bytes4 is new Packed_Bytes1;
    for Packed_Bytes4'Alignment use Integer'Min (4, Standard'Maximum_Alignment);
    --  This is the type used to implement packed arrays where an alignment
-   --  of 4 is helpful for maximum efficiency of the get and set routines
-   --  in the corresponding library unit. This is true of all component
-   --  sizes that are divisible by 4 (other than powers of 2, which are
-   --  either handled by direct masking or not packed at all). In such cases
-   --  the clusters can be assumed to be 4-byte aligned if the array is
-   --  aligned (see System.Pack_12 in file s-pack12 as an example).
+   --  of 4 (if possible) is helpful for maximum efficiency of the get and
+   --  set routines in the corresponding library unit. This is true of all
+   --  component sizes that are divisible by 4 (other than powers of 2, which
+   --  are either handled by direct masking or not packed at all). In such
+   --  cases the clusters can be assumed to be 4-byte aligned if the array
+   --  is aligned (see System.Pack_12 in file s-pack12 as an example).
 
    type Bits_1 is mod 2**1;
    type Bits_2 is mod 2**2;
@@ -92,128 +92,103 @@ package System.Unsigned_Types is
 
    function Shift_Left
      (Value  : Short_Short_Unsigned;
-      Amount : Natural)
-      return   Short_Short_Unsigned;
+      Amount : Natural) return Short_Short_Unsigned;
 
    function Shift_Right
      (Value  : Short_Short_Unsigned;
-      Amount : Natural)
-      return   Short_Short_Unsigned;
+      Amount : Natural) return Short_Short_Unsigned;
 
    function Shift_Right_Arithmetic
      (Value  : Short_Short_Unsigned;
-      Amount : Natural)
-      return   Short_Short_Unsigned;
+      Amount : Natural) return Short_Short_Unsigned;
 
    function Rotate_Left
      (Value  : Short_Short_Unsigned;
-      Amount : Natural)
-      return   Short_Short_Unsigned;
+      Amount : Natural) return Short_Short_Unsigned;
 
    function Rotate_Right
      (Value  : Short_Short_Unsigned;
-      Amount : Natural)
-      return   Short_Short_Unsigned;
+      Amount : Natural) return Short_Short_Unsigned;
 
    function Shift_Left
      (Value  : Short_Unsigned;
-      Amount : Natural)
-      return   Short_Unsigned;
+      Amount : Natural) return Short_Unsigned;
 
    function Shift_Right
      (Value  : Short_Unsigned;
-      Amount : Natural)
-      return   Short_Unsigned;
+      Amount : Natural) return Short_Unsigned;
 
    function Shift_Right_Arithmetic
      (Value  : Short_Unsigned;
-      Amount : Natural)
-      return   Short_Unsigned;
+      Amount : Natural) return Short_Unsigned;
 
    function Rotate_Left
      (Value  : Short_Unsigned;
-      Amount : Natural)
-      return   Short_Unsigned;
+      Amount : Natural) return Short_Unsigned;
 
    function Rotate_Right
      (Value  : Short_Unsigned;
-      Amount : Natural)
-      return   Short_Unsigned;
+      Amount : Natural) return Short_Unsigned;
 
    function Shift_Left
      (Value  : Unsigned;
-      Amount : Natural)
-     return    Unsigned;
+      Amount : Natural) return Unsigned;
 
    function Shift_Right
      (Value  : Unsigned;
-      Amount : Natural)
-      return   Unsigned;
+      Amount : Natural) return Unsigned;
 
    function Shift_Right_Arithmetic
      (Value  : Unsigned;
-      Amount : Natural)
-      return   Unsigned;
+      Amount : Natural) return Unsigned;
 
    function Rotate_Left
      (Value  : Unsigned;
-      Amount : Natural)
-      return   Unsigned;
+      Amount : Natural) return Unsigned;
 
    function Rotate_Right
      (Value  : Unsigned;
-      Amount : Natural)
-      return   Unsigned;
+      Amount : Natural) return Unsigned;
 
    function Shift_Left
      (Value  : Long_Unsigned;
-      Amount : Natural)
-     return    Long_Unsigned;
+      Amount : Natural) return Long_Unsigned;
 
    function Shift_Right
      (Value  : Long_Unsigned;
-      Amount : Natural)
-      return   Long_Unsigned;
+      Amount : Natural) return Long_Unsigned;
 
    function Shift_Right_Arithmetic
      (Value  : Long_Unsigned;
-      Amount : Natural)
-      return   Long_Unsigned;
+      Amount : Natural) return Long_Unsigned;
 
    function Rotate_Left
      (Value  : Long_Unsigned;
-      Amount : Natural)
-      return   Long_Unsigned;
+      Amount : Natural) return Long_Unsigned;
 
    function Rotate_Right
      (Value  : Long_Unsigned;
-      Amount : Natural)
-      return   Long_Unsigned;
+      Amount : Natural) return Long_Unsigned;
 
    function Shift_Left
      (Value  : Long_Long_Unsigned;
-      Amount : Natural)
-     return    Long_Long_Unsigned;
+      Amount : Natural) return Long_Long_Unsigned;
 
    function Shift_Right
      (Value  : Long_Long_Unsigned;
-      Amount : Natural)
-      return   Long_Long_Unsigned;
+      Amount : Natural) return Long_Long_Unsigned;
 
    function Shift_Right_Arithmetic
      (Value  : Long_Long_Unsigned;
-      Amount : Natural)
-      return   Long_Long_Unsigned;
+      Amount : Natural) return Long_Long_Unsigned;
 
    function Rotate_Left
      (Value  : Long_Long_Unsigned;
-      Amount : Natural)
-      return   Long_Long_Unsigned;
+      Amount : Natural) return Long_Long_Unsigned;
 
    function Rotate_Right
      (Value  : Long_Long_Unsigned;
-      Amount : Natural)
-      return   Long_Long_Unsigned;
+      Amount : Natural) return Long_Long_Unsigned;
 
    pragma Import (Intrinsic, Shift_Left);
    pragma Import (Intrinsic, Shift_Right);
index 079712f97b783369a321a9c13a880b99315e83e8..e18d22da3d07a1d01d15b661c7007d9efdfe2a7b 100644 (file)
@@ -31,8 +31,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with System.Pure_Exceptions; use System.Pure_Exceptions;
-
 package body System.WCh_JIS is
 
    type Byte is mod 256;
@@ -86,7 +84,7 @@ package body System.WCh_JIS is
          --  bit is set in both bytes.
 
          if JIS2 < 16#80# then
-            Raise_Exception (CE, "invalid small Katakana character");
+            raise Constraint_Error;
          end if;
 
          EUC1 := Character'Val (EUC_Hankaku_Kana);
@@ -96,7 +94,7 @@ package body System.WCh_JIS is
       --  a valid character for representation in EUC form.
 
       elsif JIS1 > 16#7F# or else JIS2 > 16#7F# then
-         Raise_Exception (CE, "wide character value out of EUC range");
+         raise Constraint_Error;
 
       --  Result is just the two characters with upper bits set
 
index 1439a8886b0c1655973c8921fc80d9f64cadf658..6e3f834438ba3cfe53b6cce540ba826d5ac11efe 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2004 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -122,7 +122,7 @@ package Sem_Ch8 is
    --  S is the entity of a scope. This function determines if this scope
    --  is currently open (i.e. it appears somewhere in the scope stack).
 
-   procedure New_Scope (S : Entity_Id);
+   procedure Push_Scope (S : Entity_Id);
    --  Make new scope stack entry, pushing S, the entity for a scope
    --  onto the top of the scope table. The current setting of the scope
    --  suppress flags is saved for restoration on exit.
index 543379079d122ce6cf40cda240c9078e264c4a4b..040fa9e5611f652aefdc1945eb5e9c4f0bbbbd12 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.        --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -28,9 +28,9 @@ with Atree;    use Atree;
 with Einfo;    use Einfo;
 with Elists;   use Elists;
 with Lib;      use Lib;
-with Namet;    use Namet;
 with Nlists;   use Nlists;
 with Nmake;    use Nmake;
+with Opt;      use Opt;
 with Restrict; use Restrict;
 with Rident;   use Rident;
 with Sinfo;    use Sinfo;
@@ -209,10 +209,32 @@ package body Tbuild is
       Exception_Choices : List_Id;
       Statements        : List_Id) return Node_Id
    is
-      Handler : constant Node_Id :=
-                  Make_Exception_Handler
-                    (Sloc, Choice_Parameter, Exception_Choices, Statements);
+      Handler : Node_Id;
+      Loc     : Source_Ptr;
+
    begin
+      --  Set the source location only when debugging the expanded code
+
+      --  When debugging the source code directly, we do not want the compiler
+      --  to associate this implicit exception handler with any specific source
+      --  line, because it can potentially confuse the debugger. The most
+      --  damaging situation would arise when the debugger tries to insert a
+      --  breakpoint at a certain line. If the code of the associated implicit
+      --  exception handler is generated before the code of that line, then the
+      --  debugger will end up inserting the breakpoint inside the exception
+      --  handler, rather than the code the user intended to break on. As a
+      --  result, it is likely that the program will not hit the breakpoint
+      --  as expected.
+
+      if Debug_Generated_Code then
+         Loc := Sloc;
+      else
+         Loc := No_Location;
+      end if;
+
+      Handler :=
+        Make_Exception_Handler
+          (Loc, Choice_Parameter, Exception_Choices, Statements);
       Set_Local_Raise_Statements (Handler, No_Elist);
       return Handler;
    end Make_Implicit_Exception_Handler;
index 67fe5a1d153f58920161639a066c8467c115916e..171e5a00815fd8df2d5bc779d9ac5bf545700a3f 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -27,6 +27,7 @@
 --  This package contains various utility procedures to assist in
 --  building specific types of tree nodes.
 
+with Namet; use Namet;
 with Types; use Types;
 
 package Tbuild is
index 95c48d4505944148de857fcb08921c88925d166b..b62fb8e2bb2aceef1e3b1ba09a9ce34d55c3486b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2002 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -448,6 +448,10 @@ package body Tree_IO is
       procedure Write_Non_Compressed_Sequence;
       --  Output currently collected sequence of non-compressible data
 
+      -----------------------------------
+      -- Write_Non_Compressed_Sequence --
+      -----------------------------------
+
       procedure Write_Non_Compressed_Sequence is
       begin
          if NC > 0 then
index 4c26fd6ca810cbe0062b3818c6cf025513bbab48..7b1268d8c60a3cbe281c8c2996218596fbbda26b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -1004,9 +1004,7 @@ package body Treepr is
          --  Print Etype field if present (printing of this field for entities
          --  is handled by the Print_Entity_Info procedure).
 
-         if Nkind (N) in N_Has_Etype
-           and then Present (Etype (N))
-         then
+         if Nkind (N) in N_Has_Etype and then Present (Etype (N)) then
             Print_Str (Prefix_Str_Char);
             Print_Str ("Etype = ");
             Print_Node_Ref (Etype (N));