Commit 0c5dba7f by Arnaud Charlet

[multiple changes]

2013-10-10  Robert Dewar  <dewar@adacore.com>

	* gnatlink.adb: Minor reformatting.

2013-10-10  Yannick Moy  <moy@adacore.com>

	* debug.adb: Free flag d.E and change doc for flag d.K.

2013-10-10  Ed Schonberg  <schonberg@adacore.com>

	* sem_prag.adb (Check_Precondition_Postcondition): If the
	pragma comes from an aspect spec, and the subprogram is a
	library unit, treat as a ppc in a declarative part in ASIS mode,
	so that expression in aspect is properly analyzed. In this case
	there is no later point at which the aspect specification would
	be examined.

2013-10-10  Bob Duff  <duff@adacore.com>

	* opt.ads: Minor comment fix.

2013-10-10  Vadim Godunko  <godunko@adacore.com>

	* a-coinho-shared.ads, a-coinho-shared.adb: New file.
	* s-atocou.ads: Add procedure to initialize counter.
	* s-atocou.adb: Likewise.
	* s-atocou-builtin.adb: Likewise.
	* s-atocou-x86.adb: Likewise.
	* gcc-interface/Makefile.in: Select special version of
	Indefinite_Holders package on platforms where atomic built-ins
	are supported. Update tools target pairs for PikeOS.

