]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
osint.adb (Create_Debug_File): When an object file is specified...
authorGeert Bosch <bosch@gcc.gnu.org>
Sun, 16 Dec 2001 00:56:17 +0000 (01:56 +0100)
committerGeert Bosch <bosch@gcc.gnu.org>
Sun, 16 Dec 2001 00:56:17 +0000 (01:56 +0100)
* osint.adb(Create_Debug_File): When an object file is specified,
put the .dg file in the same directory as the object file.

* osint.adb: Minor reformatting

* lib-xref.adb (Output_Instantiation): New procedure to generate
instantiation references.

* lib-xref.ads: Add documentation of handling of generic references.

* ali.adb (Read_Instantiation_Ref): New procedure to read
instantiation references

* ali.ads: Add spec for storing instantiation references

* bindusg.adb: Minor reformatting

* switch.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)

* usage.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)

* gnatcmd.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)

* csets.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)

* csets.ads:
Fix header format
Add 2001 to copyright date
Add entry for Latin-5 (Cyrillic ISO-8859-5)

* adaint.c: mktemp is a macro on Lynx and can not be used as an
expression.

* misc.c (gnat_expand_constant): Do not strip UNCHECKED_CONVERT_EXPR
if operand is CONSTRUCTOR.

* trans.c (tree_transform, case N_Assignment_Statement): Set lineno
before emiting check on right-hand side, so that exception information
is correct.

* utils.c (create_var_decl): Throw away initializing expression
if just annotating types and non-constant.

* prj-nmsc.adb: (Ada_Check): Migrate drom Ada_Default_... to
Default_Ada_...

* prj.adb: (Ada_Default_Spec_Suffix, Ada_Default_Impl_Suffix):
Remove functions.
(Default_Ada_Spec_Suffix, Default_Ada_Impl_Suffix): Move to spec.

* prj.ads: (Ada_Default_Spec_Suffix, Ada_Default_Impl_Suffix):
Remove functions.
(Default_Ada_Spec_Suffix, Default_Ada_Impl_Suffix): Move from body.

From-SVN: r48052

16 files changed:
gcc/ada/ChangeLog
gcc/ada/adaint.c
gcc/ada/ali.adb
gcc/ada/ali.ads
gcc/ada/bindusg.adb
gcc/ada/csets.adb
gcc/ada/csets.ads
gcc/ada/gnatcmd.adb
gcc/ada/lib-xref.adb
gcc/ada/lib-xref.ads
gcc/ada/misc.c
gcc/ada/osint.adb
gcc/ada/switch.adb
gcc/ada/trans.c
gcc/ada/usage.adb
gcc/ada/utils.c

index 1c52121ad31b97cfb8f65356b9376810846abd32..96b05ac34803653b44331c88625b9599badb0639 100644 (file)
@@ -1,3 +1,71 @@
+2001-12-14  Vincent Celier <celier@gnat.com>
+
+       * osint.adb(Create_Debug_File): When an object file is specified, 
+       put the .dg file in the same directory as the object file.
+       
+2001-12-14  Robert Dewar <dewar@gnat.com>
+
+       * osint.adb: Minor reformatting
+       
+       * lib-xref.adb (Output_Instantiation): New procedure to generate 
+       instantiation references.
+       
+       * lib-xref.ads: Add documentation of handling of generic references.
+       
+       * ali.adb (Read_Instantiation_Ref): New procedure to read 
+       instantiation references
+       
+       * ali.ads: Add spec for storing instantiation references
+       
+       * bindusg.adb: Minor reformatting
+       
+       * switch.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)
+       
+       * usage.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)
+       
+       * gnatcmd.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)
+       
+       * csets.adb: Add entry for Latin-5 (Cyrillic ISO-8859-5)
+       
+       * csets.ads:
+       Fix header format
+       Add 2001 to copyright date
+       Add entry for Latin-5 (Cyrillic ISO-8859-5)
+       
+2001-12-14  Matt Gingell <gingell@gnat.com>
+
+       * adaint.c: mktemp is a macro on Lynx and can not be used as an 
+       expression.
+       
+2001-12-14  Richard Kenner <kenner@gnat.com>
+
+       * misc.c (gnat_expand_constant): Do not strip UNCHECKED_CONVERT_EXPR 
+       if operand is CONSTRUCTOR.
+       
+2001-12-14  Ed Schonberg <schonber@gnat.com>
+
+       * trans.c (tree_transform, case N_Assignment_Statement): Set lineno 
+       before emiting check on right-hand side, so that exception information 
+       is correct.
+
+2001-12-14  Richard Kenner <kenner@gnat.com>
+       
+       * utils.c (create_var_decl): Throw away initializing expression 
+       if just annotating types and non-constant.
+       
+2001-12-14  Vincent Celier <celier@gnat.com>
+
+       * prj-nmsc.adb: (Ada_Check): Migrate drom Ada_Default_... to
+       Default_Ada_...
+       
+       * prj.adb: (Ada_Default_Spec_Suffix, Ada_Default_Impl_Suffix): 
+       Remove functions.
+       (Default_Ada_Spec_Suffix, Default_Ada_Impl_Suffix): Move to spec.
+       
+       * prj.ads: (Ada_Default_Spec_Suffix, Ada_Default_Impl_Suffix): 
+       Remove functions.
+       (Default_Ada_Spec_Suffix, Default_Ada_Impl_Suffix): Move from body.
+
 2001-12-16  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * ChangeLog: Remove piece of diff output.
