[multiple changes]

2014-01-20  Claire Dross  <dross@adacore.com>

	* a-cofove.ads (Vector): Capacity discriminant
	should be in range of the index.

2014-01-20  Thomas Quinot  <quinot@adacore.com>

	* a-caldel.ads(To_Duration), s-taasde.ads(Time_Enqueue):
	Clarify specs s-tadeca.adb(Enqueue_Calendar): Compensate for
	possible difference between epoch of Ada.Calendar clock and Ada
	real-time/tasking clock.
	* s-taprop-posix.adb: Minor comment fix.

2014-01-20  Doug Rupp  <rupp@adacore.com>

	* sysdep.c [vxworks]: Remove Vxworks version noise for RTP.

2014-01-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_attr.adb (Expand_N_Attribute_Reference): Generate validity
	checks on the prefix of attribute 'Old.
	* sem_ch3.adb (Process_Range_Expr_In_Decl): Suppress the
	generation of validity checks on a range that belongs to the
	iteration scheme of a quantified expression.
	* sem_ch5.adb (One_Bound): Suppress the generation of validity
	checks on a bound that belongs to the iteration scheme of a
	quantified expression, generate the check in all other cases.

2014-01-20  Bob Duff  <duff@adacore.com>

	* gnat_ugn.texi: Enable --pp-new by default. Minor reorganization.

2014-01-20  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb (Resolve): When compiling a predefined unit, ignore
	interpretations that do not come from other predefined units,
	to prevent spurious ambiguities in the presence of user-defined
	operators in the context of (an instance of) a predefined unit.

From-SVN: r206822
This commit is contained in:
Arnaud Charlet 2014-01-20 16:23:37 +01:00
parent 1e56920493
commit 2838fa930c
12 changed files with 120 additions and 27 deletions

View File

@ -1,3 +1,42 @@
2014-01-20 Claire Dross <dross@adacore.com>
* a-cofove.ads (Vector): Capacity discriminant
should be in range of the index.
2014-01-20 Thomas Quinot <quinot@adacore.com>
* a-caldel.ads(To_Duration), s-taasde.ads(Time_Enqueue):
Clarify specs s-tadeca.adb(Enqueue_Calendar): Compensate for
possible difference between epoch of Ada.Calendar clock and Ada
real-time/tasking clock.
* s-taprop-posix.adb: Minor comment fix.
2014-01-20 Doug Rupp <rupp@adacore.com>
* sysdep.c [vxworks]: Remove Vxworks version noise for RTP.
2014-01-20 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Generate validity
checks on the prefix of attribute 'Old.
* sem_ch3.adb (Process_Range_Expr_In_Decl): Suppress the
generation of validity checks on a range that belongs to the
iteration scheme of a quantified expression.
* sem_ch5.adb (One_Bound): Suppress the generation of validity
checks on a bound that belongs to the iteration scheme of a
quantified expression, generate the check in all other cases.
2014-01-20 Bob Duff <duff@adacore.com>
* gnat_ugn.texi: Enable --pp-new by default. Minor reorganization.
2014-01-20 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve): When compiling a predefined unit, ignore
interpretations that do not come from other predefined units,
to prevent spurious ambiguities in the presence of user-defined
operators in the context of (an instance of) a predefined unit.
2014-01-20 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document that Loop_Variant is included in

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
@ -48,6 +48,6 @@ package Ada.Calendar.Delays is
-- must perform all the processing required for an abort point.
function To_Duration (T : Time) return Duration;
-- Convert Time to Duration
-- Convert Time to Duration elapsed since UNIX epoch
end Ada.Calendar.Delays;

View File

@ -71,7 +71,10 @@ package Ada.Containers.Formal_Vectors is
No_Index : constant Extended_Index := Extended_Index'First;
type Vector (Capacity : Count_Type) is private;
subtype Capacity_Range is
Count_Type range 0 .. Count_Type (Index_Type'Last - Index_Type'First + 1);
type Vector (Capacity : Capacity_Range) is private;
type Cursor is private;
pragma Preelaborable_Initialization (Cursor);
@ -372,7 +375,7 @@ private
type Elements_Array is array (Count_Type range <>) of Element_Type;
function "=" (L, R : Elements_Array) return Boolean is abstract;
type Vector (Capacity : Count_Type) is record
type Vector (Capacity : Capacity_Range) is record
Elements : Elements_Array (1 .. Capacity);
Last : Extended_Index := No_Index;
end record;