From-SVN: r203344
parent cd38efa5
2013-10-10 Robert Dewar <dewar@adacore.com>
* gnatlink.adb: Minor reformatting.
2013-10-10 Yannick Moy <moy@adacore.com>
* debug.adb: Free flag d.E and change doc for flag d.K.
2013-10-10 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Check_Precondition_Postcondition): If the
pragma comes from an aspect spec, and the subprogram is a
library unit, treat as a ppc in a declarative part in ASIS mode,
so that expression in aspect is properly analyzed. In this case
there is no later point at which the aspect specification would
be examined.
2013-10-10 Bob Duff <duff@adacore.com>
* opt.ads: Minor comment fix.
2013-10-10 Vadim Godunko <godunko@adacore.com>
* a-coinho-shared.ads, a-coinho-shared.adb: New file.
* s-atocou.ads: Add procedure to initialize counter.
* s-atocou.adb: Likewise.
* s-atocou-builtin.adb: Likewise.
* s-atocou-x86.adb: Likewise.
* gcc-interface/Makefile.in: Select special version of
Indefinite_Holders package on platforms where atomic built-ins
are supported. Update tools target pairs for PikeOS.
2013-10-10 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor reformatting.
2013-10-10 Robert Dewar <dewar@adacore.com>
......
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . C O N T A I N E R S . I N D E F I N I T E _ H O L D E R S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
------------------------------------------------------------------------------
private with Ada.Finalization;
private with Ada.Streams;
private with System.Atomic_Counters;
generic
type Element_Type (<>) is private;
with function "=" (Left, Right : Element_Type) return Boolean is <>;
package Ada.Containers.Indefinite_Holders is
pragma Preelaborate (Indefinite_Holders);
pragma Remote_Types (Indefinite_Holders);
type Holder is tagged private;
pragma Preelaborable_Initialization (Holder);
Empty_Holder : constant Holder;
function "=" (Left, Right : Holder) return Boolean;
function To_Holder (New_Item : Element_Type) return Holder;
function Is_Empty (Container : Holder) return Boolean;
procedure Clear (Container : in out Holder);
function Element (Container : Holder) return Element_Type;
procedure Replace_Element
(Container : in out Holder;
New_Item : Element_Type);
procedure Query_Element
(Container : Holder;
Process : not null access procedure (Element : Element_Type));
procedure Update_Element
(Container : Holder;
Process : not null access procedure (Element : in out Element_Type));
procedure Assign (Target : in out Holder; Source : Holder);
function Copy (Source : Holder) return Holder;
procedure Move (Target : in out Holder; Source : in out Holder);
private
package AF renames Ada.Finalization;
type Element_Access is access all Element_Type;
type Shared_Holder is record
Counter : System.Atomic_Counters.Atomic_Counter;
Element : Element_Access;
end record;
type Shared_Holder_Access is access all Shared_Holder;
procedure Reference (Item : not null Shared_Holder_Access);
-- Increment reference counter
procedure Unreference (Item : not null Shared_Holder_Access);
-- Decrement reference counter, deallocate Item when counter goes to zero
procedure Read
(Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Container : out Holder);
procedure Write
(Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Container : Holder);
type Holder is new Ada.Finalization.Controlled with record
Reference : Shared_Holder_Access;
Busy : Natural := 0;
end record;
for Holder'Read use Read;
for Holder'Write use Write;
overriding procedure Adjust (Container : in out Holder);
overriding procedure Finalize (Container : in out Holder);
Empty_Holder : constant Holder := (AF.Controlled with null, 0);
end Ada.Containers.Indefinite_Holders;
......@@ -122,13 +122,13 @@ package body Debug is
-- d.B
-- d.C Generate concatenation call, do not generate inline code
-- d.D SPARK strict mode
-- d.E Force SPARK mode for gnat2why
-- d.E
-- d.F SPARK mode
-- d.G Frame condition mode for gnat2why
-- d.H Standard package only mode for gnat2why
-- d.I Do not ignore enum representation clauses in CodePeer mode
-- d.J Disable parallel SCIL generation mode
-- d.K SPARK detection only mode for gnat2why
-- d.K SPARK check mode for gnat2why
-- d.L Depend on back end for limited types in if and case expressions
-- d.M Relaxed RM semantics
-- d.N Add node to all entities
......@@ -597,10 +597,6 @@ package body Debug is
-- d.D SPARK strict mode. Interpret compiler permissions as strictly as
-- possible in SPARK mode.
-- d.E Force SPARK mode for gnat2why. In this mode, errors are issued for
-- all violations of SPARK in user code, and warnings are issued for
-- constructs not yet implemented in gnat2why.
-- d.F SPARK mode. Generate AST in a form suitable for formal
-- verification, as well as additional cross reference information in
-- ALI files to compute effects of subprograms. Note that ALI files
......@@ -624,8 +620,8 @@ package body Debug is
-- done in parallel to speed processing. This switch disables this
-- behavior.
-- d.K SPARK detection only mode for gnat2why. In this mode, gnat2why
-- does not generate Why code.
-- d.K SPARK check mode for gnat2why. In this mode, gnat2why does not
-- generate Why code.
-- d.L Normally the front end generates special expansion for conditional
-- expressions of a limited type. This debug flag removes this special
......
......@@ -408,6 +408,8 @@ DUMMY_SOCKETS_TARGET_PAIRS = \
# special version of Ada.Strings.Unbounded package can be used.
ATOMICS_TARGET_PAIRS = \
a-coinho.adb<a-coinho-shared.adb \
a-coinho.ads<a-coinho-shared.ads \
a-stunau.adb<a-stunau-shared.adb \
a-suteio.adb<a-suteio-shared.adb \
a-strunb.ads<a-strunb-shared.ads \
......@@ -1581,6 +1583,13 @@ ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(target_
LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
endif
# PikeOS
ifeq ($(strip $(filter-out powerpc% %86 sysgo pikeos,$(target_cpu) $(target_vendor) $(target_os)))),)
TOOLS_TARGET_PAIRS=\
mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb \
indepsw.adb<indepsw-gnu.adb
endif
# *-elf, *-eabi or *-eabispe
ifeq ($(strip $(filter-out elf eabi eabispe,$(target_os))),)
TOOLS_TARGET_PAIRS=\
......
......@@ -1734,12 +1734,12 @@ package Opt is
Ada_Version_Config : Ada_Version_Type;
-- GNAT
-- This is the value of the configuration switch for the Ada 83 mode, as
-- set by the command line switches -gnat83/95/05, and possibly modified by
-- the use of configuration pragmas Ada_*. This switch is used to set the
-- initial value for Ada_Version mode at the start of analysis of a unit.
-- Note however that the setting of this flag is ignored for internal and
-- predefined units (which are always compiled in the most up to date
-- version of Ada).
-- set by the command line switches -gnat83/95/2005/2012, and possibly
-- modified by the use of configuration pragmas Ada_*. This switch is used
-- to set the initial value for Ada_Version mode at the start of analysis
-- of a unit. Note however that the setting of this flag is ignored for
-- internal and predefined units (which are always compiled in the most up
-- to date version of Ada).
Ada_Version_Pragma_Config : Node_Id;
-- This will be set non empty if it is set by a configuration pragma
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011, AdaCore --
-- Copyright (C) 2011-2013, AdaCore --
-- --
-- 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- --
......@@ -72,6 +72,15 @@ package body System.Atomic_Counters is
Sync_Add_And_Fetch (Item.Value'Unrestricted_Access, 1);
end Increment;
----------------
-- Initialize --
----------------
procedure Initialize (Item : out Atomic_Counter) is
begin
Item.Value := 1;
end Initialize;
------------
-- Is_One --
------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011, AdaCore --
-- Copyright (C) 2011-2013, AdaCore --
-- --
-- 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- --
......@@ -74,6 +74,15 @@ package body System.Atomic_Counters is
Volatile => True);
end Increment;
----------------
-- Initialize --
----------------
procedure Initialize (Item : out Atomic_Counter) is
begin
Item.Value := 1;
end Initialize;
------------
-- Is_One --
------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011, AdaCore --
-- Copyright (C) 2011-2013, AdaCore --
-- --
-- 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- --
......@@ -57,6 +57,15 @@ package body System.Atomic_Counters is
raise Program_Error;
end Increment;
----------------
-- Initialize --
----------------
procedure Initialize (Item : out Atomic_Counter) is
begin
raise Program_Error;
end Initialize;
------------
-- Is_One --
------------
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2011, AdaCore --
-- Copyright (C) 2011-2013, AdaCore --
-- --
-- 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- --
......@@ -65,6 +65,12 @@ package System.Atomic_Counters is
pragma Inline_Always (Is_One);
-- Returns True when value of the atomic counter is one.
procedure Initialize (Item : out Atomic_Counter);
pragma Inline_Always (Initialize);
-- Initialize counter by setting its value to one. This subprogram is
-- intended to be used in special cases when counter object can't be
-- initialized in standard way.
private
type Unsigned_32 is mod 2 ** 32;
......
......@@ -3654,9 +3654,11 @@ package body Sem_Prag is
elsif Nkind (PO) = N_Compilation_Unit_Aux then
-- In formal verification mode, analyze pragma expression for
-- correctness, as it is not expanded later.
-- correctness, as it is not expanded later. Ditto in ASIS_Mode
-- where there is no later point at which the aspect will be
-- analyzed.
if SPARK_Mode then
if SPARK_Mode or else ASIS_Mode then
Analyze_PPC_In_Decl_Part
(N, Defining_Entity (Unit (Parent (PO))));
end if;
......@@ -10110,9 +10112,7 @@ package body Sem_Prag is
-- Contract_Cases --
--------------------
-- pragma Contract_Cases (CONTRACT_CASE_LIST);
-- CONTRACT_CASE_LIST ::= CONTRACT_CASE {, CONTRACT_CASE}
-- pragma Contract_Cases ((CONTRACT_CASE {, CONTRACT_CASE));
-- CONTRACT_CASE ::= CASE_GUARD => CONSEQUENCE
......
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