index bd86d22e07007a1cf3919744a4b739215e75c886..e284236f34ff6b6b3b07a13d1b774e38e60db852 100644 (file)
@@ -622,7 +622,8 @@ __gnat_open_new_temp (path, fmode)
 
 #if defined (linux) && !defined (__vxworks)
   return mkstemp (path);
-
+#elif defined (__Lynx__)
+  mktemp (path);
 #else
   if (mktemp (path) == NULL)
     return -1;
index c3c566bac56bd3c4b4678181bbc092e8c33a2ebb..8ce631efa1c2f50e3be33b783753465476a44144 100644 (file)
@@ -1218,7 +1218,7 @@ package body ALI is
 
          Xref_Section.Increment_Last;
 
-         declare
+         Read_Refs_For_One_File : declare
             XS : Xref_Section_Record renames
                    Xref_Section.Table (Xref_Section.Last);
 
@@ -1240,12 +1240,64 @@ package body ALI is
             while C /= 'X' and then C /= EOF loop
                Xref_Entity.Increment_Last;
 
-               declare
+               Read_Refs_For_One_Entity : declare
+
                   XE : Xref_Entity_Record renames
                          Xref_Entity.Table (Xref_Entity.Last);
 
                   N : Nat;
 
+                  procedure Read_Instantiation_Reference;
+                  --  Acquire instantiation reference. Caller has checked
+                  --  that current character is '[' and on return the cursor
+                  --  is skipped past the corresponding closing ']'.
+
+                  ----------------------------------
+                  -- Read_Instantiation_Reference --
+                  ----------------------------------
+
+                  procedure Read_Instantiation_Reference is
+                  begin
+                     Xref.Increment_Last;
+
+                     declare
+                        XR : Xref_Record renames Xref.Table (Xref.Last);
+
+                     begin
+                        P := P + 1; -- skip [
+                        N := Get_Nat;
+
+                        if Nextc = '|' then
+                           XR.File_Num :=
+                             Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
+                           Current_File_Num := XR.File_Num;
+                           P := P + 1;
+                           N := Get_Nat;
+
+                        else
+                           XR.File_Num := Current_File_Num;
+                        end if;
+
+                        XR.Line  := N;
+                        XR.Rtype := ' ';
+                        XR.Col   := 0;
+
+                        --  Recursive call for next reference
+
+                        if Nextc = '[' then
+                           pragma Warnings (Off); -- kill recursion warning
+                           Read_Instantiation_Reference;
+                           pragma Warnings (On);
+                        end if;
+
+                        --  Skip closing bracket after recursive call
+
+                        P := P + 1;
+                     end;
+                  end Read_Instantiation_Reference;
+
+               --  Start of processing for Read_Refs_For_One_Entity
+
                begin
                   XE.Line   := Get_Nat;
                   XE.Etype  := Getc;
@@ -1343,6 +1395,10 @@ package body ALI is
                         XR.Line  := N;
                         XR.Rtype := Getc;
                         XR.Col   := Get_Nat;
+
+                        if Nextc = '[' then
+                           Read_Instantiation_Reference;
+                        end if;
                      end;
                   end loop;
 
@@ -1350,13 +1406,15 @@ package body ALI is
 
                   XE.Last_Xref := Xref.Last;
                   C := Nextc;
-               end;
+
+               end Read_Refs_For_One_Entity;
             end loop;
 
             --  Record last entity
 
             XS.Last_Entity := Xref_Entity.Last;
-         end;
+
+         end Read_Refs_For_One_File;
 
          C := Getc;
       end loop;
index 2079d78a47fc8c75be3044422cbcaf1075491fb8..488fb63141d46a3176e597111c34ca50278722dd 100644 (file)
@@ -687,8 +687,11 @@ package ALI is
       --    i = implicit reference
       --  See description in lib-xref.ads for further details
 
-      Col : Pos;
+      Col : Nat;
       --  Column number for the reference
+
+      --  Note: for instantiation references, Rtype is set to ' ', and Col is
+      --  set to zero. One or more such entries can follow any other reference.
    end record;
 
    package Xref is new Table.Table (
index c812a1d62e1934044bc8bd896c0f030199b9f13d..cc7fdb9303920eef3ed2e0387aaa9e8c80db8655 100644 (file)
@@ -110,14 +110,12 @@ begin
    Write_Str ("mation");
    Write_Eol;
 
-   --  Line for -I switch
+   --  Lines for -I switch
 
    Write_Switch_Char;
    Write_Str ("Idir     Specify library and source files search path");
    Write_Eol;
 
-   --  Line for -I- switch
-
    Write_Switch_Char;
    Write_Str ("I-       Don't look for sources & library files");
    Write_Str (" in default directory");
index 6855f4dc0afcd631396fa875e8349d681bb14631..9bf755acf61826cdfaef21d580b52d0998afb115 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision: 1.25 $
+--                            $Revision$
 --                                                                          --
 --          Copyright (C) 1992-2001, Free Software Foundation, Inc.         --
 --                                                                          --
@@ -468,6 +468,81 @@ package body Csets is
 
       others => ' ');
 
+   ---------------------------------------------------
+   -- Definitions for Latin-5 (Cyrillic ISO-8859-5) --
+   ---------------------------------------------------
+
+   Fold_Latin_5 : Translate_Table := Translate_Table'(
+
+      'a' => 'A',  X_D0 => X_B0,  X_E0 => X_C0,
+      'b' => 'B',  X_D1 => X_B1,  X_E1 => X_C1,  X_F1 => X_A1,
+      'c' => 'C',  X_D2 => X_B2,  X_E2 => X_C2,  X_F2 => X_A2,
+      'd' => 'D',  X_D3 => X_B3,  X_E3 => X_C3,  X_F3 => X_A3,
+      'e' => 'E',  X_D4 => X_B4,  X_E4 => X_C4,  X_F4 => X_A4,
+      'f' => 'F',  X_D5 => X_B5,  X_E5 => X_C5,  X_F5 => X_A5,
+      'g' => 'G',  X_D6 => X_B6,  X_E6 => X_C6,  X_F6 => X_A6,
+      'h' => 'H',  X_D7 => X_B7,  X_E7 => X_C7,  X_F7 => X_A7,
+      'i' => 'I',  X_D8 => X_B8,  X_E8 => X_C8,  X_F8 => X_A8,
+      'j' => 'J',  X_D9 => X_B9,  X_E9 => X_C9,  X_F9 => X_A9,
+      'k' => 'K',  X_DA => X_BA,  X_EA => X_CA,  X_FA => X_AA,
+      'l' => 'L',  X_DB => X_BB,  X_EB => X_CB,  X_FB => X_AB,
+      'm' => 'M',  X_DC => X_BC,  X_EC => X_CC,  X_FC => X_AC,
+      'n' => 'N',  X_DD => X_BD,  X_ED => X_CD,
+      'o' => 'O',  X_DE => X_BE,  X_EE => X_CE,  X_FE => X_AE,
+      'p' => 'P',  X_DF => X_BF,  X_EF => X_CF,  X_FF => X_AF,
+      'q' => 'Q',
+      'r' => 'R',
+      's' => 'S',
+      't' => 'T',
+      'u' => 'U',
+      'v' => 'V',
+      'w' => 'W',
+      'x' => 'X',
+      'y' => 'Y',
+      'z' => 'Z',
+
+      'A' => 'A',  X_B0 => X_B0,  X_C0 => X_C0,
+      'B' => 'B',  X_B1 => X_B1,  X_C1 => X_C1,  X_A1 => X_A1,
+      'C' => 'C',  X_B2 => X_B2,  X_C2 => X_C2,  X_A2 => X_A2,
+      'D' => 'D',  X_B3 => X_B3,  X_C3 => X_C3,  X_A3 => X_A3,
+      'E' => 'E',  X_B4 => X_B4,  X_C4 => X_C4,  X_A4 => X_A4,
+      'F' => 'F',  X_B5 => X_B5,  X_C5 => X_C5,  X_A5 => X_A5,
+      'G' => 'G',  X_B6 => X_B6,  X_C6 => X_C6,  X_A6 => X_A6,
+      'H' => 'H',  X_B7 => X_B7,  X_C7 => X_C7,  X_A7 => X_A7,
+      'I' => 'I',  X_B8 => X_B8,  X_C8 => X_C8,  X_A8 => X_A8,
+      'J' => 'J',  X_B9 => X_B9,  X_C9 => X_C9,  X_A9 => X_A9,
+      'K' => 'K',  X_BA => X_BA,  X_CA => X_CA,  X_AA => X_AA,
+      'L' => 'L',  X_BB => X_BB,  X_CB => X_CB,  X_AB => X_AB,
+      'M' => 'M',  X_BC => X_BC,  X_CC => X_CC,  X_AC => X_AC,
+      'N' => 'N',  X_BD => X_BD,  X_CD => X_CD,
+      'O' => 'O',  X_BE => X_BE,  X_CE => X_CE,  X_AE => X_AE,
+      'P' => 'P',  X_BF => X_BF,  X_CF => X_CF,  X_AF => X_AF,
+      'Q' => 'Q',
+      'R' => 'R',
+      'S' => 'S',
+      'T' => 'T',
+      'U' => 'U',
+      'V' => 'V',
+      'W' => 'W',
+      'X' => 'X',
+      'Y' => 'Y',
+      'Z' => 'Z',
+
+      '0' => '0',
+      '1' => '1',
+      '2' => '2',
+      '3' => '3',
+      '4' => '4',
+      '5' => '5',
+      '6' => '6',
+      '7' => '7',
+      '8' => '8',
+      '9' => '9',
+
+      '_' => '_',
+
+      others => ' ');
+
    --------------------------------------------
    -- Definitions for IBM PC (Code Page 437) --
    --------------------------------------------
