summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:51:38 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:51:38 +0000
commit7ba213b24c8d525b987df71de788b596e7924849 (patch)
tree82f467f6771df85b9ce495a5af4527dc1f9635c0
parent0577b0b1ffa590c60a05740d2f2daa895d02db9f (diff)
downloadgcc-7ba213b24c8d525b987df71de788b596e7924849.tar.gz
2006-10-31 Robert Dewar <dewar@adacore.com>
* clean.adb, gnatname.adb, gnatsym.adb, prep.adb, prep.ads, prepcomp.adb, prj.ads, prj-strt.adb, sem_maps.ads, vms_conv.adb: Fix bad table increment values (much too small) * table.adb (Realloc): Make sure we get at least some new elements Defends against silly small values for table increment git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118249 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/clean.adb4
-rw-r--r--gcc/ada/gnatname.adb12
-rw-r--r--gcc/ada/gnatsym.adb4
-rw-r--r--gcc/ada/prep.adb712
-rw-r--r--gcc/ada/prep.ads4
-rw-r--r--gcc/ada/prepcomp.adb6
-rw-r--r--gcc/ada/prj-strt.adb4
-rw-r--r--gcc/ada/prj.ads22
-rw-r--r--gcc/ada/sem_maps.ads8
-rw-r--r--gcc/ada/table.adb13
-rw-r--r--gcc/ada/vms_conv.adb2
11 files changed, 398 insertions, 393 deletions
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb
index 08459060345..0897c27e6c1 100644
--- a/gcc/ada/clean.adb
+++ b/gcc/ada/clean.adb
@@ -120,7 +120,7 @@ package body Clean is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Clean.Processed_Projects");
-- Table to keep track of what project files have been processed, when
-- switch -r is specified.
@@ -130,7 +130,7 @@ package body Clean is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Clean.Processed_Projects");
-- Table to store all the source files of a library unit: spec, body and
-- subunits, to detect .dg files and delete them.
diff --git a/gcc/ada/gnatname.adb b/gcc/ada/gnatname.adb
index b746ba02f23..714ba42f589 100644
--- a/gcc/ada/gnatname.adb
+++ b/gcc/ada/gnatname.adb
@@ -66,7 +66,7 @@ procedure Gnatname is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Gnatname.Excluded_Patterns");
-- Table to accumulate the negative patterns
@@ -75,7 +75,7 @@ procedure Gnatname is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Gnatname.Foreign_Patterns");
-- Table to accumulate the foreign patterns
@@ -84,7 +84,7 @@ procedure Gnatname is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Gnatname.Patterns");
-- Table to accumulate the name patterns
@@ -93,7 +93,7 @@ procedure Gnatname is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Gnatname.Source_Directories");
-- Table to accumulate the source directories specified directly with -d
-- or indirectly with -D.
@@ -102,8 +102,8 @@ procedure Gnatname is
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
- Table_Initial => 2,
- Table_Increment => 50,
+ Table_Initial => 10,
+ Table_Increment => 100,
Table_Name => "Gnatname.Preprocessor_Switches");
-- Table to store the preprocessor switches to be used in the call
-- to the compiler.
diff --git a/gcc/ada/gnatsym.adb b/gcc/ada/gnatsym.adb
index f723d52a088..f05ad9c0f27 100644
--- a/gcc/ada/gnatsym.adb
+++ b/gcc/ada/gnatsym.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-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- --
@@ -85,7 +85,7 @@ procedure Gnatsym is
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Gnatsymb.Object_Files");
-- A table to store the object file names
diff --git a/gcc/ada/prep.adb b/gcc/ada/prep.adb
index b2ec857b96d..09ba3bfb197 100644
--- a/gcc/ada/prep.adb
+++ b/gcc/ada/prep.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-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- --
@@ -178,7 +178,7 @@ package body Prep is
Table_Index_Type => Pp_Depth,
Table_Low_Bound => 1,
Table_Initial => 10,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Prep.Pp_States");
-- A stack of the states of the preprocessor, for nested #if
@@ -675,13 +675,365 @@ package body Prep is
end Index_Of;
----------------
+ -- Initialize --
+ ----------------
+
+ procedure Initialize
+ (Error_Msg : Error_Msg_Proc;
+ Scan : Scan_Proc;
+ Set_Ignore_Errors : Set_Ignore_Errors_Proc;
+ Put_Char : Put_Char_Proc;
+ New_EOL : New_EOL_Proc)
+ is
+ begin
+ if not Already_Initialized then
+ Start_String;
+ Store_String_Chars ("True");
+ True_Value.Value := End_String;
+
+ Start_String;
+ Empty_String := End_String;
+
+ Name_Len := 7;
+ Name_Buffer (1 .. Name_Len) := "defined";
+ Name_Defined := Name_Find;
+
+ Start_String;
+ Store_String_Chars ("False");
+ String_False := End_String;
+
+ Already_Initialized := True;
+ end if;
+
+ Prep.Error_Msg := Error_Msg;
+ Prep.Scan := Scan;
+ Prep.Set_Ignore_Errors := Set_Ignore_Errors;
+ Prep.Put_Char := Put_Char;
+ Prep.New_EOL := New_EOL;
+ end Initialize;
+
+ ------------------
+ -- List_Symbols --
+ ------------------
+
+ procedure List_Symbols (Foreword : String) is
+ Order : array (0 .. Integer (Symbol_Table.Last (Mapping)))
+ of Symbol_Id;
+ -- After alphabetical sorting, this array stores thehe indices of
+ -- the symbols in the order they are displayed.
+
+ function Lt (Op1, Op2 : Natural) return Boolean;
+ -- Comparison routine for sort call
+
+ procedure Move (From : Natural; To : Natural);
+ -- Move routine for sort call
+
+ --------
+ -- Lt --
+ --------
+
+ function Lt (Op1, Op2 : Natural) return Boolean is
+ S1 : constant String :=
+ Get_Name_String (Mapping.Table (Order (Op1)).Symbol);
+ S2 : constant String :=
+ Get_Name_String (Mapping.Table (Order (Op2)).Symbol);
+
+ begin
+ return S1 < S2;
+ end Lt;
+
+ ----------
+ -- Move --
+ ----------
+
+ procedure Move (From : Natural; To : Natural) is
+ begin
+ Order (To) := Order (From);
+ end Move;
+
+ package Sort_Syms is new GNAT.Heap_Sort_G (Move, Lt);
+
+ Max_L : Natural;
+ -- Maximum length of any symbol
+
+ -- Start of processing for List_Symbols_Case
+
+ begin
+ if Symbol_Table.Last (Mapping) = 0 then
+ return;
+ end if;
+
+ if Foreword'Length > 0 then
+ Write_Eol;
+ Write_Line (Foreword);
+
+ for J in Foreword'Range loop
+ Write_Char ('=');
+ end loop;
+ end if;
+
+ -- Initialize the order
+
+ for J in Order'Range loop
+ Order (J) := Symbol_Id (J);
+ end loop;
+
+ -- Sort alphabetically
+
+ Sort_Syms.Sort (Order'Last);
+
+ Max_L := 7;
+
+ for J in 1 .. Symbol_Table.Last (Mapping) loop
+ Get_Name_String (Mapping.Table (J).Original);
+ Max_L := Integer'Max (Max_L, Name_Len);
+ end loop;
+
+ Write_Eol;
+ Write_Str ("Symbol");
+
+ for J in 1 .. Max_L - 5 loop
+ Write_Char (' ');
+ end loop;
+
+ Write_Line ("Value");
+
+ Write_Str ("------");
+
+ for J in 1 .. Max_L - 5 loop
+ Write_Char (' ');
+ end loop;
+
+ Write_Line ("------");
+
+ for J in 1 .. Order'Last loop
+ declare
+ Data : constant Symbol_Data := Mapping.Table (Order (J));
+
+ begin
+ Get_Name_String (Data.Original);
+ Write_Str (Name_Buffer (1 .. Name_Len));
+
+ for K in Name_Len .. Max_L loop
+ Write_Char (' ');
+ end loop;
+
+ String_To_Name_Buffer (Data.Value);
+
+ if Data.Is_A_String then
+ Write_Char ('"');
+
+ for J in 1 .. Name_Len loop
+ Write_Char (Name_Buffer (J));
+
+ if Name_Buffer (J) = '"' then
+ Write_Char ('"');
+ end if;
+ end loop;
+
+ Write_Char ('"');
+
+ else
+ Write_Str (Name_Buffer (1 .. Name_Len));
+ end if;
+ end;
+
+ Write_Eol;
+ end loop;
+
+ Write_Eol;
+ end List_Symbols;
+
+ ----------------------
+ -- Matching_Strings --
+ ----------------------
+
+ function Matching_Strings (S1, S2 : String_Id) return Boolean is
+ begin
+ String_To_Name_Buffer (S1);
+
+ for Index in 1 .. Name_Len loop
+ Name_Buffer (Index) := Fold_Lower (Name_Buffer (Index));
+ end loop;
+
+ declare
+ String1 : constant String := Name_Buffer (1 .. Name_Len);
+
+ begin
+ String_To_Name_Buffer (S2);
+
+ for Index in 1 .. Name_Len loop
+ Name_Buffer (Index) := Fold_Lower (Name_Buffer (Index));
+ end loop;
+
+ return String1 = Name_Buffer (1 .. Name_Len);
+ end;
+ end Matching_Strings;
+
+ --------------------
+ -- Parse_Def_File --
+ --------------------
+
+ procedure Parse_Def_File is
+ Symbol : Symbol_Id;
+ Symbol_Name : Name_Id;
+ Original_Name : Name_Id;
+ Data : Symbol_Data;
+ Value_Start : Source_Ptr;
+ Value_End : Source_Ptr;
+ Ch : Character;
+
+ use ASCII;
+
+ begin
+ Def_Line_Loop :
+ loop
+ Scan.all;
+
+ exit Def_Line_Loop when Token = Tok_EOF;
+
+ if Token /= Tok_End_Of_Line then
+ Change_Reserved_Keyword_To_Symbol;
+
+ if Token /= Tok_Identifier then
+ Error_Msg ("identifier expected", Token_Ptr);
+ goto Cleanup;
+ end if;
+
+ Symbol_Name := Token_Name;
+ Name_Len := 0;
+
+ for Ptr in Token_Ptr .. Scan_Ptr - 1 loop
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := Sinput.Source (Ptr);
+ end loop;
+
+ Original_Name := Name_Find;
+ Scan.all;
+
+ if Token /= Tok_Colon_Equal then
+ Error_Msg ("`:=` expected", Token_Ptr);
+ goto Cleanup;
+ end if;
+
+ Scan.all;
+
+ if Token = Tok_String_Literal then
+ Data := (Symbol => Symbol_Name,
+ Original => Original_Name,
+ On_The_Command_Line => False,
+ Is_A_String => True,
+ Value => String_Literal_Id);
+
+ Scan.all;
+
+ if Token /= Tok_End_Of_Line and then Token /= Tok_EOF then
+ Error_Msg ("extraneous text in definition", Token_Ptr);
+ goto Cleanup;
+ end if;
+
+ elsif Token = Tok_End_Of_Line or Token = Tok_EOF then
+ Data := (Symbol => Symbol_Name,
+ Original => Original_Name,
+ On_The_Command_Line => False,
+ Is_A_String => False,
+ Value => Empty_String);
+
+ else
+ Value_Start := Token_Ptr;
+ Value_End := Token_Ptr - 1;
+ Scan_Ptr := Token_Ptr;
+
+ Value_Chars_Loop :
+ loop
+ Ch := Sinput.Source (Scan_Ptr);
+
+ case Ch is
+ when '_' | '.' | '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' =>
+ Value_End := Scan_Ptr;
+ Scan_Ptr := Scan_Ptr + 1;
+
+ when ' ' | HT | VT | CR | LF | FF =>
+ exit Value_Chars_Loop;
+
+ when others =>
+ Error_Msg ("illegal character", Scan_Ptr);
+ goto Cleanup;
+ end case;
+ end loop Value_Chars_Loop;
+
+ Scan.all;
+
+ if Token /= Tok_End_Of_Line and then Token /= Tok_EOF then
+ Error_Msg ("extraneous text in definition", Token_Ptr);
+ goto Cleanup;
+ end if;
+
+ Start_String;
+
+ while Value_Start <= Value_End loop
+ Store_String_Char (Sinput.Source (Value_Start));
+ Value_Start := Value_Start + 1;
+ end loop;
+
+ Data := (Symbol => Symbol_Name,
+ Original => Original_Name,
+ On_The_Command_Line => False,
+ Is_A_String => False,
+ Value => End_String);
+ end if;
+
+ -- Now that we have the value, get the symbol index
+
+ Symbol := Index_Of (Symbol_Name);
+
+ if Symbol /= No_Symbol then
+ -- If we already have an entry for this symbol, replace it
+ -- with the new value, except if the symbol was declared
+ -- on the command line.
+
+ if Mapping.Table (Symbol).On_The_Command_Line then
+ goto Continue;
+ end if;
+
+ else
+ -- As it is the first time we see this symbol, create a new
+ -- entry in the table.
+
+ if Mapping.Table = null then
+ Symbol_Table.Init (Mapping);
+ end if;
+
+ Symbol_Table.Increment_Last (Mapping);
+ Symbol := Symbol_Table.Last (Mapping);
+ end if;
+
+ Mapping.Table (Symbol) := Data;
+ goto Continue;
+
+ <<Cleanup>>
+ Set_Ignore_Errors (To => True);
+
+ while Token /= Tok_End_Of_Line and Token /= Tok_EOF loop
+ Scan.all;
+ end loop;
+
+ Set_Ignore_Errors (To => False);
+
+ <<Continue>>
+ null;
+ end if;
+ end loop Def_Line_Loop;
+ end Parse_Def_File;
+
+ ----------------
-- Preprocess --
----------------
procedure Preprocess is
Start_Of_Processing : Source_Ptr;
- Cond : Boolean;
- Preprocessor_Line : Boolean := False;
+ Cond : Boolean;
+ Preprocessor_Line : Boolean := False;
procedure Output (From, To : Source_Ptr);
-- Output the characters with indices From .. To in the buffer
@@ -1087,356 +1439,4 @@ package body Prep is
end loop;
end Preprocess;
- ----------------
- -- Initialize --
- ----------------
-
- procedure Initialize
- (Error_Msg : Error_Msg_Proc;
- Scan : Scan_Proc;
- Set_Ignore_Errors : Set_Ignore_Errors_Proc;
- Put_Char : Put_Char_Proc;
- New_EOL : New_EOL_Proc)
- is
- begin
- if not Already_Initialized then
- Start_String;
- Store_String_Chars ("True");
- True_Value.Value := End_String;
-
- Start_String;
- Empty_String := End_String;
-
- Name_Len := 7;
- Name_Buffer (1 .. Name_Len) := "defined";
- Name_Defined := Name_Find;
-
- Start_String;
- Store_String_Chars ("False");
- String_False := End_String;
-
- Already_Initialized := True;
- end if;
-
- Prep.Error_Msg := Error_Msg;
- Prep.Scan := Scan;
- Prep.Set_Ignore_Errors := Set_Ignore_Errors;
- Prep.Put_Char := Put_Char;
- Prep.New_EOL := New_EOL;
- end Initialize;
-
- ------------------
- -- List_Symbols --
- ------------------
-
- procedure List_Symbols (Foreword : String) is
- Order : array (0 .. Integer (Symbol_Table.Last (Mapping)))
- of Symbol_Id;
- -- After alphabetical sorting, this array stores thehe indices of
- -- the symbols in the order they are displayed.
-
- function Lt (Op1, Op2 : Natural) return Boolean;
- -- Comparison routine for sort call
-
- procedure Move (From : Natural; To : Natural);
- -- Move routine for sort call
-
- --------
- -- Lt --
- --------
-
- function Lt (Op1, Op2 : Natural) return Boolean is
- S1 : constant String :=
- Get_Name_String (Mapping.Table (Order (Op1)).Symbol);
- S2 : constant String :=
- Get_Name_String (Mapping.Table (Order (Op2)).Symbol);
-
- begin
- return S1 < S2;
- end Lt;
-
- ----------
- -- Move --
- ----------
-
- procedure Move (From : Natural; To : Natural) is
- begin
- Order (To) := Order (From);
- end Move;
-
- package Sort_Syms is new GNAT.Heap_Sort_G (Move, Lt);
-
- Max_L : Natural;
- -- Maximum length of any symbol
-
- -- Start of processing for List_Symbols_Case
-
- begin
- if Symbol_Table.Last (Mapping) = 0 then
- return;
- end if;
-
- if Foreword'Length > 0 then
- Write_Eol;
- Write_Line (Foreword);
-
- for J in Foreword'Range loop
- Write_Char ('=');
- end loop;
- end if;
-
- -- Initialize the order
-
- for J in Order'Range loop
- Order (J) := Symbol_Id (J);
- end loop;
-
- -- Sort alphabetically
-
- Sort_Syms.Sort (Order'Last);
-
- Max_L := 7;
-
- for J in 1 .. Symbol_Table.Last (Mapping) loop
- Get_Name_String (Mapping.Table (J).Original);
- Max_L := Integer'Max (Max_L, Name_Len);
- end loop;
-
- Write_Eol;
- Write_Str ("Symbol");
-
- for J in 1 .. Max_L - 5 loop
- Write_Char (' ');
- end loop;
-
- Write_Line ("Value");
-
- Write_Str ("------");
-
- for J in 1 .. Max_L - 5 loop
- Write_Char (' ');
- end loop;
-
- Write_Line ("------");
-
- for J in 1 .. Order'Last loop
- declare
- Data : constant Symbol_Data := Mapping.Table (Order (J));
-
- begin
- Get_Name_String (Data.Original);
- Write_Str (Name_Buffer (1 .. Name_Len));
-
- for K in Name_Len .. Max_L loop
- Write_Char (' ');
- end loop;
-
- String_To_Name_Buffer (Data.Value);
-
- if Data.Is_A_String then
- Write_Char ('"');
-
- for J in 1 .. Name_Len loop
- Write_Char (Name_Buffer (J));
-
- if Name_Buffer (J) = '"' then
- Write_Char ('"');
- end if;
- end loop;
-
- Write_Char ('"');
-
- else
- Write_Str (Name_Buffer (1 .. Name_Len));
- end if;
- end;
-
- Write_Eol;
- end loop;
-
- Write_Eol;
- end List_Symbols;
-
- ----------------------
- -- Matching_Strings --
- ----------------------
-
- function Matching_Strings (S1, S2 : String_Id) return Boolean is
- begin
- String_To_Name_Buffer (S1);
-
- for Index in 1 .. Name_Len loop
- Name_Buffer (Index) := Fold_Lower (Name_Buffer (Index));
- end loop;
-
- declare
- String1 : constant String := Name_Buffer (1 .. Name_Len);
-
- begin
- String_To_Name_Buffer (S2);
-
- for Index in 1 .. Name_Len loop
- Name_Buffer (Index) := Fold_Lower (Name_Buffer (Index));
- end loop;
-
- return String1 = Name_Buffer (1 .. Name_Len);
- end;
- end Matching_Strings;
-
- --------------------
- -- Parse_Def_File --
- --------------------
-
- procedure Parse_Def_File is
- Symbol : Symbol_Id;
- Symbol_Name : Name_Id;
- Original_Name : Name_Id;
- Data : Symbol_Data;
- Value_Start : Source_Ptr;
- Value_End : Source_Ptr;
- Ch : Character;
-
- use ASCII;
-
- begin
- Def_Line_Loop :
- loop
- Scan.all;
-
- exit Def_Line_Loop when Token = Tok_EOF;
-
- if Token /= Tok_End_Of_Line then
- Change_Reserved_Keyword_To_Symbol;
-
- if Token /= Tok_Identifier then
- Error_Msg ("identifier expected", Token_Ptr);
- goto Cleanup;
- end if;
-
- Symbol_Name := Token_Name;
- Name_Len := 0;
-
- for Ptr in Token_Ptr .. Scan_Ptr - 1 loop
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := Sinput.Source (Ptr);
- end loop;
-
- Original_Name := Name_Find;
- Scan.all;
-
- if Token /= Tok_Colon_Equal then
- Error_Msg ("`:=` expected", Token_Ptr);
- goto Cleanup;
- end if;
-
- Scan.all;
-
- if Token = Tok_String_Literal then
- Data := (Symbol => Symbol_Name,
- Original => Original_Name,
- On_The_Command_Line => False,
- Is_A_String => True,
- Value => String_Literal_Id);
-
- Scan.all;
-
- if Token /= Tok_End_Of_Line and then Token /= Tok_EOF then
- Error_Msg ("extraneous text in definition", Token_Ptr);
- goto Cleanup;
- end if;
-
- elsif Token = Tok_End_Of_Line or Token = Tok_EOF then
- Data := (Symbol => Symbol_Name,
- Original => Original_Name,
- On_The_Command_Line => False,
- Is_A_String => False,
- Value => Empty_String);
-
- else
- Value_Start := Token_Ptr;
- Value_End := Token_Ptr - 1;
- Scan_Ptr := Token_Ptr;
-
- Value_Chars_Loop :
- loop
- Ch := Sinput.Source (Scan_Ptr);
-
- case Ch is
- when '_' | '.' | '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' =>
- Value_End := Scan_Ptr;
- Scan_Ptr := Scan_Ptr + 1;
-
- when ' ' | HT | VT | CR | LF | FF =>
- exit Value_Chars_Loop;
-
- when others =>
- Error_Msg ("illegal character", Scan_Ptr);
- goto Cleanup;
- end case;
- end loop Value_Chars_Loop;
-
- Scan.all;
-
- if Token /= Tok_End_Of_Line and then Token /= Tok_EOF then
- Error_Msg ("extraneous text in definition", Token_Ptr);
- goto Cleanup;
- end if;
-
- Start_String;
-
- while Value_Start <= Value_End loop
- Store_String_Char (Sinput.Source (Value_Start));
- Value_Start := Value_Start + 1;
- end loop;
-
- Data := (Symbol => Symbol_Name,
- Original => Original_Name,
- On_The_Command_Line => False,
- Is_A_String => False,
- Value => End_String);
- end if;
-
- -- Now that we have the value, get the symbol index
-
- Symbol := Index_Of (Symbol_Name);
-
- if Symbol /= No_Symbol then
- -- If we already have an entry for this symbol, replace it
- -- with the new value, except if the symbol was declared
- -- on the command line.
-
- if Mapping.Table (Symbol).On_The_Command_Line then
- goto Continue;
- end if;
-
- else
- -- As it is the first time we see this symbol, create a new
- -- entry in the table.
-
- if Mapping.Table = null then
- Symbol_Table.Init (Mapping);
- end if;
-
- Symbol_Table.Increment_Last (Mapping);
- Symbol := Symbol_Table.Last (Mapping);
- end if;
-
- Mapping.Table (Symbol) := Data;
- goto Continue;
-
- <<Cleanup>>
- Set_Ignore_Errors (To => True);
-
- while Token /= Tok_End_Of_Line and Token /= Tok_EOF loop
- Scan.all;
- end loop;
-
- Set_Ignore_Errors (To => False);
-
- <<Continue>>
- null;
- end if;
- end loop Def_Line_Loop;
- end Parse_Def_File;
-
end Prep;
diff --git a/gcc/ada/prep.ads b/gcc/ada/prep.ads
index a9f92f77510..ab45ef2804b 100644
--- a/gcc/ada/prep.ads
+++ b/gcc/ada/prep.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-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- --
@@ -71,7 +71,7 @@ package Prep is
Table_Index_Type => Symbol_Id,
Table_Low_Bound => 1,
Table_Initial => 10,
- Table_Increment => 10);
+ Table_Increment => 100);
-- The table of all symbols
Mapping : Symbol_Table.Instance;
diff --git a/gcc/ada/prepcomp.adb b/gcc/ada/prepcomp.adb
index 7fd1984cc55..763654ca3eb 100644
--- a/gcc/ada/prepcomp.adb
+++ b/gcc/ada/prepcomp.adb
@@ -105,7 +105,7 @@ package body Prepcomp is
Table_Index_Type => Int,
Table_Low_Bound => 1,
Table_Initial => 5,
- Table_Increment => 5,
+ Table_Increment => 100,
Table_Name => "Prepcomp.Preproc_Data_Table");
-- Table to store the specific preprocessing data
@@ -117,8 +117,8 @@ package body Prepcomp is
(Table_Component_Type => Source_File_Index,
Table_Index_Type => Int,
Table_Low_Bound => 1,
- Table_Initial => 5,
- Table_Increment => 5,
+ Table_Initial => 10,
+ Table_Increment => 100,
Table_Name => "Prepcomp.Dependencies");
-- Table to store the dependencies on preprocessing files
diff --git a/gcc/ada/prj-strt.adb b/gcc/ada/prj-strt.adb
index b1388079719..0fdc21cc1d5 100644
--- a/gcc/ada/prj-strt.adb
+++ b/gcc/ada/prj-strt.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-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- --
@@ -45,7 +45,7 @@ package body Prj.Strt is
-- been used (to avoid duplicate case labels).
Choices_Initial : constant := 10;
- Choices_Increment : constant := 50;
+ Choices_Increment : constant := 100;
Choice_Node_Low_Bound : constant := 0;
Choice_Node_High_Bound : constant := 099_999_999;
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index 474920460e1..416635f537a 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-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- --
@@ -316,7 +316,7 @@ package Prj is
type String_Element is record
Value : Name_Id := No_Name;
Index : Int := 0;
- Display_Value : Name_Id := No_Name;
+ Display_Value : Name_Id := No_Name;
Location : Source_Ptr := No_Location;
Flag : Boolean := False;
Next : String_List_Id := Nil_String;
@@ -840,13 +840,13 @@ package Prj is
(Specification, Body_Part);
type File_Name_Data is record
- Name : Name_Id := No_Name;
- Index : Int := 0;
- Display_Name : Name_Id := No_Name;
- Path : Name_Id := No_Name;
- Display_Path : Name_Id := No_Name;
+ Name : Name_Id := No_Name;
+ Index : Int := 0;
+ Display_Name : Name_Id := No_Name;
+ Path : Name_Id := No_Name;
+ Display_Path : Name_Id := No_Name;
Project : Project_Id := No_Project;
- Needs_Pragma : Boolean := False;
+ Needs_Pragma : Boolean := False;
end record;
-- File and Path name of a spec or body
@@ -1057,7 +1057,7 @@ private
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 50,
- Table_Increment => 50);
+ Table_Increment => 100);
-- Table storing all the temp path file names.
-- Used by Delete_All_Path_Files.
@@ -1066,7 +1066,7 @@ private
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 50,
- Table_Increment => 50);
+ Table_Increment => 100);
-- A table to store the source dirs before creating the source path file
package Object_Path_Table is new GNAT.Dynamic_Tables
@@ -1074,7 +1074,7 @@ private
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 50,
- Table_Increment => 50);
+ Table_Increment => 100);
-- A table to store the object dirs, before creating the object path file
type Private_Project_Tree_Data is record
diff --git a/gcc/ada/sem_maps.ads b/gcc/ada/sem_maps.ads
index eb126790665..d6f51859651 100644
--- a/gcc/ada/sem_maps.ads
+++ b/gcc/ada/sem_maps.ads
@@ -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- --
@@ -140,7 +140,7 @@ private
Table_Index_Type => Map,
Table_Low_Bound => 0,
Table_Initial => 100,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Maps_Table");
-- All headers for hash tables are allocated in one global table. Each
@@ -151,7 +151,7 @@ private
Table_Index_Type => Header_Index,
Table_Low_Bound => 0,
Table_Initial => 1000,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Headers_Table");
-- All associations are allocated in one global table. Each map stores
@@ -162,7 +162,7 @@ private
Table_Index_Type => Assoc_Index,
Table_Low_Bound => 1,
Table_Initial => 1000,
- Table_Increment => 10,
+ Table_Increment => 100,
Table_Name => "Associations_Table");
end Sem_Maps;
diff --git a/gcc/ada/table.adb b/gcc/ada/table.adb
index b99e6254e9d..7897378a1d0 100644
--- a/gcc/ada/table.adb
+++ b/gcc/ada/table.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 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- --
@@ -163,7 +163,7 @@ package body Table is
----------------
procedure Reallocate is
- New_Size : Memory.size_t;
+ New_Size : Memory.size_t;
begin
if Max < Last_Val then
@@ -174,10 +174,15 @@ package body Table is
Length := Int'Max (Length, Table_Initial);
- -- Now increment table length until it is sufficiently large
+ -- Now increment table length until it is sufficiently large. Use
+ -- the increment value or 10, which ever is larger (the reason
+ -- for the use of 10 here is to ensure that the table does really
+ -- increase in size (which would not be the case for a table of
+ -- length 10 increased by 3% for instance).
while Max < Last_Val loop
- Length := Length * (100 + Table_Increment) / 100;
+ Length := Int'Max (Length * (100 + Table_Increment) / 100,
+ Length + 10);
Max := Min + Length - 1;
end loop;
diff --git a/gcc/ada/vms_conv.adb b/gcc/ada/vms_conv.adb
index e626ca9ea6d..c5e53d7e113 100644
--- a/gcc/ada/vms_conv.adb
+++ b/gcc/ada/vms_conv.adb
@@ -78,7 +78,7 @@ package body VMS_Conv is
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 4096,
- Table_Increment => 2,
+ Table_Increment => 100,
Table_Name => "Buffer");
function Init_Object_Dirs return Argument_List;