View File

@ -3854,6 +3854,14 @@ package body Exp_Attr is
Insert_Action (First (Declarations (Subp)), Asn_Stm);
end if;
-- Ensure that the prefix of attribute 'Old is valid. The check must
-- be inserted after the expansion of the attribute has taken place
-- to reflect the new placement of the prefix.
if Validity_Checks_On and then Validity_Check_Operands then
Ensure_Valid (Pref);
end if;
Pop_Scope;
Rewrite (N, New_Occurrence_Of (Tnn, Loc));

View File

@ -13819,11 +13819,8 @@ identifier case conventions, rules of indentation, and comment layout.
Note: A newly-redesigned set of formatting algorithms used by gnatpp
is now available.
To invoke the new experimental formatting algorithms, use the
@option{--pp-new} switch.
The default is @option{--pp-old}; that is, gnatpp uses the old
formatting algorithms by default.
We intend to make @option{--pp-new} the default at some point.
To invoke the old formatting algorithms, use the @option{--pp-old} switch.
We intend to remove support for @option{--pp-old} at some point.
To produce a reformatted file, @command{gnatpp} generates and uses the ASIS
tree for the input source and thus requires the input to be syntactically and
@ -14435,11 +14432,11 @@ Display usage, then exit disregarding all other options.
@item --pp-new
@cindex @option{--pp-new} @command{gnatpp}
Use the new experimental formatting algorithms.
Use the new experimental formatting algorithms. This is the default.
@item --pp-old
@cindex @option{--pp-old} @command{gnatpp}
Use the old formatting algorithms. This is the default.
Use the old formatting algorithms.
@item ^-files @var{filename}^/FILES=@var{filename}^
@cindex @option{^-files^/FILES^} (@code{gnatpp})

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
-- Copyright (C) 1998-2013, Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
@ -144,6 +144,7 @@ private
D : Delay_Block_Access);
pragma Inline (Time_Enqueue);
-- Used by the child units to enqueue delays on the timer queue
-- implemented in the body of this package.
-- implemented in the body of this package. T denotes a point in time as
-- the duration elapsed since the epoch of the Ada real-time clock.
end System.Tasking.Async_Delays;

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
-- Copyright (C) 1998-2013, Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
@ -30,6 +30,8 @@
------------------------------------------------------------------------------
with Ada.Calendar.Delays;
with System.OS_Constants;
with System.OS_Primitives;
with System.Task_Primitives.Operations;
with System.Tasking.Initialization;
@ -39,6 +41,12 @@ function System.Tasking.Async_Delays.Enqueue_Calendar
return Boolean
is
use type Ada.Calendar.Time;
package SOSC renames System.OS_Constants;
package STPO renames System.Task_Primitives.Operations;
RT_T : Duration := Ada.Calendar.Delays.To_Duration (T);
begin
if T <= Ada.Calendar.Clock then
D.Timed_Out := True;
@ -46,8 +54,22 @@ begin
return False;
end if;
-- T is expressed as a duration elapsed since the UNIX epoch, whereas
-- Time_Enque expects duraction elapsed since the epoch of the Ada
-- real time clock: compensate if necessary.
pragma Warnings (Off);
-- Comparison "SOSC.CLOCK_RT_Ada = SOSC.CLOCK_REALTIME" is compile
-- time known.
if SOSC.CLOCK_RT_Ada /= SOSC.CLOCK_REALTIME then
pragma Warnings (On);
RT_T := RT_T - OS_Primitives.Monotonic_Clock + STPO.Monotonic_Clock;
end if;
System.Tasking.Initialization.Defer_Abort
(System.Task_Primitives.Operations.Self);
Time_Enqueue (Ada.Calendar.Delays.To_Duration (T), D);
Time_Enqueue (RT_T, D);
return True;
end System.Tasking.Async_Delays.Enqueue_Calendar;