@@ -966,6 +1041,9 @@ package body Csets is
       elsif Identifier_Character_Set = '4' then
          Fold_Upper := Fold_Latin_4;
 
+      elsif Identifier_Character_Set = '5' then
+         Fold_Upper := Fold_Latin_5;
+
       elsif Identifier_Character_Set = 'p' then
          Fold_Upper := Fold_IBM_PC_437;
 
index 8ed7fb1dac419f3617d38f5e5a302caa3dac07c7..c69fc9da98686010689e181702a5adb9c22f49a3 100644 (file)
@@ -6,9 +6,9 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---                            $Revision: 1.16 $                             --
+--                            $Revision$
 --                                                                          --
---          Copyright (C) 1992-1997 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2001 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- --
@@ -68,6 +68,7 @@ pragma Elaborate_Body (Csets);
    --    '2'  Latin-2
    --    '3'  Latin-3
    --    '4'  Latin-4
+   --    '5'  Latin-5 (Cyrillic ISO-8859-5)
    --    'p'  IBM PC (code page 437)
    --    '8'  IBM PC (code page 850)
    --    'f'  Full upper set (all distinct)
index bf98c69c7e7dc4bc87d7a1c66960812c0f6b189f..8f7b2e259852ef4311420c77f848389a688d336c 100644 (file)
@@ -464,6 +464,8 @@ procedure GNATCmd is
                                                 "-gnati3 "                 &
                                              "4 "                          &
                                                 "-gnati4 "                 &
