Commit 34a343e6 by Robert Dewar Committed by Arnaud Charlet

xeinfo.adb: Remove warnings

2007-12-06  Robert Dewar  <dewar@adacore.com>

	* xeinfo.adb: Remove warnings
	* xnmake.adb: Remove warnings
	* xsinfo.adb: Remove warnings
	* xtreeprs.adb: Remove warnings
	* xsnames.adb: Remove warnings

	* a-ngcoar.adb: Fix typo.
	* s-interr.adb: Minor reformatting
	* env.c: Minor reformatting.
	* g-bytswa.adb: Minor reformatting.
	* g-rannum.ads: Minor documentation improvements
	* s-tasinf-mingw.adb: Minor header fix
	* a-clrefi.adb: Minor reformatting
	* g-sttsne.ads: Minor documentation improvement
	* g-sttsne-locking.ads: Minor documentation improvement
	* g-soliop-solaris.ads: Minor documentation improvement
	* g-soliop-mingw.ads: Minor documentation improvement
	* g-soliop.ads: Minor documentation improvement
	* exp_aggr.ads: Minor reformatting
	* debug.adb: Add documentation for the gprbuild debug flags
	* exp_ch2.adb: Use Nkind_In to simplify code throughout
	* exp_pakd.adb: Minor reformatting

	* g-altive.ads, g-alleve.adb: Remove assertions.
	Add comment about minor differences between targets regarding
	floating-point operations.

	* g-thread.adb: Remove pragma unreferenced.
	* lib.ads: Minor reformatting
	* par-ch9.adb: Minor reformatting of error messages
	* sem_case.adb: Minor reformatting
	* s-fileio.adb: Minor reformattinng
	* s-vmexta.ads: Minor typo
	* vxaddr2line.adb: 
	Take into account 'Success' value as per new GNAT warning.

