Commit df46b832 by Arnaud Charlet

[multiple changes]

2009-04-07  Robert Dewar  <dewar@adacore.com>

	* g-socket.adb: Minor reformatting.

	* g-socthi-mingw.adb: Minor reformatting

	* g-sothco.ads: Minor reformatting

	* exp_ch4.adb:
	(Expand_Concatenate_String): Complete rewrite to generate efficient code
	inline instead of relying on external library routines.

	* s-strops.ads, s-sopco5.ads, s-sopco5.adb, s-sopco4.ads, s-sopco4.adb,
	s-sopco3.ads, s-sopco3.adb, s-strops.adb: Note that this unit is now
	obsolescent

2009-04-07  Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb:
	(Eval_Attribute): for attributes of array objects that are not strings,
	attributes are not static if nominal subtype of object is unconstrained.

2009-04-07  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (New_Overloaded_Entity): If two implicit homonym
	operations for a type T in an instance do not override each other,
	when T is derived from a formal private type, the corresponding
	operations inherited by a type derived from T outside
	of the instance do not override each other either.

From-SVN: r145679
parent 3dd9959c
2009-04-07 Robert Dewar <dewar@adacore.com> 2009-04-07 Robert Dewar <dewar@adacore.com>
* g-socket.adb: Minor reformatting.
* g-socthi-mingw.adb: Minor reformatting
* g-sothco.ads: Minor reformatting
* exp_ch4.adb:
(Expand_Concatenate_String): Complete rewrite to generate efficient code
inline instead of relying on external library routines.
* s-strops.ads, s-sopco5.ads, s-sopco5.adb, s-sopco4.ads, s-sopco4.adb,
s-sopco3.ads, s-sopco3.adb, s-strops.adb: Note that this unit is now
obsolescent
2009-04-07 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb:
(Eval_Attribute): for attributes of array objects that are not strings,
attributes are not static if nominal subtype of object is unconstrained.
2009-04-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (New_Overloaded_Entity): If two implicit homonym
operations for a type T in an instance do not override each other,
when T is derived from a formal private type, the corresponding
operations inherited by a type derived from T outside
of the instance do not override each other either.
2009-04-07 Robert Dewar <dewar@adacore.com>
(Osint.Fail): Change calling sequence to have one string arg (Osint.Fail): Change calling sequence to have one string arg
(Make.Make_Failed): Same change (Make.Make_Failed): Same change
All callers are adjusted to use concatenation All callers are adjusted to use concatenation
...@@ -1830,6 +1830,7 @@ package body GNAT.Sockets is ...@@ -1830,6 +1830,7 @@ package body GNAT.Sockets is
procedure Set (Item : in out Socket_Set_Type; Socket : Socket_Type) is procedure Set (Item : in out Socket_Set_Type; Socket : Socket_Type) is
begin begin
if Item.Last = No_Socket then if Item.Last = No_Socket then
-- Uninitialized socket set, make sure it is properly zeroed out -- Uninitialized socket set, make sure it is properly zeroed out
Reset_Socket_Set (Item.Set'Access); Reset_Socket_Set (Item.Set'Access);
...@@ -1838,6 +1839,7 @@ package body GNAT.Sockets is ...@@ -1838,6 +1839,7 @@ package body GNAT.Sockets is
elsif Item.Last < Socket then elsif Item.Last < Socket then
Item.Last := Socket; Item.Last := Socket;
end if; end if;
Insert_Socket_In_Set (Item.Set'Access, C.int (Socket)); Insert_Socket_In_Set (Item.Set'Access, C.int (Socket));
end Set; end Set;
......
...@@ -300,16 +300,16 @@ package body GNAT.Sockets.Thin is ...@@ -300,16 +300,16 @@ package body GNAT.Sockets.Thin is
Last : aliased C.int; Last : aliased C.int;
begin begin
-- Asynchronous connection failures are notified in the -- Asynchronous connection failures are notified in the exception fd set
-- exception fd set instead of the write fd set. To ensure -- instead of the write fd set. To ensure POSIX compatibility, copy
-- POSIX compatibility, copy write fd set into exception fd -- write fd set into exception fd set. Once select() returns, check any
-- set. Once select() returns, check any socket present in the -- socket present in the exception fd set and peek at incoming
-- exception fd set and peek at incoming out-of-band data. If -- out-of-band data. If the test is not successful, and the socket is
-- the test is not successful, and the socket is present in -- present in the initial write fd set, then move the socket from the
-- the initial write fd set, then move the socket from the
-- exception fd set to the write fd set. -- exception fd set to the write fd set.
if Writefds /= No_Fd_Set_Access then if Writefds /= No_Fd_Set_Access then
-- Add any socket present in write fd set into exception fd set -- Add any socket present in write fd set into exception fd set
declare declare
......
...@@ -122,7 +122,7 @@ package GNAT.Sockets.Thin_Common is ...@@ -122,7 +122,7 @@ package GNAT.Sockets.Thin_Common is
Sa_Family : Sockaddr_Length_And_Family; Sa_Family : Sockaddr_Length_And_Family;
-- Address family (and address length on some platforms) -- Address family (and address length on some platforms)
Sa_Data : C.char_array (1 .. 14) := (others => C.nul); Sa_Data : C.char_array (1 .. 14) := (others => C.nul);
-- Family-specific data -- Family-specific data
-- Note that some platforms require that all unused (reserved) bytes -- Note that some platforms require that all unused (reserved) bytes
-- in addresses be initialized to 0 (e.g. VxWorks). -- in addresses be initialized to 0 (e.g. VxWorks).
...@@ -169,14 +169,15 @@ package GNAT.Sockets.Thin_Common is ...@@ -169,14 +169,15 @@ package GNAT.Sockets.Thin_Common is
Sin_Family : Sockaddr_Length_And_Family; Sin_Family : Sockaddr_Length_And_Family;
-- Address family (and address length on some platforms) -- Address family (and address length on some platforms)
Sin_Port : C.unsigned_short; Sin_Port : C.unsigned_short;
-- Port in network byte order -- Port in network byte order
Sin_Addr : In_Addr; Sin_Addr : In_Addr;
-- IPv4 address -- IPv4 address
Sin_Zero : C.char_array (1 .. 8) := (others => C.nul); Sin_Zero : C.char_array (1 .. 8) := (others => C.nul);
-- Padding -- Padding
--
-- Note that some platforms require that all unused (reserved) bytes -- Note that some platforms require that all unused (reserved) bytes
-- in addresses be initialized to 0 (e.g. VxWorks). -- in addresses be initialized to 0 (e.g. VxWorks).
end record; end record;
...@@ -272,8 +273,8 @@ package GNAT.Sockets.Thin_Common is ...@@ -272,8 +273,8 @@ package GNAT.Sockets.Thin_Common is
-- value if it is, zero if it is not. -- value if it is, zero if it is not.
procedure Last_Socket_In_Set procedure Last_Socket_In_Set
(Set : access Fd_Set; (Set : access Fd_Set;
Last : Int_Access); Last : Int_Access);
-- Find the largest socket in the socket set. This is needed for select(). -- Find the largest socket in the socket set. This is needed for select().
-- When Last_Socket_In_Set is called, parameter Last is a maximum value of -- When Last_Socket_In_Set is called, parameter Last is a maximum value of
-- the largest socket. This hint is used to avoid scanning very large -- the largest socket. This hint is used to avoid scanning very large
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, 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- --
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
-- This package contains the function for concatenating three strings -- This package contains the function for concatenating three strings
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, 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- --
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
-- This package contains the function for concatenating four strings -- This package contains the function for concatenating four strings
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, 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- --
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
-- This package contains the function for concatenating five strings -- This package contains the function for concatenating five strings
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, 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- --
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
-- This package contains functions for runtime operations on strings -- This package contains functions for runtime operations on strings
-- (other than runtime comparison, found in s-strcom.ads). -- (other than runtime comparison, found in s-strcom.ads).
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Warnings (Off); pragma Warnings (Off);
pragma Compiler_Unit; pragma Compiler_Unit;
pragma Warnings (On); pragma Warnings (On);
......
...@@ -5258,7 +5258,7 @@ package body Sem_Attr is ...@@ -5258,7 +5258,7 @@ package body Sem_Attr is
if Present (AS) and then Is_Constrained (AS) then if Present (AS) and then Is_Constrained (AS) then
P_Entity := AS; P_Entity := AS;
-- If we have an unconstrained type, cannot fold -- If we have an unconstrained type we cannot fold
else else
Check_Expressions; Check_Expressions;
...@@ -5517,6 +5517,9 @@ package body Sem_Attr is ...@@ -5517,6 +5517,9 @@ package body Sem_Attr is
-- an optimization, but it falls out essentially free, so why not. -- an optimization, but it falls out essentially free, so why not.
-- Again we compute the variable Static for easy reference later -- Again we compute the variable Static for easy reference later
-- (note that no array attributes are static in Ada 83). -- (note that no array attributes are static in Ada 83).
-- we also need to set Static properly for subsequent legality checks
-- which might otherwise accept non-static constants in contexts
-- where they are not legal.
Static := Ada_Version >= Ada_95 Static := Ada_Version >= Ada_95
and then Statically_Denotes_Entity (P); and then Statically_Denotes_Entity (P);
...@@ -5526,6 +5529,16 @@ package body Sem_Attr is ...@@ -5526,6 +5529,16 @@ package body Sem_Attr is
begin begin
N := First_Index (P_Type); N := First_Index (P_Type);
-- The expression is static if the array type is constrained
-- by given bounds, and not by an initial expression. Constant
-- strings are static in any case.
if Root_Type (P_Type) /= Standard_String then
Static :=
Static and then not Is_Constr_Subt_For_U_Nominal (P_Type);
end if;
while Present (N) loop while Present (N) loop
Static := Static and then Is_Static_Subtype (Etype (N)); Static := Static and then Is_Static_Subtype (Etype (N));
......
...@@ -7154,20 +7154,26 @@ package body Sem_Ch6 is ...@@ -7154,20 +7154,26 @@ package body Sem_Ch6 is
-- odd case where both are derived operations declared at the -- odd case where both are derived operations declared at the
-- same point, both operations should be declared, and in that -- same point, both operations should be declared, and in that
-- case we bypass the following test and proceed to the next -- case we bypass the following test and proceed to the next
-- part (this can only occur for certain obscure cases -- part. This can only occur for certain obscure cases in
-- involving homographs in instances and can't occur for -- instances, when an operation on a type derived from a formal
-- dispatching operations ???). Note that the following -- private type does not override a homograph inherited from
-- condition is less than clear. For example, it's not at all -- the actual. In subsequent derivations of such a type, the
-- clear why there's a test for E_Entry here. ??? -- DT positions of these operations remain distinct, if they
-- have been set.
if Present (Alias (S)) if Present (Alias (S))
and then (No (Alias (E)) and then (No (Alias (E))
or else Is_Abstract_Subprogram (S)
or else Comes_From_Source (E) or else Comes_From_Source (E)
or else Is_Dispatching_Operation (E)) or else
and then (Is_Dispatching_Operation (E)
(Ekind (E) = E_Entry and then Present (DTC_Entity (Alias (S)))
or else Ekind (E) /= E_Enumeration_Literal) and then Present (DTC_Entity (Alias (E)))
and then DT_Position (Alias (S))
= DT_Position (Alias (E))))
and then Ekind (E) /= E_Enumeration_Literal
then then
-- When an derived operation is overloaded it may be due to -- When an derived operation is overloaded it may be due to
-- the fact that the full view of a private extension -- the fact that the full view of a private extension
-- re-inherits. It has to be dealt with. -- re-inherits. It has to be dealt with.
......
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