+                                             "5 "                          &
+                                                "-gnati5 "                 &
                                              "PC "                         &
                                                 "-gnatip "                 &
                                              "PC850 "                      &
index c5b5b7d532c3fed24a36e5160f725f2e3ebd9ea6..931e02fda7521c96f1ad095db3f492e776a0f168 100644 (file)
@@ -481,7 +481,9 @@ package body Lib.Xref is
          Crloc  := No_Location;
 
          for Refno in 1 .. Nrefs loop
-            declare
+
+            Output_One_Ref : declare
+
                XE : Xref_Entry renames Xrefs.Table (Rnums (Refno));
                --  The current entry to be accessed
 
@@ -498,6 +500,57 @@ package body Lib.Xref is
                Right : Character;
                --  Used for {} or <> for type reference
 
+               procedure Output_Instantiation_Refs (Loc : Source_Ptr);
+               --  Recursive procedure to output instantiation references for
+               --  the given source ptr in [file|line[...]] form. No output
+               --  if the given location is not a generic template reference.
+
+               -------------------------------
+               -- Output_Instantiation_Refs --
+               -------------------------------
+
+               procedure Output_Instantiation_Refs (Loc : Source_Ptr) is
+                  Iloc : constant Source_Ptr := Instantiation_Location (Loc);
+                  Lun  : Unit_Number_Type;
+
+               begin
+                  --  Nothing to do if this is not an instantiation
+
+                  if Iloc = No_Location then
+                     return;
+                  end if;
+
+                  --  For now, nothing to do unless special debug flag set
+
+                  if not Debug_Flag_MM then
+                     return;
+                  end if;
+
+                  --  Output instantiation reference
+
+                  Write_Info_Char ('[');
+                  Lun := Get_Source_Unit (Iloc);
+
+                  if Lun /= Curru then
+                     Curru := XE.Lun;
+                     Write_Info_Nat (Dependency_Num (Curru));
+                     Write_Info_Char ('|');
+                  end if;
+
+                  Write_Info_Nat (Int (Get_Logical_Line_Number (Iloc)));
+
+                  --  Recursive call to get nested instantiations
+
+                  Output_Instantiation_Refs (Iloc);
+
+                  --  Output final ] after call to get proper nesting
+
+                  Write_Info_Char (']');
+                  return;
+               end Output_Instantiation_Refs;
+
+            --  Start of processing for Output_One_Ref
+
             begin
                Ent := XE.Ent;
                Ctyp := Xref_Entity_Letters (Ekind (Ent));
@@ -841,9 +894,11 @@ package body Lib.Xref is
                      Write_Info_Nat  (Int (Get_Logical_Line_Number (XE.Loc)));
                      Write_Info_Char (XE.Typ);
                      Write_Info_Nat  (Int (Get_Column_Number (XE.Loc)));
+
+                     Output_Instantiation_Refs (Sloc (XE.Ent));
                   end if;
                end if;
-            end;
+            end Output_One_Ref;
 
          <<Continue>>
             null;
index ea99c9642ca406adbc8779d08457e59d0618fd23..2d5566c527166f602d5891032ca7c55430c4aab3 100644 (file)
@@ -101,7 +101,7 @@ package Lib.Xref is
    --
    --     There may be zero or more ref entries on each line
    --
-   --        file | line type col
+   --        file | line type col [...]
    --
    --           file is the dependency number of the file with the reference.
    --           It and the following vertical bar are omitted if the file is
@@ -173,9 +173,21 @@ package Lib.Xref is
    --           Note that in the case of accept statements, there can
    --           be multiple b and T/t entries for the same entity.
    --
+   --           [..] is used for generic instantiation references. These
+   --           references are present only if the entity in question is
+   --           a generic entity, and in that case the [..] contains the
+   --           reference for the instantiation. In the case of nested
+   --           instantiations, this can be nested [...[...[...]]] etc.
+   --           The reference is of the form [file|line] no column is
+   --           present since it is assumed that only one instantiation
+   --           appears on a single source line. Note that the appearence
+   --           of file numbers in such references follows the normal
+   --           rules (present only if needed, and resets the current
+   --           file for subsequent references).
+   --
    --     Examples:
    --
