[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 21 Nov 2003 10:46:37 +0000 (11:46 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 21 Nov 2003 10:46:37 +0000 (11:46 +0100)
2003-11-20  Jerome Guitton  <guitton@act-europe.fr>

* 5ztiitho.adb: Remove an unreferenced variable.

2003-11-20  Thomas Quinot  <quinot@act-europe.fr>

* adaint.c: For FreeBSD, use mkstemp.

2003-11-20  Arnaud Charlet  <charlet@act-europe.fr>

* gnatlbr.adb: Now reference Gnat_Static_Version_String.

2003-11-20  Robert Dewar  <dewar@gnat.com>

* bld.adb: Remove useless USE of gnatvsn

* gnatchop.adb: Minor reformatting
Clean up version handling to be more consistent

* gnatxref.adb: Minor reformatting

* gprcmd.adb: Minor reformatting
Fix output of copyright to be more consistent with other tools

2003-11-20  Vincent Celier  <celier@gnat.com>

* make.adb (Scan_Make_Args): Do not transmit --RTS= to gnatlink

2003-11-20  Sergey Rybin  <rybin@act-europe.fr>

* atree.adb (Initialize): Add initializations for global variables
used in New_Copy_Tree.

* cstand.adb (Create_Standard): Add call to Initialize_Scanner (with
Internal_Source_File as the actual).
Put the set of statements creating Any_Character before the set of
statements creating Any_Array to have Any_Character fully initialized
when it is used in creating Any_Array.

* scn.adb (Initialize_Scanner): Do not set Comes_From_Source ON and do
not call Scan in case if the actual is Internal_Source_File
Add 2003 to copyright note.

* sinput.adb (Source_First, Source_Last, Source_Text): Add code for
processing Internal_Source_File.

* types.ads: Add the constant Internal_Source_File representing the
source buffer for artificial source-code-like strings created within
the compiler (the definition of Source_File_Index is changed).

From-SVN: r73798

15 files changed:
gcc/ada/5wsystem.ads
gcc/ada/5ztiitho.adb
gcc/ada/ChangeLog
gcc/ada/adaint.c
gcc/ada/atree.adb
gcc/ada/bld.adb
gcc/ada/cstand.adb
gcc/ada/gnatchop.adb
gcc/ada/gnatlbr.adb
gcc/ada/gnatxref.adb
gcc/ada/gprcmd.adb
gcc/ada/make.adb
gcc/ada/scn.adb
gcc/ada/sinput.adb
gcc/ada/types.ads

index 9316644..4f72f04 100644 (file)
@@ -138,7 +138,7 @@ private
    Support_Long_Shifts       : constant Boolean := True;
    Suppress_Standard_Library : constant Boolean := False;
    Use_Ada_Main_Program_Name : constant Boolean := False;
-   ZCX_By_Default            : constant Boolean := False;
+   ZCX_By_Default            : constant Boolean := True;
    GCC_ZCX_Support           : constant Boolean := True;
    Front_End_ZCX_Support     : constant Boolean := False;
 
index 196c6a8..bda356e 100644 (file)
@@ -43,7 +43,6 @@ procedure Initialize_Task_Hooks is
    procedure taskCreateHookAdd (createHookFunction : FUNCPTR);
    pragma Import (C, taskCreateHookAdd, "taskCreateHookAdd");
 
-   Result : OSI.STATUS;
 begin
    taskCreateHookAdd (Register'Access);
 end Initialize_Task_Hooks;
index 118be6b..0720435 100644 (file)
@@ -1,3 +1,53 @@
+2003-11-21  Jerome Guitton  <guitton@act-europe.fr>
+
+       * 5ztiitho.adb: Remove an unreferenced variable.
+
+2003-11-21  Thomas Quinot  <quinot@act-europe.fr>
+
+       * adaint.c: For FreeBSD, use mkstemp.
+
+2003-11-21  Arnaud Charlet  <charlet@act-europe.fr>
+
+       * gnatlbr.adb: Now reference Gnat_Static_Version_String.
+
+2003-11-21  Robert Dewar  <dewar@gnat.com>
+
+       * bld.adb: Remove useless USE of gnatvsn
+
+       * gnatchop.adb: Minor reformatting
+       Clean up version handling to be more consistent
+
+       * gnatxref.adb: Minor reformatting
+
+       * gprcmd.adb: Minor reformatting
+       Fix output of copyright to be more consistent with other tools
+
+2003-11-21  Vincent Celier  <celier@gnat.com>
+
+       * make.adb (Scan_Make_Args): Do not transmit --RTS= to gnatlink
+
+2003-11-21  Sergey Rybin  <rybin@act-europe.fr>
+
+       * atree.adb (Initialize): Add initializations for global variables
+       used in New_Copy_Tree.
+
+       * cstand.adb (Create_Standard): Add call to Initialize_Scanner (with
+       Internal_Source_File as the actual).
+       Put the set of statements creating Any_Character before the set of
+       statements creating Any_Array to have Any_Character fully initialized
+       when it is used in creating Any_Array.
+
+       * scn.adb (Initialize_Scanner): Do not set Comes_From_Source ON and do
+       not call Scan in case if the actual is Internal_Source_File
+       Add 2003 to copyright note.
+
+       * sinput.adb (Source_First, Source_Last, Source_Text): Add code for
+       processing Internal_Source_File.
+
+       * types.ads: Add the constant Internal_Source_File representing the
+       source buffer for artificial source-code-like strings created within
+       the compiler (the definition of Source_File_Index is changed).
+
 2003-11-20  Arnaud Charlet  <charlet@act-europe.fr>
 
        * 35soccon.ads, 45intnam.ads, 55osinte.adb, 55osinte.ads,
index 5f4b95d..921e1d8 100644 (file)
@@ -667,7 +667,7 @@ __gnat_open_new_temp (char *path, int fmode)
 
   strcpy (path, "GNAT-XXXXXX");
 
-#if defined (linux) && !defined (__vxworks)
+#if (defined (__FreeBSD__) || defined (linux)) && !defined (__vxworks)
   return mkstemp (path);
 #elif defined (__Lynx__)
   mktemp (path);
@@ -742,7 +742,7 @@ __gnat_tmp_name (char *tmp_filename)
     free (pname);
   }
 
-#elif defined (linux)
+#elif defined (linux) || defined (__FreeBSD__)
 #define MAX_SAFE_PATH 1000
   char *tmpdir = getenv ("TMPDIR");
 
index bc4fb13..65d2056 100644 (file)
@@ -882,6 +882,11 @@ package body Atree is
       Dummy := New_Node (N_Error, No_Location);
       Set_Name1 (Error, Error_Name);
       Set_Error_Posted (Error, True);
+
+      --  Set global variables for New_Copy_Tree:
+      NCT_Hash_Tables_Used := False;
+      NCT_Table_Entries    := 0;
+      NCT_Hash_Table_Setup := False;
    end Initialize;
 
    --------------------------
index d8cf51c..492f205 100644 (file)
@@ -40,7 +40,7 @@ with GNAT.OS_Lib;               use GNAT.OS_Lib;
 
 with Erroutc;  use Erroutc;
 with Err_Vars; use Err_Vars;
-with Gnatvsn;  use Gnatvsn;
+with Gnatvsn;
 with Namet;    use Namet;
 with Opt;      use Opt;
 with Output;   use Output;
index 9cad4be..67b7a88 100644 (file)
@@ -38,6 +38,7 @@ with Targparm; use Targparm;
 with Tbuild;   use Tbuild;
 with Ttypes;   use Ttypes;
 with Ttypef;   use Ttypef;
+with Scn;
 with Sem_Mech; use Sem_Mech;
 with Sem_Util; use Sem_Util;
 with Sinfo;    use Sinfo;
@@ -259,10 +260,10 @@ package body CStand is
    --  by Initialize_Standard in the semantics module.
 
    procedure Create_Standard is
-      Decl_S : List_Id;
+      Decl_S : List_Id := New_List;
       --  List of declarations in Standard
 
-      Decl_A : List_Id;
+      Decl_A : List_Id := New_List;
       --  List of declarations in ASCII
 
       Decl       : Node_Id;
@@ -297,7 +298,9 @@ package body CStand is
    --  Start of processing for Create_Standard
 
    begin
-      Decl_S := New_List;
+      --  Initialize scanner for internal scans of literals
+
+      Scn.Initialize_Scanner (No_Unit, Internal_Source_File);
 
       --  First step is to create defining identifiers for each entity
 
@@ -414,7 +417,6 @@ package body CStand is
 
       declare
          LIS : Nat;
-
       begin
          if Debug_Flag_M then
             LIS := 64;
@@ -657,7 +659,6 @@ package body CStand is
 
       Set_Defining_Unit_Name (Pspec, Standard_Entity (S_ASCII));
       Set_Ekind (Standard_Entity (S_ASCII), E_Package);
-      Decl_A := New_List; -- for ASCII declarations
       Set_Visible_Declarations (Pspec, Decl_A);
 
       --  Create control character definitions in package ASCII. Note that
@@ -791,6 +792,18 @@ package body CStand is
       Set_Prim_Alignment    (Any_Access);
       Make_Name             (Any_Access, "an access type");
 
+      Any_Character := New_Standard_Entity;
+      Set_Ekind             (Any_Character, E_Enumeration_Type);
+      Set_Scope             (Any_Character, Standard_Standard);
+      Set_Etype             (Any_Character, Any_Character);
+      Set_Is_Unsigned_Type  (Any_Character);
+      Set_Is_Character_Type (Any_Character);
+      Init_Esize            (Any_Character, Standard_Character_Size);
+      Init_RM_Size          (Any_Character, 8);
+      Set_Prim_Alignment    (Any_Character);
+      Set_Scalar_Range      (Any_Character, Scalar_Range (Standard_Character));
+      Make_Name             (Any_Character, "a character type");
+
       Any_Array := New_Standard_Entity;
       Set_Ekind             (Any_Array, E_String_Type);
       Set_Scope             (Any_Array, Standard_Standard);
@@ -810,18 +823,6 @@ package body CStand is
       Set_Scalar_Range      (Any_Boolean, Scalar_Range (Standard_Boolean));
       Make_Name             (Any_Boolean, "a boolean type");
 
-      Any_Character := New_Standard_Entity;
-      Set_Ekind             (Any_Character, E_Enumeration_Type);
-      Set_Scope             (Any_Character, Standard_Standard);
-      Set_Etype             (Any_Character, Any_Character);
-      Set_Is_Unsigned_Type  (Any_Character);
-      Set_Is_Character_Type (Any_Character);
-      Init_Esize            (Any_Character, Standard_Character_Size);
-      Init_RM_Size          (Any_Character, 8);
-      Set_Prim_Alignment    (Any_Character);
-      Set_Scalar_Range      (Any_Character, Scalar_Range (Standard_Character));
-      Make_Name             (Any_Character, "a character type");
-
       Any_Composite := New_Standard_Entity;
       Set_Ekind             (Any_Composite, E_Array_Type);
       Set_Scope             (Any_Composite, Standard_Standard);
index 8764a86..6855454 100644 (file)
@@ -37,11 +37,6 @@ with Hostparm;
 
 procedure Gnatchop is
 
-   Cwrite : constant String :=
-              "GNATCHOP " &
-              Gnatvsn.Gnat_Version_String  &
-              " Copyright 1998-2000, Ada Core Technologies Inc.";
-
    Terminate_Program : exception;
    --  Used to terminate execution immediately
 
@@ -57,9 +52,13 @@ procedure Gnatchop is
    Gnat_Cmd : String_Access;
    --  Command to execute the GNAT compiler
 
-   Gnat_Args : Argument_List_Access   := new Argument_List'
-     (new String'("-c"), new String'("-x"), new String'("ada"),
-      new String'("-gnats"), new String'("-gnatu"));
+   Gnat_Args : Argument_List_Access :=
+                 new Argument_List'
+                   (new String'("-c"),
+                    new String'("-x"),
+                    new String'("ada"),
+                    new String'("-gnats"),
+                    new String'("-gnatu"));
    --  Arguments used in Gnat_Cmd call
 
    EOF : constant Character := Character'Val (26);
@@ -1110,6 +1109,7 @@ procedure Gnatchop is
                            else
                               Error_Msg ("-k# requires numeric parameter");
                            end if;
+
                            return False;
                         end if;
                      end loop;
@@ -1129,23 +1129,31 @@ procedure Gnatchop is
                end;
 
             when 'p' =>
-               Preserve_Mode     := True;
+               Preserve_Mode := True;
 
             when 'q' =>
-               Quiet_Mode        := True;
+               Quiet_Mode := True;
 
             when 'r' =>
                Source_References := True;
 
             when 'v' =>
-               Verbose_Mode      := True;
-               Put_Line (Standard_Error, Cwrite);
+               Verbose_Mode := True;
+
+               --  Why is following written to standard error. Most other
+               --  tools write to standard output ???
+
+               Put (Standard_Error, "GNATCHOP ");
+               Put (Standard_Error, Gnatvsn.Gnat_Version_String);
+               Put_Line
+                 (Standard_Error,
+                  " Copyright 1998-2000, Ada Core Technologies Inc.");
 
             when 'w' =>
-               Overwrite_Files   := True;
+               Overwrite_Files := True;
 
             when 'x' =>
-               Exit_On_Error     := True;
+               Exit_On_Error := True;
 
             when others =>
                null;
index b79efa1..40d5434 100644 (file)
@@ -50,7 +50,7 @@ with Osint;                use Osint;
 with System;
 
 procedure GnatLbr is
-   pragma Ident (Gnat_Version_String);
+   pragma Ident (Gnat_Static_Version_String);
 
    type Lib_Mode is (None, Create, Set, Delete);
    Next_Arg  : Integer;
index 7e42958..a7b22d6 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with Xr_Tabls;     use Xr_Tabls;
-with Xref_Lib;     use Xref_Lib;
-with Osint;        use Osint;
-with Types;        use Types;
+with Xr_Tabls; use Xr_Tabls;
+with Xref_Lib; use Xref_Lib;
+with Osint;    use Osint;
+with Types;    use Types;
 
 with Gnatvsn;
 with Opt;
@@ -35,10 +35,9 @@ with Opt;
 with Ada.Strings.Fixed; use Ada.Strings.Fixed;
 with Ada.Text_IO;       use Ada.Text_IO;
 with GNAT.Command_Line; use GNAT.Command_Line;
-with GNAT.Strings;       use GNAT.Strings;
+with GNAT.Strings;      use GNAT.Strings;
 
 procedure Gnatxref is
-
    Search_Unused   : Boolean := False;
    Local_Symbols   : Boolean := True;
    Prj_File        : File_Name_String;
@@ -209,8 +208,6 @@ procedure Gnatxref is
    -----------------
 
    procedure Write_Usage is
-      use Ada.Text_IO;
-
    begin
       Put_Line ("GNATXREF " & Gnatvsn.Gnat_Version_String
                 & " Copyright 1998-2003, Ada Core Technologies Inc.");
index 0757f47..5718e12 100644 (file)
 --    stamp        copy file time stamp from file1 to file2
 --    prefix       get the prefix of the GNAT installation
 
+with Gnatvsn;
+with Osint;   use Osint;
+with Namet;   use Namet;
+
 with Ada.Characters.Handling;   use Ada.Characters.Handling;
 with Ada.Command_Line;          use Ada.Command_Line;
 with Ada.Text_IO;               use Ada.Text_IO;
 with GNAT.OS_Lib;               use GNAT.OS_Lib;
 with GNAT.Directory_Operations; use GNAT.Directory_Operations;
 with GNAT.Regpat;               use GNAT.Regpat;
-with Gnatvsn;
-with Osint;                     use Osint;
-with Namet;                     use Namet;
+
 
 procedure Gprcmd is
 
    --  ??? comments are thin throughout this unit
 
-   Version : constant String :=
-               "GPRCMD " & Gnatvsn.Gnat_Version_String &
-               " Copyright 2002-2003, Free Software Fundation, Inc.";
 
    procedure Cat (File : String);
    --  Print the contents of file on standard output.
@@ -350,7 +349,13 @@ begin
 
    begin
       if Cmd = "-v" then
-         Put_Line (Standard_Error, Version);
+
+         --  Should this be on Standard_Error ???
+
+         Put (Standard_Error, "GPRCMD ");
+         Put (Standard_Error, Gnatvsn.Gnat_Version_String);
+         Put_Line (Standard_Error,
+                   " Copyright 2002-2003, Free Software Fundation, Inc.");
          Usage;
 
       elsif Cmd = "pwd" then
index 5b181b6..5d2a9ce 100644 (file)
@@ -6551,7 +6551,6 @@ package body Make is
          then
             Add_Switch (Argv, Compiler, And_Save => And_Save);
             Add_Switch (Argv, Binder, And_Save => And_Save);
-            Add_Switch (Argv, Linker, And_Save => And_Save);
 
             if Argv'Length <= 6 or else Argv (6) /= '=' then
                Make_Failed ("missing path for --RTS");
index 91908d3..1e829e4 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2002 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2003 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- --
@@ -264,7 +264,9 @@ package body Scn is
       --  Set default for Comes_From_Source. All nodes built now until we
       --  reenter the analyzer will have Comes_From_Source set to True
 
-      Set_Comes_From_Source_Default (True);
+      if Index /= Internal_Source_File then
+         Set_Comes_From_Source_Default (True);
+      end if;
 
       --  Check license if GNAT type header possibly present
 
@@ -278,7 +280,9 @@ package body Scn is
       --  call Scan. Scan initial token (note this initializes Prev_Token,
       --  Prev_Token_Ptr).
 
-      Scan;
+      if Index /= Internal_Source_File then
+         Scan;
+      end if;
 
       --  Clear flags for reserved words used as indentifiers
 
index 25b74a8..2ad21be 100644 (file)
@@ -1110,17 +1110,31 @@ package body Sinput is
 
    function Source_First (S : SFI) return Source_Ptr is
    begin
-      return Source_File.Table (S).Source_First;
+      if S = Internal_Source_File then
+         return Internal_Source_Ptr'First;
+      else
+         return Source_File.Table (S).Source_First;
+      end if;
    end Source_First;
 
    function Source_Last (S : SFI) return Source_Ptr is
    begin
-      return Source_File.Table (S).Source_Last;
+      if S = Internal_Source_File then
+         return Internal_Source_Ptr'Last;
+      else
+         return Source_File.Table (S).Source_Last;
+      end if;
+
    end Source_Last;
 
    function Source_Text (S : SFI) return Source_Buffer_Ptr is
    begin
-      return Source_File.Table (S).Source_Text;
+      if S = Internal_Source_File then
+         return Internal_Source_Ptr;
+      else
+         return Source_File.Table (S).Source_Text;
+      end if;
+
    end Source_Text;
 
    function Template (S : SFI) return SFI is
index a93dbb4..a2c1598 100644 (file)
@@ -569,9 +569,14 @@ pragma Preelaborate (Types);
    No_Unit : constant Unit_Number_Type := -1;
    --  Special value used to signal no unit
 
-   type Source_File_Index is new Nat;
+   type Source_File_Index is new Int range -1 .. Int'Last;
    --  Type used to index the source file table (see package Sinput)
 
+   Internal_Source_File : constant Source_File_Index :=
+                            Source_File_Index'First;
+   --  Value used to indicate the buffer for the source-code-like strings
+   --  internally created withing the compiler (see package Sinput)
+
    No_Source_File : constant Source_File_Index := 0;
    --  Value used to indicate no source file present