View File

@ -287,7 +287,7 @@ package body System.Task_Primitives.Operations is
Rel_Time := Duration'Min (Max_Sensible_Delay, Time - Check_Time);
end if;
-- Absolute deadline specified using the real-time clock, in the
-- Absolute deadline specified using the calendar clock, in the
-- case where it is not the same as the tasking clock: compensate for
-- difference between clock epochs (Base_Time - Base_Cal_Time).

View File

@ -18780,8 +18780,14 @@ package body Sem_Ch3 is
-- We need to ensure validity of the bounds here, because if we
-- go ahead and do the expansion, then the expanded code will get
-- analyzed with range checks suppressed and we miss the check.
-- Validity checks on the range of a quantified expression are
-- delayed until the construct is transformed into a loop.
Validity_Check_Range (R);
if Nkind (Parent (R)) /= N_Loop_Parameter_Specification
or else Nkind (Parent (Parent (R))) /= N_Quantified_Expression
then
Validity_Check_Range (R);
end if;
-- If there were errors in the declaration, try and patch up some
-- common mistakes in the bounds. The cases handled are literals
@ -18791,7 +18797,6 @@ package body Sem_Ch3 is
-- are guaranteed.
if Etype (R) = Any_Type then
if Nkind (Lo) = N_Integer_Literal and then Is_Real_Type (T) then
Rewrite (Lo,
Make_Real_Literal (Sloc (Lo), UR_From_Uint (Intval (Lo))));

View File

@ -2111,6 +2111,17 @@ package body Sem_Ch5 is
if not Has_Call_Using_Secondary_Stack (Analyzed_Bound) then
Analyze_And_Resolve (Original_Bound, Typ);
-- Ensure that the bound is valid. This check should not be
-- generated when the range belongs to a quantified expression
-- as the construct is still not expanded into its final form.
if Nkind (Parent (R)) /= N_Loop_Parameter_Specification
or else Nkind (Parent (Parent (R))) /= N_Quantified_Expression
then
Ensure_Valid (Original_Bound);
end if;
Force_Evaluation (Original_Bound);
return Original_Bound;
end if;

View File

@ -2156,6 +2156,20 @@ package body Sem_Res is
-- First matching interpretation
if not Found then
-- If the current statement is part of a predefined library
-- unit, then all interpretations which come from user level
-- packages should not be considered. User-defined operators
-- may appear anywhere in the homonym list. This exclusion
-- does not apply in an instance, where an actual may come
-- from a local declaration.
if From_Lib
and then not Comes_From_Predefined_Lib_Unit (It.Nam)
and then not In_Instance
then
goto Continue;
end if;
Found := True;
I1 := I;
Seen := It.Nam;
@ -2167,10 +2181,6 @@ package body Sem_Res is
-- some more obscure cases are handled in Disambiguate.
else
-- If the current statement is part of a predefined library
-- unit, then all interpretations which come from user level
-- packages should not be considered.
if From_Lib
and then not Comes_From_Predefined_Lib_Unit (It.Nam)
then

View File

@ -43,10 +43,7 @@
#include "selectLib.h"
#include "vxWorks.h"
#if defined (__RTP__)
# include "version.h"
# if (_WRS_VXWORKS_MAJOR == 6)
# include "vwModNum.h"
# endif /* _WRS_VXWORKS_MAJOR == 6 */
#endif /* __RTP__ */
#endif
@ -926,9 +923,9 @@ __gnat_is_file_not_found_error (int errno_val) {
#if ! defined (__RTP__) && (! defined (VTHREADS) || defined (__VXWORKSMILS__))
case S_nfsLib_NFSERR_NOENT:
#endif
#if defined (__RTP__) && (_WRS_VXWORKS_MAJOR == 6)
#if defined (__RTP__)
/* An RTP can return an NFS file not found, and the NFS bits must
first be masked off to check the errno. */
first be masked on to check the errno. */
case M_nfsStat | ENOENT:
#endif
#endif