-   --        44B5*Flag_Type 5r23 6m45 3|9r35 11r56
+   --        44B5*Flag_Type{boolean} 5r23 6m45 3|9r35 11r56
    --
    --           This line gives references for the publicly visible Boolean
    --           type Flag_Type declared on line 44, column 5. There are four
@@ -216,6 +228,13 @@ package Lib.Xref is
    --              a reference (e.g. a variable declaration) at line 18 column
    --              4 of the current file.
    --
+   --        10I3*Genv{integer} 3|4I10[6|12]
+   --
+   --           This line gives a reference for the entity Genv in a generic
+   --           package. The reference in file 3, line 4, col 10, refers to
+   --           an instance of the generic where the instantiation can be
+   --           found in file 6 at line 12.
+   --
    --  Continuation lines are used if the reference list gets too long,
    --  a continuation line starts with a period, and then has references
    --  continuing from the previous line. The references are sorted first
index cba0be562f99d7dbabdae7bcc3cb5182c54aa99e..9a01430b7be0d8400df56d745595350615e73b97 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                           C Implementation File                          *
  *                                                                          *
- *                             $Revision: 1.14 $
+ *                             $Revision$
  *                                                                          *
  *          Copyright (C) 1992-2001 Free Software Foundation, Inc.          *
  *                                                                          *
@@ -696,12 +696,13 @@ gnat_expand_constant (exp)
      tree exp;
 {
   /* If this is an unchecked conversion that does not change the size of the
-     object, return the operand since the underlying constant is still
-     the same.  Otherwise, return our operand.  */
+     object and the object is not a CONSTRUCTOR return the operand since the
+     underlying constant is still the same.  Otherwise, return our operand.  */
   if (TREE_CODE (exp) == UNCHECKED_CONVERT_EXPR
       && operand_equal_p (TYPE_SIZE_UNIT (TREE_TYPE (exp)),
                          TYPE_SIZE_UNIT (TREE_TYPE (TREE_OPERAND (exp, 0))),
-                         1))
+                         1)
+      && TREE_CODE (TREE_OPERAND (exp, 0)) != CONSTRUCTOR)
     return TREE_OPERAND (exp, 0);
 
   return exp;
index f871a1972b2b43a29e8ac1b2d551b36768a044e1..ba527b41b02e2195c324edf993f6f180af6480c5 100644 (file)
@@ -725,12 +725,38 @@ package body Osint is
 
    begin
       Get_Name_String (Src);
+
       if Hostparm.OpenVMS then
          Name_Buffer (Name_Len + 1 .. Name_Len + 3) := "_dg";
       else
          Name_Buffer (Name_Len + 1 .. Name_Len + 3) := ".dg";
       end if;
+
       Name_Len := Name_Len + 3;