From-SVN: r130870
parent 9b998381
...@@ -51,8 +51,7 @@ package body Ada.Command_Line.Response_File is ...@@ -51,8 +51,7 @@ package body Ada.Command_Line.Response_File is
type Argument_List_Access is access Argument_List; type Argument_List_Access is access Argument_List;
procedure Free is new Ada.Unchecked_Deallocation procedure Free is new Ada.Unchecked_Deallocation
(Argument_List, Argument_List_Access); (Argument_List, Argument_List_Access);
-- Free only the allocated Argument_List, not the allocated String -- Free only the allocated Argument_List, not allocated String components
-- components.
-------------------- --------------------
-- Arguments_From -- -- Arguments_From --
...@@ -76,8 +75,8 @@ package body Ada.Command_Line.Response_File is ...@@ -76,8 +75,8 @@ package body Ada.Command_Line.Response_File is
-- if necessary. -- if necessary.
procedure Recurse (File_Name : String); procedure Recurse (File_Name : String);
-- Get the arguments from the file and call itself recursively if -- Get the arguments from the file and call itself recursively if one of
-- one of the argument starts with character '@'. -- the argument starts with character '@'.
------------------ ------------------
-- Add_Argument -- -- Add_Argument --
...@@ -123,13 +122,13 @@ package body Ada.Command_Line.Response_File is ...@@ -123,13 +122,13 @@ package body Ada.Command_Line.Response_File is
First_Char : Positive; First_Char : Positive;
-- Index of the first character of an argument in Line -- Index of the first character of an argument in Line
Last_Char : Natural; Last_Char : Natural;
-- Index of the last character of an argument in Line -- Index of the last character of an argument in Line
In_String : Boolean; In_String : Boolean;
-- True when inside a quoted string -- True when inside a quoted string
Arg : Positive; Arg : Positive;
function End_Of_File return Boolean; function End_Of_File return Boolean;
-- True when the end of the response file has been reached -- True when the end of the response file has been reached
...@@ -166,6 +165,7 @@ package body Ada.Command_Line.Response_File is ...@@ -166,6 +165,7 @@ package body Ada.Command_Line.Response_File is
procedure Get_Line is procedure Get_Line is
Ch : Character; Ch : Character;
begin begin
Last := 0; Last := 0;
...@@ -230,7 +230,6 @@ package body Ada.Command_Line.Response_File is ...@@ -230,7 +230,6 @@ package body Ada.Command_Line.Response_File is
if FD = Invalid_FD then if FD = Invalid_FD then
if Ignore_Non_Existing_Files then if Ignore_Non_Existing_Files then
return; return;
else else
raise File_Does_Not_Exist; raise File_Does_Not_Exist;
end if; end if;
...@@ -245,9 +244,11 @@ package body Ada.Command_Line.Response_File is ...@@ -245,9 +244,11 @@ package body Ada.Command_Line.Response_File is
Next => null, Next => null,
Prev => null); Prev => null);
Last_File := First_File; Last_File := First_File;
else else
declare declare
Current : File_Ptr := First_File; Current : File_Ptr := First_File;
begin begin
loop loop
if Current.Name.all = File_Name then if Current.Name.all = File_Name then
...@@ -303,10 +304,12 @@ package body Ada.Command_Line.Response_File is ...@@ -303,10 +304,12 @@ package body Ada.Command_Line.Response_File is
Character_Loop : Character_Loop :
while Last_Char <= Last loop while Last_Char <= Last loop
-- Inside a string, check only for '"' -- Inside a string, check only for '"'
if In_String then if In_String then
if Line (Last_Char) = '"' then if Line (Last_Char) = '"' then
-- Remove the '"' -- Remove the '"'
Line (Last_Char .. Last - 1) := Line (Last_Char .. Last - 1) :=
...@@ -314,6 +317,7 @@ package body Ada.Command_Line.Response_File is ...@@ -314,6 +317,7 @@ package body Ada.Command_Line.Response_File is
Last := Last - 1; Last := Last - 1;
-- End of string is end of argument -- End of string is end of argument
if Last_Char > Last or else if Last_Char > Last or else
Line (Last_Char) = ' ' or else Line (Last_Char) = ' ' or else
Line (Last_Char) = ASCII.HT Line (Last_Char) = ASCII.HT
...@@ -339,6 +343,7 @@ package body Ada.Command_Line.Response_File is ...@@ -339,6 +343,7 @@ package body Ada.Command_Line.Response_File is
end if; end if;
elsif Last_Char = Last then elsif Last_Char = Last then
-- An opening '"' at the end of the line is an error -- An opening '"' at the end of the line is an error
if Line (Last) = '"' then if Line (Last) = '"' then
...@@ -351,6 +356,7 @@ package body Ada.Command_Line.Response_File is ...@@ -351,6 +356,7 @@ package body Ada.Command_Line.Response_File is
end if; end if;
elsif Line (Last_Char) = '"' then elsif Line (Last_Char) = '"' then
-- Entering a quoted string: remove the '"' -- Entering a quoted string: remove the '"'
In_String := True; In_String := True;
...@@ -359,8 +365,7 @@ package body Ada.Command_Line.Response_File is ...@@ -359,8 +365,7 @@ package body Ada.Command_Line.Response_File is
Last := Last - 1; Last := Last - 1;
else else
-- Outside of quoted strings, white space ends the -- Outside quoted strings, white space ends the argument
-- argument.
exit Character_Loop exit Character_Loop
when Line (Last_Char + 1) = ' ' or else when Line (Last_Char + 1) = ' ' or else
...@@ -411,8 +416,8 @@ package body Ada.Command_Line.Response_File is ...@@ -411,8 +416,8 @@ package body Ada.Command_Line.Response_File is
Last_Arg := Last_Arg - 1; Last_Arg := Last_Arg - 1;
else else
-- Save the current arguments and get those in the -- Save the current arguments and get those in the new
-- new response file. -- response file.
declare declare
Inc_File_Name : constant String := Inc_File_Name : constant String :=
...@@ -435,6 +440,7 @@ package body Ada.Command_Line.Response_File is ...@@ -435,6 +440,7 @@ package body Ada.Command_Line.Response_File is
begin begin
-- Grow Arguments if it is not large enough -- Grow Arguments if it is not large enough
if Arguments'Last < New_Last_Arg then if Arguments'Last < New_Last_Arg then
Last_Arg := Arguments'Last; Last_Arg := Arguments'Last;
Free (Arguments); Free (Arguments);
...@@ -504,6 +510,7 @@ package body Ada.Command_Line.Response_File is ...@@ -504,6 +510,7 @@ package body Ada.Command_Line.Response_File is
exception exception
when others => when others =>
-- When an exception occurs, deallocate everything -- When an exception occurs, deallocate everything
Free (Arguments); Free (Arguments);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2006, Free Software Foundation, Inc. -- -- Copyright (C) 2006-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -748,7 +748,7 @@ package body Ada.Numerics.Generic_Complex_Arrays is ...@@ -748,7 +748,7 @@ package body Ada.Numerics.Generic_Complex_Arrays is
begin begin
if Left'Length (2) /= Right'Length (1) then if Left'Length (2) /= Right'Length (1) then
raise Constraint_Error with raise Constraint_Error with
"incompatible dimensions in matrix-matrix multipication"; "incompatible dimensions in matrix-matrix multiplication";
end if; end if;
gemm (Trans_A => No_Trans'Access, gemm (Trans_A => No_Trans'Access,
......
...@@ -623,14 +623,11 @@ package body Debug is ...@@ -623,14 +623,11 @@ package body Debug is
-- dx Force the binder to read (and then ignore) the xref information -- dx Force the binder to read (and then ignore) the xref information
-- in ali files (used to check that read circuit is working OK). -- in ali files (used to check that read circuit is working OK).
------------------------------------------------------------ --------------------------------------------
-- Documentation for the Debug Flags used in package Make -- -- Documentation for gnatmake Debug Flags --
------------------------------------------------------------ --------------------------------------------
-- Please note that such flags apply to all of Make clients,
-- such as gnatmake.
-- dn Do not delete temporary files creates by Make at the end -- dn Do not delete temporary files created by gnatmake at the end
-- of execution, such as temporary config pragma files, mapping -- of execution, such as temporary config pragma files, mapping
-- files or project path files. -- files or project path files.
...@@ -650,6 +647,18 @@ package body Debug is ...@@ -650,6 +647,18 @@ package body Debug is
-- dw Prints the list of units withed by the unit currently explored -- dw Prints the list of units withed by the unit currently explored
-- during the main loop of Make.Compile_Sources. -- during the main loop of Make.Compile_Sources.
---------------------------------------------
-- Documentation for gprbuild Debug Flags --
---------------------------------------------
-- dn Do not delete temporary files createed by gprbuild at the end
-- of execution, such as temporary config pragma files, mapping
-- files or project path files.
-- dt When a time stamp mismatch has been found for an ALI file,
-- display the source file name, the time stamp expected and
-- the time stamp found.
-------------------- --------------------
-- Set_Debug_Flag -- -- Set_Debug_Flag --
-------------------- --------------------
......
...@@ -177,11 +177,12 @@ __gnat_setenv (char *name, char *value) ...@@ -177,11 +177,12 @@ __gnat_setenv (char *name, char *value)
sprintf (expression, "%s=%s", name, value); sprintf (expression, "%s=%s", name, value);
putenv (expression); putenv (expression);
#if (defined (__FreeBSD__) && (__FreeBSD__ < 7)) || defined (__APPLE__) \ #if (defined (__FreeBSD__) && (__FreeBSD__ < 7)) \
|| defined (__MINGW32__) ||(defined (__vxworks) && ! defined (__RTP__)) || defined (__APPLE__) || defined (__MINGW32__) \
/* On some systems like pre-7 FreeBSD, MacOS X and Windows, putenv is making ||(defined (__vxworks) && ! defined (__RTP__))
a copy of the expression string so we can free it after the call to /* On some systems like FreeBSD 6.x and earlier, MacOS X and Windows,
putenv */ putenv is making a copy of the expression string so we can free
it after the call to putenv */
free (expression); free (expression);
#endif #endif
#endif #endif
......
...@@ -40,9 +40,9 @@ package Exp_Aggr is ...@@ -40,9 +40,9 @@ package Exp_Aggr is
-- This procedure performs in-place aggregate assignment. -- This procedure performs in-place aggregate assignment.
procedure Convert_Aggr_In_Allocator procedure Convert_Aggr_In_Allocator
(Alloc : Node_Id; (Alloc : Node_Id;
Decl : Node_Id; Decl : Node_Id;
Aggr : Node_Id); Aggr : Node_Id);
-- Alloc is the allocator whose expression is the aggregate Aggr. -- Alloc is the allocator whose expression is the aggregate Aggr.
-- Decl is an N_Object_Declaration created during allocator expansion. -- Decl is an N_Object_Declaration created during allocator expansion.
-- This procedure perform in-place aggregate assignment into the -- This procedure perform in-place aggregate assignment into the
......
...@@ -433,11 +433,10 @@ package body Exp_Ch2 is ...@@ -433,11 +433,10 @@ package body Exp_Ch2 is
-- ??? passing a formal as actual for a mode IN formal is -- ??? passing a formal as actual for a mode IN formal is
-- considered as an assignment? -- considered as an assignment?
if Nkind (Parent (N)) = N_Procedure_Call_Statement if Nkind_In (Parent (N), N_Procedure_Call_Statement,
or else Nkind (Parent (N)) = N_Entry_Call_Statement N_Entry_Call_Statement)
or else or else (Nkind (Parent (N)) = N_Assignment_Statement
(Nkind (Parent (N)) = N_Assignment_Statement and then N = Name (Parent (N)))
and then N = Name (Parent (N)))
then then
return True; return True;
...@@ -451,9 +450,9 @@ package body Exp_Ch2 is ...@@ -451,9 +450,9 @@ package body Exp_Ch2 is
-- which case there is an implicit dereference, and the formal itself -- which case there is an implicit dereference, and the formal itself
-- is not being assigned to). -- is not being assigned to).
elsif (Nkind (Parent (N)) = N_Selected_Component elsif Nkind_In (Parent (N), N_Selected_Component,
or else Nkind (Parent (N)) = N_Indexed_Component N_Indexed_Component,
or else Nkind (Parent (N)) = N_Slice) N_Slice)
and then N = Prefix (Parent (N)) and then N = Prefix (Parent (N))
and then not Is_Access_Type (Etype (N)) and then not Is_Access_Type (Etype (N))
and then In_Assignment_Context (Parent (N)) and then In_Assignment_Context (Parent (N))
...@@ -697,7 +696,7 @@ package body Exp_Ch2 is ...@@ -697,7 +696,7 @@ package body Exp_Ch2 is
begin begin
-- Simple reference case -- Simple reference case
if Nkind (N) = N_Identifier or else Nkind (N) = N_Expanded_Name then if Nkind_In (N, N_Identifier, N_Expanded_Name) then
if Is_Formal (Entity (N)) then if Is_Formal (Entity (N)) then
return Entity (N); return Entity (N);
......
...@@ -635,8 +635,8 @@ package body Exp_Pakd is ...@@ -635,8 +635,8 @@ package body Exp_Pakd is
Attribute_Name => Name_Pos, Attribute_Name => Name_Pos,
Expressions => New_List ( Expressions => New_List (
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Styp, Loc), Prefix => New_Occurrence_Of (Styp, Loc),
Attribute_Name => Name_First))))); Attribute_Name => Name_First)))));
end if; end if;
Set_Paren_Count (Newsub, 1); Set_Paren_Count (Newsub, 1);
...@@ -960,23 +960,23 @@ package body Exp_Pakd is ...@@ -960,23 +960,23 @@ package body Exp_Pakd is
Make_Range (Loc, Make_Range (Loc,
Low_Bound => Low_Bound =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of (Indx_Typ, Loc), New_Occurrence_Of (Indx_Typ, Loc),
Attribute_Name => Name_Pos, Attribute_Name => Name_Pos,
Expressions => New_List ( Expressions => New_List (
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of (Indx_Typ, Loc), New_Occurrence_Of (Indx_Typ, Loc),
Attribute_Name => Name_First))), Attribute_Name => Name_First))),
High_Bound => High_Bound =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of (Indx_Typ, Loc), New_Occurrence_Of (Indx_Typ, Loc),
Attribute_Name => Name_Pos, Attribute_Name => Name_Pos,
Expressions => New_List ( Expressions => New_List (
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of (Indx_Typ, Loc), New_Occurrence_Of (Indx_Typ, Loc),
Attribute_Name => Name_Last))))))); Attribute_Name => Name_Last)))))));
...@@ -1622,8 +1622,8 @@ package body Exp_Pakd is ...@@ -1622,8 +1622,8 @@ package body Exp_Pakd is
Name => New_Occurrence_Of (Set_nn, Loc), Name => New_Occurrence_Of (Set_nn, Loc),
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => Obj,
Prefix => Obj), Attribute_Name => Name_Address),
Subscr, Subscr,
Unchecked_Convert_To (Bits_nn, Unchecked_Convert_To (Bits_nn,
Convert_To (Ctyp, Rhs))))); Convert_To (Ctyp, Rhs)))));
...@@ -1881,36 +1881,38 @@ package body Exp_Pakd is ...@@ -1881,36 +1881,38 @@ package body Exp_Pakd is
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => L,
Prefix => L), Attribute_Name => Name_Address),
Make_Op_Multiply (Loc, Make_Op_Multiply (Loc,
Left_Opnd => Left_Opnd =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of New_Occurrence_Of
(Etype (First_Index (Ltyp)), Loc), (Etype (First_Index (Ltyp)), Loc),
Attribute_Name => Name_Range_Length), Attribute_Name => Name_Range_Length),
Right_Opnd => Right_Opnd =>
Make_Integer_Literal (Loc, Component_Size (Ltyp))), Make_Integer_Literal (Loc, Component_Size (Ltyp))),
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => R,
Prefix => R), Attribute_Name => Name_Address),
Make_Op_Multiply (Loc, Make_Op_Multiply (Loc,
Left_Opnd => Left_Opnd =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of New_Occurrence_Of
(Etype (First_Index (Rtyp)), Loc), (Etype (First_Index (Rtyp)), Loc),
Attribute_Name => Name_Range_Length), Attribute_Name => Name_Range_Length),
Right_Opnd => Right_Opnd =>
Make_Integer_Literal (Loc, Component_Size (Rtyp))), Make_Integer_Literal (Loc, Component_Size (Rtyp))),
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => New_Occurrence_Of (Result_Ent, Loc),
Prefix => New_Occurrence_Of (Result_Ent, Loc)))))); Attribute_Name => Name_Address)))));
Rewrite (N, Rewrite (N,
New_Occurrence_Of (Result_Ent, Loc)); New_Occurrence_Of (Result_Ent, Loc));
...@@ -2032,8 +2034,8 @@ package body Exp_Pakd is ...@@ -2032,8 +2034,8 @@ package body Exp_Pakd is
Name => New_Occurrence_Of (Get_nn, Loc), Name => New_Occurrence_Of (Get_nn, Loc),
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => Obj,
Prefix => Obj), Attribute_Name => Name_Address),
Subscr)))); Subscr))));
end; end;
end if; end if;
...@@ -2074,8 +2076,8 @@ package body Exp_Pakd is ...@@ -2074,8 +2076,8 @@ package body Exp_Pakd is
Make_Op_Multiply (Loc, Make_Op_Multiply (Loc,
Left_Opnd => Left_Opnd =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length, Prefix => New_Occurrence_Of (Ltyp, Loc),
Prefix => New_Occurrence_Of (Ltyp, Loc)), Attribute_Name => Name_Length),
Right_Opnd => Right_Opnd =>
Make_Integer_Literal (Loc, Component_Size (Ltyp))); Make_Integer_Literal (Loc, Component_Size (Ltyp)));
...@@ -2083,8 +2085,8 @@ package body Exp_Pakd is ...@@ -2083,8 +2085,8 @@ package body Exp_Pakd is
Make_Op_Multiply (Loc, Make_Op_Multiply (Loc,
Left_Opnd => Left_Opnd =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length, Prefix => New_Occurrence_Of (Rtyp, Loc),
Prefix => New_Occurrence_Of (Rtyp, Loc)), Attribute_Name => Name_Length),
Right_Opnd => Right_Opnd =>
Make_Integer_Literal (Loc, Component_Size (Rtyp))); Make_Integer_Literal (Loc, Component_Size (Rtyp)));
...@@ -2125,14 +2127,14 @@ package body Exp_Pakd is ...@@ -2125,14 +2127,14 @@ package body Exp_Pakd is
Name => New_Occurrence_Of (RTE (RE_Bit_Eq), Loc), Name => New_Occurrence_Of (RTE (RE_Bit_Eq), Loc),
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => L,
Prefix => L), Attribute_Name => Name_Address),
LLexpr, LLexpr,
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => R,
Prefix => R), Attribute_Name => Name_Address),
RLexpr))); RLexpr)));
end if; end if;
...@@ -2244,22 +2246,23 @@ package body Exp_Pakd is ...@@ -2244,22 +2246,23 @@ package body Exp_Pakd is
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => Opnd,
Prefix => Opnd), Attribute_Name => Name_Address),
Make_Op_Multiply (Loc, Make_Op_Multiply (Loc,
Left_Opnd => Left_Opnd =>
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix =>
New_Occurrence_Of New_Occurrence_Of
(Etype (First_Index (Rtyp)), Loc), (Etype (First_Index (Rtyp)), Loc),
Attribute_Name => Name_Range_Length), Attribute_Name => Name_Range_Length),
Right_Opnd => Right_Opnd =>
Make_Integer_Literal (Loc, Component_Size (Rtyp))), Make_Integer_Literal (Loc, Component_Size (Rtyp))),
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Attribute_Name => Name_Address, Prefix => New_Occurrence_Of (Result_Ent, Loc),
Prefix => New_Occurrence_Of (Result_Ent, Loc)))))); Attribute_Name => Name_Address)))));
Rewrite (N, Rewrite (N,
New_Occurrence_Of (Result_Ent, Loc)); New_Occurrence_Of (Result_Ent, Loc));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- B o d y -- -- B o d y --
-- (Soft Binding Version) -- -- (Soft Binding Version) --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -49,17 +49,6 @@ with GNAT.Altivec.Low_Level_Interface; use GNAT.Altivec.Low_Level_Interface; ...@@ -49,17 +49,6 @@ with GNAT.Altivec.Low_Level_Interface; use GNAT.Altivec.Low_Level_Interface;
package body GNAT.Altivec.Low_Level_Vectors is package body GNAT.Altivec.Low_Level_Vectors is
-- This package assumes C_float is an IEEE single-precision float type
pragma Assert (C_float'Machine_Radix = 2);
pragma Assert (C_float'Machine_Mantissa = 24);
pragma Assert (C_float'Machine_Emin = -125);
pragma Assert (C_float'Machine_Emax = 128);
pragma Assert (C_float'Machine_Rounds);
pragma Assert (not C_float'Machine_Overflows);
pragma Assert (C_float'Signed_Zeros);
pragma Assert (C_float'Denorm);
-- Pixel types. As defined in [PIM-2.1 Data types]: -- Pixel types. As defined in [PIM-2.1 Data types]:
-- A 16-bit pixel is 1/5/5/5; -- A 16-bit pixel is 1/5/5/5;
-- A 32-bit pixel is 8/8/8/8. -- A 32-bit pixel is 8/8/8/8.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -341,6 +341,14 @@ package GNAT.Altivec is ...@@ -341,6 +341,14 @@ package GNAT.Altivec is
type C_float is digits FLOAT_DIGIT range FLOAT_MIN .. FLOAT_MAX; type C_float is digits FLOAT_DIGIT range FLOAT_MIN .. FLOAT_MAX;
for C_float'Size use FLOAT_BIT; for C_float'Size use FLOAT_BIT;
-- Altivec operations always use the standard native floating-point
-- support of the target. Note that this means that there may be
-- minor differences in results between targets when the floating-
-- point implementations are slightly different, as would happen
-- with normal non-altivec floating-point operations. In particular
-- the Altivec simulations may yield slightly different results
-- from those obtained on a true hardware Altivec target if the
-- floating-point implementation is not 100% compatible.
---------------------- ----------------------
-- pixel components -- -- pixel components --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2006-2007, AdaCore -- -- -- Copyright (C) 2006-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -33,22 +33,21 @@ ...@@ -33,22 +33,21 @@
-- Extended pseudo-random number generation -- Extended pseudo-random number generation
-- This package provides a type representing pseudo-random number -- This package provides a type representing pseudo-random number generators,
-- generators, and subprograms to extract various distributions of numbers -- and subprograms to extract various distributions of numbers from them. It
-- from them. It also provides types for representing initialization values -- also provides types for representing initialization values and snapshots of
-- and snapshots of internal generator state, which permit reproducible -- internal generator state, which permit reproducible pseudo-random streams.
-- pseudo-random streams.
-- The generator currently provided by this package has an extremely long -- The generator currently provided by this package has an extremely long
-- period (at least 2**19937-1), and passes the Big Crush test suite, with -- period (at least 2**19937-1), and passes the Big Crush test suite, with the
-- the exception of the two linear complexity tests. Therefore, it is -- exception of the two linear complexity tests. Therefore, it is suitable for
-- suitable for simulations, but should not be used as a cryptographic -- simulations, but should not be used as a cryptographic pseudo-random source
-- pseudo-random source without additional processing. -- without additional processing.
-- The design of this package effects some simplification from that of -- The design of this package effects is simplified compared to the design
-- the standard Ada.Numerics packages. There is no separate State type; -- of standard Ada.Numerics packages. There is no separate State type; the
-- the Generator type itself suffices for this purpose. The parameter -- Generator type itself suffices for this purpose. The parameter modes on
-- modes on Reset procedures better reflect the effect of these routines. -- Reset procedures better reflect the effect of these routines.
with System.Random_Numbers; with System.Random_Numbers;
with Interfaces; use Interfaces; with Interfaces; use Interfaces;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2006, AdaCore -- -- Copyright (C) 2001-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
-- This is the Windows/NT version of this package -- This is the Windows/NT version of this package
-- This package should not be directly with'ed by an application program
package GNAT.Sockets.Linker_Options is package GNAT.Sockets.Linker_Options is
private private
pragma Linker_Options ("-lws2_32"); pragma Linker_Options ("-lws2_32");
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2005, AdaCore -- -- Copyright (C) 2001-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
-- This is the Solaris version of this package -- This is the Solaris version of this package
-- This package should not be directly with'ed by an application program
package GNAT.Sockets.Linker_Options is package GNAT.Sockets.Linker_Options is
private private
pragma Linker_Options ("-lnsl"); pragma Linker_Options ("-lnsl");
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2005, AdaCore -- -- Copyright (C) 2001-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -38,5 +38,7 @@ ...@@ -38,5 +38,7 @@
-- are required. On some targets a target specific version of this unit -- are required. On some targets a target specific version of this unit
-- ensures linking with required libraries for proper sockets operation. -- ensures linking with required libraries for proper sockets operation.
-- This package should not be directly with'ed by an application program
package GNAT.Sockets.Linker_Options is package GNAT.Sockets.Linker_Options is
end GNAT.Sockets.Linker_Options; end GNAT.Sockets.Linker_Options;
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
-- This version is used on VMS, LynxOS, and VxWorks. There are two versions of -- This version is used on VMS, LynxOS, and VxWorks. There are two versions of
-- the body: one for VMS and LynxOS, the other for VxWorks. -- the body: one for VMS and LynxOS, the other for VxWorks.
-- This package should not be directly with'ed by an application
package GNAT.Sockets.Thin.Task_Safe_NetDB is package GNAT.Sockets.Thin.Task_Safe_NetDB is
---------------------------------------- ----------------------------------------
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
-- from C; see gsocket.h for details. Different versions are provided on -- from C; see gsocket.h for details. Different versions are provided on
-- platforms where this functionality is implemented in Ada. -- platforms where this functionality is implemented in Ada.
-- This package should not be directly with'ed by an application
package GNAT.Sockets.Thin.Task_Safe_NetDB is package GNAT.Sockets.Thin.Task_Safe_NetDB is
---------------------------------------- ----------------------------------------
......
...@@ -68,7 +68,6 @@ package body GNAT.Threads is ...@@ -68,7 +68,6 @@ package body GNAT.Threads is
Parm : Void_Ptr; Parm : Void_Ptr;
Code : Code_Proc) Code : Code_Proc)
is is
pragma Unreferenced (Parm);
pragma Priority (Prio); pragma Priority (Prio);
pragma Storage_Size (Stsz); pragma Storage_Size (Stsz);
end Thread; end Thread;
......
...@@ -208,10 +208,10 @@ package Lib is ...@@ -208,10 +208,10 @@ package Lib is
-- Special Handling of Subprogram Bodies -- -- Special Handling of Subprogram Bodies --
------------------------------------------- -------------------------------------------
-- A subprogram body (in an adb file) may stand for both a spec and a -- A subprogram body (in an adb file) may stand for both a spec and a body.
-- body. A simple model (and one that was adopted through version 2.07), -- A simple model (and one that was adopted through version 2.07) is simply
-- is simply to assume that such an adb file acts as its own spec if no -- to assume that such an adb file acts as its own spec if no ads file is
-- ads file is present. -- is present.
-- However, this is not correct. RM 10.1.4(4) requires that such a body -- However, this is not correct. RM 10.1.4(4) requires that such a body
-- act as a spec unless a subprogram declaration of the same name is -- act as a spec unless a subprogram declaration of the same name is
......
...@@ -610,7 +610,7 @@ package body Ch9 is ...@@ -610,7 +610,7 @@ package body Ch9 is
if (Is_Overriding or else Not_Overriding) then if (Is_Overriding or else Not_Overriding) then
if Ada_Version < Ada_05 then if Ada_Version < Ada_05 then
Error_Msg_SP (" overriding indicator is an Ada 2005 extension"); Error_Msg_SP ("overriding indicator is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch"); Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
elsif Token = Tok_Entry then elsif Token = Tok_Entry then
...@@ -786,7 +786,7 @@ package body Ch9 is ...@@ -786,7 +786,7 @@ package body Ch9 is
if (Is_Overriding or else Not_Overriding) then if (Is_Overriding or else Not_Overriding) then
if Ada_Version < Ada_05 then if Ada_Version < Ada_05 then
Error_Msg_SP (" overriding indicator is an Ada 2005 extension"); Error_Msg_SP ("overriding indicator is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch"); Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
elsif Token /= Tok_Entry then elsif Token /= Tok_Entry then
......
...@@ -1080,7 +1080,7 @@ package body System.File_IO is ...@@ -1080,7 +1080,7 @@ package body System.File_IO is
if File.Shared_Status = Yes if File.Shared_Status = Yes
or else File.Name'Length <= 1 or else File.Name'Length <= 1
or else File.Is_System_File or else File.Is_System_File
or else (not File.Is_Regular_File) or else not File.Is_Regular_File
then then
raise Use_Error; raise Use_Error;
......
...@@ -140,9 +140,8 @@ package body System.Interrupts is ...@@ -140,9 +140,8 @@ package body System.Interrupts is
-- Local Tasks -- -- Local Tasks --
----------------- -----------------
-- WARNING: System.Tasking.Stages performs calls to this task -- WARNING: System.Tasking.Stages performs calls to this task with
-- with low-level constructs. Do not change this spec without synchro- -- low-level constructs. Do not change this spec without synchronizing it.
-- nizing it.
task Interrupt_Manager is task Interrupt_Manager is
entry Detach_Interrupt_Entries (T : Task_Id); entry Detach_Interrupt_Entries (T : Task_Id);
...@@ -183,10 +182,10 @@ package body System.Interrupts is ...@@ -183,10 +182,10 @@ package body System.Interrupts is
task type Server_Task (Interrupt : Interrupt_ID) is task type Server_Task (Interrupt : Interrupt_ID) is
pragma Priority (System.Interrupt_Priority'Last); pragma Priority (System.Interrupt_Priority'Last);
-- Note: the above pragma Priority is strictly speaking improper -- Note: the above pragma Priority is strictly speaking improper since
-- since it is outside the range of allowed priorities, but the -- it is outside the range of allowed priorities, but the compiler
-- compiler treats system units specially and does not apply -- treats system units specially and does not apply this range checking
-- this range checking rule to system units. -- rule to system units.
end Server_Task; end Server_Task;
...@@ -210,9 +209,9 @@ package body System.Interrupts is ...@@ -210,9 +209,9 @@ package body System.Interrupts is
(others => (null, Static => False)); (others => (null, Static => False));
pragma Volatile_Components (User_Handler); pragma Volatile_Components (User_Handler);
-- Holds the protected procedure handler (if any) and its Static -- Holds the protected procedure handler (if any) and its Static
-- information for each interrupt. A handler is a Static one if -- information for each interrupt. A handler is a Static one if it is
-- it is specified through the pragma Attach_Handler. -- specified through the pragma Attach_Handler. Attach_Handler. Otherwise,
-- Attach_Handler. Otherwise, not static) -- not static)
User_Entry : array (Interrupt_ID'Range) of Entry_Assoc := User_Entry : array (Interrupt_ID'Range) of Entry_Assoc :=
(others => (T => Null_Task, E => Null_Task_Entry)); (others => (T => Null_Task, E => Null_Task_Entry));
...@@ -230,16 +229,16 @@ package body System.Interrupts is ...@@ -230,16 +229,16 @@ package body System.Interrupts is
Last_Unblocker : Last_Unblocker :
array (Interrupt_ID'Range) of Task_Id := (others => Null_Task); array (Interrupt_ID'Range) of Task_Id := (others => Null_Task);
pragma Atomic_Components (Last_Unblocker); pragma Atomic_Components (Last_Unblocker);
-- Holds the ID of the last Task which Unblocked this Interrupt. -- Holds the ID of the last Task which Unblocked this Interrupt. It
-- It contains Null_Task if no tasks have ever requested the -- contains Null_Task if no tasks have ever requested the Unblocking
-- Unblocking operation or the Interrupt is currently Blocked. -- operation or the Interrupt is currently Blocked.
Server_ID : array (Interrupt_ID'Range) of Task_Id := Server_ID : array (Interrupt_ID'Range) of Task_Id :=
(others => Null_Task); (others => Null_Task);
pragma Atomic_Components (Server_ID); pragma Atomic_Components (Server_ID);
-- Holds the Task_Id of the Server_Task for each interrupt. -- Holds the Task_Id of the Server_Task for each interrupt. Task_Id is
-- Task_Id is needed to accomplish locking per Interrupt base. Also -- needed to accomplish locking per Interrupt base. Also is needed to
-- is needed to decide whether to create a new Server_Task. -- decide whether to create a new Server_Task.
-- Type and Head, Tail of the list containing Registered Interrupt -- Type and Head, Tail of the list containing Registered Interrupt
-- Handlers. These definitions are used to register the handlers -- Handlers. These definitions are used to register the handlers
...@@ -264,20 +263,20 @@ package body System.Interrupts is ...@@ -264,20 +263,20 @@ package body System.Interrupts is
----------------------- -----------------------
function Is_Registered (Handler : Parameterless_Handler) return Boolean; function Is_Registered (Handler : Parameterless_Handler) return Boolean;
-- See if the Handler has been "pragma"ed using Interrupt_Handler. -- See if the Handler has been "pragma"ed using Interrupt_Handler. Always
-- Always consider a null handler as registered. -- consider a null handler as registered.
-------------------- --------------------
-- Attach_Handler -- -- Attach_Handler --
-------------------- --------------------
-- Calling this procedure with New_Handler = null and Static = True -- Calling this procedure with New_Handler = null and Static = True means
-- means we want to detach the current handler regardless of the -- we want to detach the current handler regardless of the previous
-- previous handler's binding status (ie. do not care if it is a -- handler's binding status (ie. do not care if it is a dynamic or static
-- dynamic or static handler). -- handler).
-- This option is needed so that during the finalization of a PO, we -- This option is needed so that during the finalization of a PO, we can
-- can detach handlers attached through pragma Attach_Handler. -- detach handlers attached through pragma Attach_Handler.
procedure Attach_Handler procedure Attach_Handler
(New_Handler : Parameterless_Handler; (New_Handler : Parameterless_Handler;
...@@ -298,8 +297,8 @@ package body System.Interrupts is ...@@ -298,8 +297,8 @@ package body System.Interrupts is
-- Bind_Interrupt_To_Entry -- -- Bind_Interrupt_To_Entry --
----------------------------- -----------------------------
-- This procedure raises a Program_Error if it tries to bind an -- This procedure raises a Program_Error if it tries to bind an interrupt
-- interrupt to which an Entry or a Procedure is already bound. -- to which an Entry or a Procedure is already bound.
procedure Bind_Interrupt_To_Entry procedure Bind_Interrupt_To_Entry
(T : Task_Id; (T : Task_Id;
...@@ -389,13 +388,13 @@ package body System.Interrupts is ...@@ -389,13 +388,13 @@ package body System.Interrupts is
-- Exchange_Handler -- -- Exchange_Handler --
---------------------- ----------------------
-- Calling this procedure with New_Handler = null and Static = True -- Calling this procedure with New_Handler = null and Static = True means
-- means we want to detach the current handler regardless of the -- we want to detach the current handler regardless of the previous
-- previous handler's binding status (ie. do not care if it is a -- handler's binding status (ie. do not care if it is a dynamic or static
-- dynamic or static handler). -- handler).
-- This option is needed so that during the finalization of a PO, -- This option is needed so that during the finalization of a PO, we can
-- we can detach handlers attached through pragma Attach_Handler. -- detach handlers attached through pragma Attach_Handler.
procedure Exchange_Handler procedure Exchange_Handler
(Old_Handler : out Parameterless_Handler; (Old_Handler : out Parameterless_Handler;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
-- -- -- --
-- S Y S T E M . T A S K _ I N F O -- -- S Y S T E M . T A S K _ I N F O --
-- -- -- --
-- S p e c -- -- B o d y --
-- -- -- --
-- Copyright (C) 2007, Free Software Foundation, Inc. -- -- Copyright (C) 2007, Free Software Foundation, Inc. --
-- -- -- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1997-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1997-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -46,7 +46,7 @@ package System.VMS_Exception_Table is ...@@ -46,7 +46,7 @@ package System.VMS_Exception_Table is
-- Register an exception in the hash table mapping with a VMS -- Register an exception in the hash table mapping with a VMS
-- condition code. -- condition code.
-- LOTS more comments needed here regarding the enire scheme ??? -- LOTS more comments needed here regarding the entire scheme ???
private private
......
...@@ -756,7 +756,6 @@ package body Sem_Case is ...@@ -756,7 +756,6 @@ package body Sem_Case is
else else
Choice := First (Get_Choices (Alt)); Choice := First (Get_Choices (Alt));
while Present (Choice) loop while Present (Choice) loop
Analyze (Choice); Analyze (Choice);
Kind := Nkind (Choice); Kind := Nkind (Choice);
......
...@@ -458,6 +458,10 @@ begin ...@@ -458,6 +458,10 @@ begin
Spawn (Addr2line_Cmd.all, Spawn (Addr2line_Cmd.all,
Addr2line_Args (1 .. Addr2line_Args_Count), Success); Addr2line_Args (1 .. Addr2line_Args_Count), Success);
if not Success then
Error ("Couldn't spawn " & Addr2line_Cmd.all);
end if;
exception exception
when others => when others =>
......
...@@ -63,6 +63,9 @@ procedure XEinfo is ...@@ -63,6 +63,9 @@ procedure XEinfo is
Err : exception; Err : exception;
pragma Warnings (Off);
-- These seem not to be referenced, but they are (by * operator)
A : VString := Nul; A : VString := Nul;
B : VString := Nul; B : VString := Nul;
C : VString := Nul; C : VString := Nul;
...@@ -85,6 +88,8 @@ procedure XEinfo is ...@@ -85,6 +88,8 @@ procedure XEinfo is
Rtn : VString := Nul; Rtn : VString := Nul;
Term : VString := Nul; Term : VString := Nul;
pragma Warnings (On);
InB : File_Type; InB : File_Type;
-- Used to read initial header from body -- Used to read initial header from body
...@@ -94,41 +99,45 @@ procedure XEinfo is ...@@ -94,41 +99,45 @@ procedure XEinfo is
Ofile : File_Type; Ofile : File_Type;
-- Used to write output file -- Used to write output file
wsp : Pattern := NSpan (' ' & ASCII.HT); wsp : constant Pattern := NSpan (' ' & ASCII.HT);
Comment : Pattern := wsp & "--"; Comment : constant Pattern := wsp & "--";
For_Rep : Pattern := wsp & "for"; For_Rep : constant Pattern := wsp & "for";
Get_Func : Pattern := wsp * A & "function" & wsp & Break (' ') * Name; Get_Func : constant Pattern := wsp * A & "function" & wsp
Inline : Pattern := wsp & "pragma Inline (" & Break (')') * Name; & Break (' ') * Name;
Get_Pack : Pattern := wsp & "package "; Inline : constant Pattern := wsp & "pragma Inline (" & Break (')') * Name;
Get_Enam : Pattern := wsp & Break (',') * N & ','; Get_Pack : constant Pattern := wsp & "package ";
Find_Fun : Pattern := wsp & "function"; Get_Enam : constant Pattern := wsp & Break (',') * N & ',';
F_Subtyp : Pattern := wsp * A & "subtype " & Break (' ') * N; Find_Fun : constant Pattern := wsp & "function";
G_Subtyp : Pattern := wsp & "subtype" & wsp & Break (' ') * NewS F_Subtyp : constant Pattern := wsp * A & "subtype " & Break (' ') * N;
& wsp & "is" & wsp & Break (" ;") * OldS G_Subtyp : constant Pattern := wsp & "subtype" & wsp & Break (' ') * NewS
& wsp & ';' & wsp & Rtab (0); & wsp & "is" & wsp & Break (" ;") * OldS
F_Typ : Pattern := wsp * A & "type " & Break (' ') * N & " is ("; & wsp & ';' & wsp & Rtab (0);
Get_Nam : Pattern := wsp * A & Break (",)") * Nam & Len (1) * Term; F_Typ : constant Pattern := wsp * A & "type " & Break (' ') * N &
Get_Styp : Pattern := wsp * A & "subtype " & Break (' ') * N; " is (";
Get_N1 : Pattern := wsp & Break (' ') * N1; Get_Nam : constant Pattern := wsp * A & Break (",)") * Nam
Get_N2 : Pattern := wsp & "-- " & Rest * N2; & Len (1) * Term;
Get_N3 : Pattern := wsp & Break (';') * N3; Get_Styp : constant Pattern := wsp * A & "subtype " & Break (' ') * N;
Get_FN : Pattern := wsp * C & "function" & wsp & Break (" (") * FN; Get_N1 : constant Pattern := wsp & Break (' ') * N1;
Is_Rturn : Pattern := BreakX ('r') & "return"; Get_N2 : constant Pattern := wsp & "-- " & Rest * N2;
Is_Begin : Pattern := wsp & "begin"; Get_N3 : constant Pattern := wsp & Break (';') * N3;
Get_Asrt : Pattern := wsp & "pragma Assert"; Get_FN : constant Pattern := wsp * C & "function" & wsp
Semicoln : Pattern := BreakX (';'); & Break (" (") * FN;
Get_Cmnt : Pattern := BreakX ('-') * A & "--"; Is_Rturn : constant Pattern := BreakX ('r') & "return";
Get_Expr : Pattern := wsp & "return " & Break (';') * Expr; Is_Begin : constant Pattern := wsp & "begin";
Chek_End : Pattern := wsp & "end" & BreakX (';') & ';'; Get_Asrt : constant Pattern := wsp & "pragma Assert";
Get_B1 : Pattern := BreakX (' ') * A & " in " & Rest * B; Semicoln : constant Pattern := BreakX (';');
Get_B2 : Pattern := BreakX (' ') * A & " = " & Rest * B; Get_Cmnt : constant Pattern := BreakX ('-') * A & "--";
Get_B3 : Pattern := BreakX (' ') * A & " /= " & Rest * B; Get_Expr : constant Pattern := wsp & "return " & Break (';') * Expr;
To_Paren : Pattern := wsp * Filler & '('; Chek_End : constant Pattern := wsp & "end" & BreakX (';') & ';';
Get_Fml : Pattern := Break (" :") * Formal & wsp & ':' & wsp Get_B1 : constant Pattern := BreakX (' ') * A & " in " & Rest * B;
& BreakX (" );") * Formaltyp; Get_B2 : constant Pattern := BreakX (' ') * A & " = " & Rest * B;
Nxt_Fml : Pattern := wsp & "; "; Get_B3 : constant Pattern := BreakX (' ') * A & " /= " & Rest * B;
Get_Rtn : Pattern := wsp & "return" & wsp & BreakX (" ;") * Rtn; To_Paren : constant Pattern := wsp * Filler & '(';
Rem_Prn : Pattern := wsp & ')'; Get_Fml : constant Pattern := Break (" :") * Formal & wsp & ':' & wsp
& BreakX (" );") * Formaltyp;
Nxt_Fml : constant Pattern := wsp & "; ";
Get_Rtn : constant Pattern := wsp & "return" & wsp & BreakX (" ;") * Rtn;
Rem_Prn : constant Pattern := wsp & ')';
M : Match_Result; M : Match_Result;
......
...@@ -63,18 +63,21 @@ procedure XNmake is ...@@ -63,18 +63,21 @@ procedure XNmake is
Err : exception; Err : exception;
-- Raised to terminate execution -- Raised to terminate execution
A : VString := Nul; pragma Warnings (Off);
Arg : VString := Nul; -- The following are modified by * operator
Arg_List : VString := Nul;
Comment : VString := Nul; A : VString := Nul;
Default : VString := Nul; Arg : VString := Nul;
Field : VString := Nul; Arg_List : VString := Nul;
Line : VString := Nul; Comment : VString := Nul;
Node : VString := Nul; Default : VString := Nul;
Op_Name : VString := Nul; Field : VString := Nul;
Prevl : VString := Nul; Line : VString := Nul;
Synonym : VString := Nul; Node : VString := Nul;
X : VString := Nul; Op_Name : VString := Nul;
Prevl : VString := Nul;
Synonym : VString := Nul;
X : VString := Nul;
NWidth : Natural; NWidth : Natural;
...@@ -90,37 +93,43 @@ procedure XNmake is ...@@ -90,37 +93,43 @@ procedure XNmake is
InS, InT : Ada.Text_IO.File_Type; InS, InT : Ada.Text_IO.File_Type;
OutS, OutB : Sfile; OutS, OutB : Sfile;
wsp : Pattern := Span (' ' & ASCII.HT); wsp : constant Pattern := Span (' ' & ASCII.HT);
Body_Only : Pattern := BreakX (' ') * X & Span (' ') & "-- body only"; Body_Only : constant Pattern := BreakX (' ') * X
Spec_Only : Pattern := BreakX (' ') * X & Span (' ') & "-- spec only"; & Span (' ') & "-- body only";
Spec_Only : constant Pattern := BreakX (' ') * X
& Span (' ') & "-- spec only";
Node_Hdr : Pattern := wsp & "-- N_" & Rest * Node; Node_Hdr : constant Pattern := wsp & "-- N_" & Rest * Node;
Punc : Pattern := BreakX (" .,"); Punc : constant Pattern := BreakX (" .,");
Binop : Pattern := wsp & "-- plus fields for binary operator"; Binop : constant Pattern := wsp
Unop : Pattern := wsp & "-- plus fields for unary operator"; & "-- plus fields for binary operator";
Syn : Pattern := wsp & "-- " & Break (' ') * Synonym Unop : constant Pattern := wsp
& " (" & Break (')') * Field & Rest * Comment; & "-- plus fields for unary operator";
Syn : constant Pattern := wsp & "-- " & Break (' ') * Synonym
& " (" & Break (')') * Field
& Rest * Comment;
Templ : Pattern := BreakX ('T') * A & "T e m p l a t e"; Templ : constant Pattern := BreakX ('T') * A & "T e m p l a t e";
Spec : Pattern := BreakX ('S') * A & "S p e c"; Spec : constant Pattern := BreakX ('S') * A & "S p e c";
Sem_Field : Pattern := BreakX ('-') & "-Sem"; Sem_Field : constant Pattern := BreakX ('-') & "-Sem";
Lib_Field : Pattern := BreakX ('-') & "-Lib"; Lib_Field : constant Pattern := BreakX ('-') & "-Lib";
Get_Field : Pattern := BreakX (Decimal_Digit_Set) * Field; Get_Field : constant Pattern := BreakX (Decimal_Digit_Set) * Field;
Get_Dflt : Pattern := BreakX ('(') & "(set to " Get_Dflt : constant Pattern := BreakX ('(') & "(set to "
& Break (" ") * Default & " if"; & Break (" ") * Default & " if";
Next_Arg : Pattern := Break (',') * Arg & ','; Next_Arg : constant Pattern := Break (',') * Arg & ',';
Op_Node : Pattern := "Op_" & Rest * Op_Name; Op_Node : constant Pattern := "Op_" & Rest * Op_Name;
Shft_Rot : Pattern := "Shift_" or "Rotate_"; Shft_Rot : constant Pattern := "Shift_" or "Rotate_";
No_Ent : Pattern := "Or_Else" or "And_Then" or "In" or "Not_In"; No_Ent : constant Pattern := "Or_Else" or "And_Then"
or "In" or "Not_In";
M : Match_Result; M : Match_Result;
......
...@@ -55,6 +55,9 @@ procedure XSinfo is ...@@ -55,6 +55,9 @@ procedure XSinfo is
Done : exception; Done : exception;
Err : exception; Err : exception;
pragma Warnings (Off);
-- Below variables are referenced using * operator
A : VString := Nul; A : VString := Nul;
Arg : VString := Nul; Arg : VString := Nul;
Comment : VString := Nul; Comment : VString := Nul;
...@@ -65,23 +68,26 @@ procedure XSinfo is ...@@ -65,23 +68,26 @@ procedure XSinfo is
Rtn : VString := Nul; Rtn : VString := Nul;
Term : VString := Nul; Term : VString := Nul;
pragma Warnings (On);
InS : File_Type; InS : File_Type;
Ofile : File_Type; Ofile : File_Type;
wsp : Pattern := Span (' ' & ASCII.HT); wsp : constant Pattern := Span (' ' & ASCII.HT);
Wsp_For : Pattern := wsp & "for"; Wsp_For : constant Pattern := wsp & "for";
Is_Cmnt : Pattern := wsp & "--"; Is_Cmnt : constant Pattern := wsp & "--";
Typ_Nod : Pattern := wsp * A & "type Node_Kind is"; Typ_Nod : constant Pattern := wsp * A & "type Node_Kind is";
Get_Nam : Pattern := wsp * A & "N_" & Break (",)") * Nam Get_Nam : constant Pattern := wsp * A & "N_" & Break (",)") * Nam
& Len (1) * Term; & Len (1) * Term;
Sub_Typ : Pattern := wsp * A & "subtype " & Break (' ') * N; Sub_Typ : constant Pattern := wsp * A & "subtype " & Break (' ') * N;
No_Cont : Pattern := wsp & Break (' ') * N1 & " .. " & Break (';') * N2; No_Cont : constant Pattern := wsp & Break (' ') * N1
Cont_N1 : Pattern := wsp & Break (' ') * N1 & " .." & Rpos (0); & " .. " & Break (';') * N2;
Cont_N2 : Pattern := Span (' ') & Break (';') * N2; Cont_N1 : constant Pattern := wsp & Break (' ') * N1 & " .." & Rpos (0);
Is_Func : Pattern := wsp * A & "function " & Rest * Nam; Cont_N2 : constant Pattern := Span (' ') & Break (';') * N2;
Get_Arg : Pattern := wsp & "(N : " & Break (')') * Arg Is_Func : constant Pattern := wsp * A & "function " & Rest * Nam;
& ") return " & Break (';') * Rtn Get_Arg : constant Pattern := wsp & "(N : " & Break (')') * Arg
& ';' & wsp & "--" & wsp & Rest * Comment; & ") return " & Break (';') * Rtn
& ';' & wsp & "--" & wsp & Rest * Comment;
NKV : Natural; NKV : Natural;
......
...@@ -47,43 +47,48 @@ procedure XSnames is ...@@ -47,43 +47,48 @@ procedure XSnames is
InH : File_Type; InH : File_Type;
OutH : File_Type; OutH : File_Type;
A, B : VString := Nul; pragma Warnings (Off);
Line : VString := Nul; -- Variables below are modifed by * operator
Name : VString := Nul;
Name1 : VString := Nul;
Oname : VString := Nul;
Oval : VString := Nul;
Restl : VString := Nul;
Tdigs : Pattern := Any (Decimal_Digit_Set) & A, B : VString := Nul;
Any (Decimal_Digit_Set) & Line : VString := Nul;
Any (Decimal_Digit_Set); Name : VString := Nul;
Name1 : VString := Nul;
Oname : VString := Nul;
Oval : VString := Nul;
Restl : VString := Nul;
Name_Ref : Pattern := Span (' ') * A & Break (' ') * Name pragma Warnings (On);
& Span (' ') * B
& ": constant Name_Id := N + " & Tdigs
& ';' & Rest * Restl;
Get_Name : Pattern := "Name_" & Rest * Name1; Tdigs : constant Pattern := Any (Decimal_Digit_Set) &
Any (Decimal_Digit_Set) &
Any (Decimal_Digit_Set);
Chk_Low : Pattern := Pos (0) & Any (Lower_Set) & Rest & Pos (1); Name_Ref : constant Pattern := Span (' ') * A & Break (' ') * Name
& Span (' ') * B
& ": constant Name_Id := N + " & Tdigs
& ';' & Rest * Restl;
Findu : Pattern := Span ('u') * A; Get_Name : constant Pattern := "Name_" & Rest * Name1;
Chk_Low : constant Pattern := Pos (0) & Any (Lower_Set) & Rest & Pos (1);
Findu : constant Pattern := Span ('u') * A;
Val : Natural; Val : Natural;
Xlate_U_Und : Character_Mapping := To_Mapping ("u", "_"); Xlate_U_Und : constant Character_Mapping := To_Mapping ("u", "_");
M : Match_Result; M : Match_Result;
type Header_Symbol is (None, Attr, Conv, Prag); type Header_Symbol is (None, Attr, Conv, Prag);
-- A symbol in the header file -- A symbol in the header file
-- Prefixes used in the header file procedure Output_Header_Line (S : Header_Symbol);
-- Output header line
Header_Attr : aliased String := "Attr"; Header_Attr : aliased String := "Attr";
Header_Conv : aliased String := "Convention"; Header_Conv : aliased String := "Convention";
Header_Prag : aliased String := "Pragma"; Header_Prag : aliased String := "Pragma";
-- Prefixes used in the header file
type String_Ptr is access all String; type String_Ptr is access all String;
Header_Prefix : constant array (Header_Symbol) of String_Ptr := Header_Prefix : constant array (Header_Symbol) of String_Ptr :=
...@@ -94,9 +99,12 @@ procedure XSnames is ...@@ -94,9 +99,12 @@ procedure XSnames is
-- Patterns used in the spec file -- Patterns used in the spec file
Get_Attr : Pattern := Span (' ') & "Attribute_" & Break (",)") * Name1; Get_Attr : constant Pattern := Span (' ') & "Attribute_"
Get_Conv : Pattern := Span (' ') & "Convention_" & Break (",)") * Name1; & Break (",)") * Name1;
Get_Prag : Pattern := Span (' ') & "Pragma_" & Break (",)") * Name1; Get_Conv : constant Pattern := Span (' ') & "Convention_"
& Break (",)") * Name1;
Get_Prag : constant Pattern := Span (' ') & "Pragma_"
& Break (",)") * Name1;
type Header_Symbol_Counter is array (Header_Symbol) of Natural; type Header_Symbol_Counter is array (Header_Symbol) of Natural;
Header_Counter : Header_Symbol_Counter := (0, 0, 0, 0); Header_Counter : Header_Symbol_Counter := (0, 0, 0, 0);
...@@ -117,7 +125,7 @@ procedure XSnames is ...@@ -117,7 +125,7 @@ procedure XSnames is
if Header_Current_Symbol /= S then if Header_Current_Symbol /= S then
declare declare
Pat : String := "#define " & Header_Prefix (S).all; Pat : constant String := "#define " & Header_Prefix (S).all;
In_Pat : Boolean := False; In_Pat : Boolean := False;
begin begin
...@@ -129,7 +137,7 @@ procedure XSnames is ...@@ -129,7 +137,7 @@ procedure XSnames is
Line := Get_Line (InH); Line := Get_Line (InH);
if Match (Line, Pat) then if Match (Line, Pat) then
In_Pat := true; In_Pat := True;
elsif In_Pat then elsif In_Pat then
Header_Pending_Line := Line; Header_Pending_Line := Line;
exit; exit;
......
...@@ -59,21 +59,26 @@ procedure XTreeprs is ...@@ -59,21 +59,26 @@ procedure XTreeprs is
Err : exception; Err : exception;
-- Raised on fatal error -- Raised on fatal error
A : VString := Nul; pragma Warnings (Off);
Ffield : VString := Nul; -- Following variables are assigned by * operator
Field : VString := Nul;
Fieldno : VString := Nul; A : VString := Nul;
Flagno : VString := Nul; Ffield : VString := Nul;
Line : VString := Nul; Field : VString := Nul;
Name : VString := Nul; Fieldno : VString := Nul;
Node : VString := Nul; Flagno : VString := Nul;
Outstring : VString := Nul; Line : VString := Nul;
Prefix : VString := Nul; Name : VString := Nul;
S : VString := Nul; Node : VString := Nul;
S1 : VString := Nul; Outstring : VString := Nul;
Syn : VString := Nul; Prefix : VString := Nul;
Synonym : VString := Nul; S : VString := Nul;
Term : VString := Nul; S1 : VString := Nul;
Syn : VString := Nul;
Synonym : VString := Nul;
Term : VString := Nul;
pragma Warnings (On);
subtype Sfile is Ada.Streams.Stream_IO.File_Type; subtype Sfile is Ada.Streams.Stream_IO.File_Type;
...@@ -123,19 +128,19 @@ procedure XTreeprs is ...@@ -123,19 +128,19 @@ procedure XTreeprs is
Sp : aliased Natural; Sp : aliased Natural;
-- Space left on line for Pchars output -- Space left on line for Pchars output
wsp : Pattern := Span (' ' & ASCII.HT); wsp : constant Pattern := Span (' ' & ASCII.HT);
Is_Temp : constant Pattern := BreakX ('T') * A & "T e m p l a t e";
Is_Temp : Pattern := BreakX ('T') * A & "T e m p l a t e"; Get_Node : constant Pattern := wsp & "-- N_" & Rest * Node;
Get_Node : Pattern := wsp & "-- N_" & Rest * Node; Tst_Punc : constant Pattern := Break (" ,.");
Tst_Punc : Pattern := Break (" ,."); Get_Syn : constant Pattern := Span (' ') & "-- " & Break (' ') * Synonym
Get_Syn : Pattern := Span (' ') & "-- " & Break (' ') * Synonym & " (" & Break (')') * Field;
& " (" & Break (')') * Field; Brk_Min : constant Pattern := Break ('-') * Ffield;
Brk_Min : Pattern := Break ('-') * Ffield; Is_Flag : constant Pattern := "Flag" & Rest * Flagno;
Is_Flag : Pattern := "Flag" & Rest * Flagno; Is_Field : constant Pattern := Rtab (1) & Len (1) * Fieldno;
Is_Field : Pattern := Rtab (1) & Len (1) * Fieldno; Is_Syn : constant Pattern := wsp & "N_" & Break (",)") * Syn
Is_Syn : Pattern := wsp & "N_" & Break (",)") * Syn & Len (1) * Term; & Len (1) * Term;
Brk_Node : Pattern := Break (' ') * Node & ' '; Brk_Node : constant Pattern := Break (' ') * Node & ' ';
Chop_SP : Pattern := Len (Sp'Unrestricted_Access) * S1; Chop_SP : constant Pattern := Len (Sp'Unrestricted_Access) * S1;
M : Match_Result; M : Match_Result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment