]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 May 2012 09:44:53 +0000 (11:44 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 May 2012 09:44:53 +0000 (11:44 +0200)
2012-05-15  Hristian Kirtchev  <kirtchev@adacore.com>

* g-calend.adb (Split_At_Locale): New routine.
(Time_Of_At_Locale): New routine.
* g-calend.ads (Split_At_Locale): New routine.
(Time_Of_At_Locale): New routine.

2012-05-15  Gary Dismukes  <dismukes@adacore.com>

* a-except.ads: Minor reformatting.

2012-05-15  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb (Analyze_Loop_Parameter_Specification): If the loop
parameter specification is part of a quantified expression, and it
already carries a type, do not repeat the analysis to preserve
type information: a range attribute reference may have been
rewritten as a range with static bounds, and its re-analysis may
type it as Integer by default, instead of the original index type.

2012-05-15  Robert Dewar  <dewar@adacore.com>

* s-osprim-mingw.adb: Minor reformatting.

From-SVN: r187512

gcc/ada/ChangeLog
gcc/ada/a-except.ads
gcc/ada/g-calend.adb
gcc/ada/g-calend.ads
gcc/ada/impunit.adb
gcc/ada/s-osprim-mingw.adb
gcc/ada/sem_ch5.adb

index 8d5355f209cb8d8a2e551337ebe1de9fdd4d7872..8f936b678f9b72d096e986d1ac26fd4788fc82db 100644 (file)
@@ -1,3 +1,27 @@
+2012-05-15  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * g-calend.adb (Split_At_Locale): New routine.
+       (Time_Of_At_Locale): New routine.
+       * g-calend.ads (Split_At_Locale): New routine.
+       (Time_Of_At_Locale): New routine.
+
+2012-05-15  Gary Dismukes  <dismukes@adacore.com>
+
+       * a-except.ads: Minor reformatting.
+
+2012-05-15  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb (Analyze_Loop_Parameter_Specification): If the loop
+       parameter specification is part of a quantified expression, and it
+       already carries a type, do not repeat the analysis to preserve
+       type information: a range attribute reference may have been
+       rewritten as a range with static bounds, and its re-analysis may
+       type it as Integer by default, instead of the original index type.
+
+2012-05-15  Robert Dewar  <dewar@adacore.com>
+
+       * s-osprim-mingw.adb: Minor reformatting.
+
 2012-05-15  Arnaud Charlet  <charlet@adacore.com>
 
        * a-except.adb, a-except.ads (Reraise_Library_Exception_If_Any): New.
        * a-calfor.adb (Split): Update the call to
        Formatting_Operations.Split.
        (Time_Of): Update the call to Formatting_Operations.Time_Of.
-       * impunit.adb: Include g-calloc to the list of non-RM defined
-       units.
 
 2012-05-15  Vincent Celier  <celier@adacore.com>
 
index a77df9354fd13ce0133b205aa306810a802787cf..0561fb74a11cb6e3f06a21001cab1a3527047b94 100644 (file)
@@ -35,7 +35,7 @@
 
 --  This version of Ada.Exceptions is a full Ada 95 version. It omits Ada 2005
 --  features such as the additional definitions of Exception_Name returning
---  Wide_[Wide_]String. If differs from the 95 version only in that it is
+--  Wide_[Wide_]String. It differs from the Ada 95 version only in that it is
 --  declared Preelaborate (see declaration below for why this is done).
 
 --  It is used for building the compiler and the basic tools, since these
index 2e9f1cca60874b3649bb3145598c329c22f6e2b4..3b731e1eecdc7bd7599bb611b202939391e9c653 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                     Copyright (C) 1999-2010, AdaCore                     --
+--                     Copyright (C) 1999-2012, 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- --
@@ -188,6 +188,61 @@ package body GNAT.Calendar is
       Second     := Second_Number (Secs mod 60);
    end Split;
 
+   ---------------------
+   -- Split_At_Locale --
+   ---------------------
+
+   procedure Split_At_Locale
+     (Date       : Time;
+      Year       : out Year_Number;
+      Month      : out Month_Number;
+      Day        : out Day_Number;
+      Hour       : out Hour_Number;
+      Minute     : out Minute_Number;
+      Second     : out Second_Number;
+      Sub_Second : out Second_Duration)
+   is
+      procedure Ada_Calendar_Split
+        (Date        : Time;
+         Year        : out Year_Number;
+         Month       : out Month_Number;
+         Day         : out Day_Number;
+         Day_Secs    : out Day_Duration;
+         Hour        : out Integer;
+         Minute      : out Integer;
+         Second      : out Integer;
+         Sub_Sec     : out Duration;
+         Leap_Sec    : out Boolean;
+         Use_TZ      : Boolean;
+         Is_Historic : Boolean;
+         Time_Zone   : Long_Integer);
+      pragma Import (Ada, Ada_Calendar_Split, "__gnat_split");
+
+      Ds : Day_Duration;
+      Le : Boolean;
+
+      pragma Unreferenced (Ds, Le);
+
+   begin
+      --  Even though the input time zone is UTC (0), the flag Use_TZ will
+      --  ensure that Split picks up the local time zone.
+
+      Ada_Calendar_Split
+        (Date        => Date,
+         Year        => Year,
+         Month       => Month,
+         Day         => Day,
+         Day_Secs    => Ds,
+         Hour        => Hour,
+         Minute      => Minute,
+         Second      => Second,
+         Sub_Sec     => Sub_Second,
+         Leap_Sec    => Le,
+         Use_TZ      => False,
+         Is_Historic => False,
+         Time_Zone   => 0);
+   end Split_At_Locale;
+
    ----------------
    -- Sub_Second --
    ----------------
@@ -219,7 +274,6 @@ package body GNAT.Calendar is
       Second     : Second_Number;
       Sub_Second : Second_Duration := 0.0) return Time
    is
-
       Day_Secs : constant Day_Duration :=
                    Day_Duration (Hour   * 3_600) +
                    Day_Duration (Minute *    60) +
@@ -229,6 +283,56 @@ package body GNAT.Calendar is
       return Time_Of (Year, Month, Day, Day_Secs);
    end Time_Of;
 
+   -----------------------
+   -- Time_Of_At_Locale --
+   -----------------------
+
+   function Time_Of_At_Locale
+     (Year       : Year_Number;
+      Month      : Month_Number;
+      Day        : Day_Number;
+      Hour       : Hour_Number;
+      Minute     : Minute_Number;
+      Second     : Second_Number;
+      Sub_Second : Second_Duration := 0.0) return Time
+   is
+      function Ada_Calendar_Time_Of
+        (Year         : Year_Number;
+         Month        : Month_Number;
+         Day          : Day_Number;
+         Day_Secs     : Day_Duration;
+         Hour         : Integer;
+         Minute       : Integer;
+         Second       : Integer;
+         Sub_Sec      : Duration;
+         Leap_Sec     : Boolean;
+         Use_Day_Secs : Boolean;
+         Use_TZ       : Boolean;
+         Is_Historic  : Boolean;
+         Time_Zone    : Long_Integer) return Time;
+      pragma Import (Ada, Ada_Calendar_Time_Of, "__gnat_time_of");
+
+   begin
+      --  Even though the input time zone is UTC (0), the flag Use_TZ will
+      --  ensure that Split picks up the local time zone.
+
+      return
+        Ada_Calendar_Time_Of
+          (Year         => Year,
+           Month        => Month,
+           Day          => Day,
+           Day_Secs     => 0.0,
+           Hour         => Hour,
+           Minute       => Minute,
+           Second       => Second,
+           Sub_Sec      => Sub_Second,
+           Leap_Sec     => False,
+           Use_Day_Secs => False,
+           Use_TZ       => False,
+           Is_Historic  => False,
+           Time_Zone    => 0);
+   end Time_Of_At_Locale;
+
    -----------------
    -- To_Duration --
    -----------------
index 9dd5ae00a845eab0bd818426499c9cc9f4113efd..b1c5a407155f4b70f61b94dc4154f2561144196e 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1999-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1999-2012, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -83,8 +83,25 @@ package GNAT.Calendar is
       Minute     : out Minute_Number;
       Second     : out Second_Number;
       Sub_Second : out Second_Duration);
-   --  Split the standard Ada.Calendar.Time data in date data (Year, Month,
-   --  Day) and Time data (Hour, Minute, Second, Sub_Second)
+   --  Split a standard Ada.Calendar.Time value in date data (Year, Month, Day)
+   --  and Time data (Hour, Minute, Second, Sub_Second).
+
+   procedure Split_At_Locale
+     (Date       : Ada.Calendar.Time;
+      Year       : out Ada.Calendar.Year_Number;
+      Month      : out Ada.Calendar.Month_Number;
+      Day        : out Ada.Calendar.Day_Number;
+      Hour       : out Hour_Number;
+      Minute     : out Minute_Number;
+      Second     : out Second_Number;
+      Sub_Second : out Second_Duration);
+   --  Split a standard Ada.Calendar.Time value in date data (Year, Month, Day)
+   --  and Time data (Hour, Minute, Second, Sub_Second). This version of Split
+   --  utilizes the time zone and DST bias of the locale (equivalent to Clock).
+   --  Due to this simplified behavior, the implementation does not require
+   --  expensive system calls on targets such as Windows.
+   --  WARNING: Split_At_Locale is no longer aware of historic events and may
+   --  produce inaccurate results over DST changes which occurred in the past.
 
    function Time_Of
      (Year       : Ada.Calendar.Year_Number;
@@ -96,6 +113,22 @@ package GNAT.Calendar is
       Sub_Second : Second_Duration := 0.0) return Ada.Calendar.Time;
    --  Return an Ada.Calendar.Time data built from the date and time values
 
+   function Time_Of_At_Locale
+     (Year       : Ada.Calendar.Year_Number;
+      Month      : Ada.Calendar.Month_Number;
+      Day        : Ada.Calendar.Day_Number;
+      Hour       : Hour_Number;
+      Minute     : Minute_Number;
+      Second     : Second_Number;
+      Sub_Second : Second_Duration := 0.0) return Ada.Calendar.Time;
+   --  Return an Ada.Calendar.Time data built from the date and time values.
+   --  This version of Time_Of utilizes the time zone and DST bias of the
+   --  locale (equivalent to Clock). Due to this simplified behavior, the
+   --  implementation does not require expensive system calls on targets such
+   --  as Windows.
+   --  WARNING: Split_At_Locale is no longer aware of historic events and may
+   --  produce inaccurate results over DST changes which occurred in the past.
+
    function Week_In_Year (Date : Ada.Calendar.Time) return Week_In_Year_Number;
    --  Return the week number as defined in ISO 8601. A week always starts on
    --  a Monday and the first week of a particular year is the one containing
index 30ec793cc36c49a53b8ca7f4d45aa924a7eaa9ea..99d0c27140b974d6e19316d90ed8ebd267e897a9 100644 (file)
@@ -246,7 +246,6 @@ package body Impunit is
     ("g-byorma", F),  -- GNAT.Byte_Order_Mark
     ("g-bytswa", F),  -- GNAT.Byte_Swapping
     ("g-calend", F),  -- GNAT.Calendar
-    ("g-calloc", F),  -- GNAT.Calendar.Locale
     ("g-catiio", F),  -- GNAT.Calendar.Time_IO
     ("g-casuti", F),  -- GNAT.Case_Util
     ("g-cgi   ", F),  -- GNAT.CGI
index bb1108a765b256c5e67623bf7d295f160cebb24b..931d012762302d9731aee2a66aa7ced1dd9b94f3 100644 (file)
@@ -236,9 +236,11 @@ package body System.OS_Primitives is
    function Monotonic_Clock return Duration is
       Current_Ticks  : aliased LARGE_INTEGER;
       Elap_Secs_Tick : Duration;
+
    begin
       if QueryPerformanceCounter (Current_Ticks'Access) = Win32.FALSE then
          return 0.0;
+
       else
          Elap_Secs_Tick :=
            Duration (Long_Long_Float (Current_Ticks - BMTA.all) /
index aedb97334a4b3419636f95704ae275924814615d..ba94d77f1c4544c3afdac93c7b4f7ae3007cd5bf 100644 (file)
@@ -2267,7 +2267,20 @@ package body Sem_Ch5 is
          --  free.
 
          else
-            Analyze (DS);
+            --  A quantified expression that appears in a pre/post condition
+            --  is pre-analyzed several times.  If the range is given by an
+            --  attribute reference it is rewritten as a range, and this is
+            --  done even with expansion disabled. If the type is already set
+            --  do not reanalyze, because a range with static bounds may be
+            --  typed Integer by default.
+
+            if Nkind (Parent (N)) = N_Quantified_Expression
+              and then Present (Etype (DS))
+            then
+               null;
+            else
+               Analyze (DS);
+            end if;
          end if;
       end if;
 
This page took 0.089223 seconds and 5 git commands to generate.