+
+      if Output_Object_File_Name /= null then
+
+         for Index in reverse Output_Object_File_Name'Range loop
+
+            if Output_Object_File_Name (Index) = Directory_Separator then
+               declare
+                  File_Name : constant String := Name_Buffer (1 .. Name_Len);
+
+               begin
+                  Name_Len := Index - Output_Object_File_Name'First + 1;
+                  Name_Buffer (1 .. Name_Len) :=
+                    Output_Object_File_Name
+                      (Output_Object_File_Name'First .. Index);
+                  Name_Buffer (Name_Len + 1 .. Name_Len + File_Name'Length) :=
+                    File_Name;
+                  Name_Len := Name_Len + File_Name'Length;
+               end;
+
+               exit;
+            end if;
+         end loop;
+      end if;
+
       Result := Name_Find;
       Name_Buffer (Name_Len + 1) := ASCII.NUL;
       Create_File_And_Check (Output_FD, Text);
index 551f8bd65c4700e0033c35c7cf818bc4ffeb253e..9b06500d55e4ad78c618325de27dc3a7971c6c3d 100644 (file)
@@ -255,15 +255,12 @@ package body Switch is
             Ptr := Ptr + 1;
             C := Switch_Chars (Ptr);
 
-            if C = '1' or else
-               C = '2' or else
-               C = '3' or else
-               C = '4' or else
-               C = '8' or else
-               C = 'p' or else
-               C = 'f' or else
-               C = 'n' or else
-               C = 'w'
+            if C in  '1' .. '5'
+              or else C = '8'
+              or else C = 'p'
+              or else C = 'f'
+              or else C = 'n'
+              or else C = 'w'
             then
                Identifier_Character_Set := C;
                Ptr := Ptr + 1;
@@ -681,15 +678,12 @@ package body Switch is
                Ptr := Ptr + 1;
                C := Switch_Chars (Ptr);
 
-               if C = '1' or else
-                  C = '2' or else
-                  C = '3' or else
-                  C = '4' or else
-                  C = '8' or else
-                  C = 'p' or else
-                  C = 'f' or else
-                  C = 'n' or else
-                  C = 'w'
+               if C in '1' .. '5'
+                 or else C = '8'
+                 or else C = 'p'
+                 or else C = 'f'
+                 or else C = 'n'
+                 or else C = 'w'
                then
                   Identifier_Character_Set := C;
                   Ptr := Ptr + 1;
index deec9e79a7ba8a224f742b3ce32507ebf90c44f5..e158a6e9dbfd164a72083175128653c411b8d668 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *                            $Revision: 1.6 $
+ *                            $Revision$
  *                                                                          *
  *          Copyright (C) 1992-2001, Free Software Foundation, Inc.         *
  *                                                                          *
@@ -2051,12 +2051,12 @@ tree_transform (gnat_node)
       gnu_rhs
        = maybe_unconstrained_array (gnat_to_gnu (Expression (gnat_node)));
 
+      set_lineno (gnat_node, 1);
+
       /* If range check is needed, emit code to generate it */
       if (Do_Range_Check (Expression (gnat_node)))
        gnu_rhs = emit_range_check (gnu_rhs, Etype (Name (gnat_node)));
 
-      set_lineno (gnat_node, 1);
-
       /* If either side's type has a size that overflows, convert this
         into raise of Storage_Error: execution shouldn't have gotten
         here anyway.  */
index b265a6ce5d7f0007f329697948eb96ee102d6c33..7d64c148c5fabea22d1ce958d4f8168207a68c7c 100644 (file)
@@ -188,7 +188,7 @@ begin
    --  Line for -gnati switch
 
    Write_Switch_Char ("i?");
-   Write_Line ("Identifier char set (?=1/2/3/4/8/p/f/n/w)");
+   Write_Line ("Identifier char set (?=1/2/3/4/5/8/p/f/n/w)");
 
    --  Line for -gnatk switch
 
index e5375b4b96a8a2da00906e27dd84fdbaadd17a24..089770b5b73e1ab9f56dd59f4650832ea19d6227 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *                            $Revision: 1.4 $
+ *                            $Revision$
  *                                                                          *
  *          Copyright (C) 1992-2001, Free Software Foundation, Inc.         *
  *                                                                          *
@@ -1314,9 +1314,11 @@ create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag,
      any variable elaborations for the elaboration routine.  Otherwise, if
      the initializing expression is not the same as TYPE, generate the
      initialization with an assignment statement, since it knows how
-     to do the required adjustents.  */
+     to do the required adjustents.  If we are just annotating types,
+     throw away the initialization if it isn't a constant.  */
 
-  if (extern_flag && TREE_CODE (var_decl) != CONST_DECL)
+  if ((extern_flag && TREE_CODE (var_decl) != CONST_DECL)
+      || (type_annotate_only && var_init != 0 && ! TREE_CONSTANT (var_init)))
     var_init = 0;
 
   if (global_bindings_p () && var_init != 0 && ! init_const)