~ubuntu-branches/ubuntu/karmic/asis/karmic

« back to all changes in this revision

Viewing changes to asis/asis-compilation_units-times.adb

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Quinot
  • Date: 2002-03-03 19:55:58 UTC
  • Revision ID: james.westby@ubuntu.com-20020303195558-g7dp4vaq1zdkf814
Tags: upstream-3.14p
ImportĀ upstreamĀ versionĀ 3.14p

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
------------------------------------------------------------------------------
 
2
--                                                                          --
 
3
--                 ASIS-for-GNAT IMPLEMENTATION COMPONENTS                  --
 
4
--                                                                          --
 
5
--          A S I S . C O M P I L A T I O N _ U N I T S . T I M E S         --
 
6
--                                                                          --
 
7
--                                 B o d y                                  --
 
8
--                                                                          --
 
9
--            Copyright (c) 1995-1999, Free Software Foundation, Inc.       --
 
10
--                                                                          --
 
11
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
 
12
-- under terms of the  GNU General Public License  as published by the Free --
 
13
-- Software Foundation;  either version 2,  or  (at your option)  any later --
 
14
-- version. ASIS-for-GNAT is distributed  in the hope  that it will be use- --
 
15
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
 
16
-- CHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General  --
 
17
-- Public License for more details. You should have received a copy of the  --
 
18
-- GNU General Public License  distributed with ASIS-for-GNAT; see file     --
 
19
-- COPYING. If not, write to the Free Software Foundation,  59 Temple Place --
 
20
-- - Suite 330,  Boston, MA 02111-1307, USA.                                --
 
21
--                                                                          --
 
22
-- As a special exception,  if other files  instantiate  generics from this --
 
23
-- unit, or you link  this unit with other files  to produce an executable, --
 
24
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
 
25
-- covered  by the  GNU  General  Public  License.  This exception does not --
 
26
-- however invalidate  any other reasons why  the executable file  might be --
 
27
-- covered by the  GNU Public License.                                      --
 
28
--                                                                          --
 
29
-- ASIS-for-GNAT was originally developed  by the ASIS-for-GNAT team at the --
 
30
-- Software  Engineering  Laboratory  of  the Swiss  Federal  Institute  of --
 
31
-- Technology (LGL-EPFL) in Lausanne,  Switzerland, in cooperation with the --
 
32
-- Scientific  Research  Computer  Center of  Moscow State University (SRCC --
 
33
-- MSU), Russia,  with funding partially provided  by grants from the Swiss --
 
34
-- National  Science  Foundation  and  the  Swiss  Academy  of  Engineering --
 
35
-- Sciences.  ASIS-for-GNAT is now maintained by  Ada Core Technologies Inc --
 
36
-- (http://www.gnat.com).                                                   --
 
37
--                                                                          --
 
38
------------------------------------------------------------------------------
 
39
 
 
40
with Asis.Exceptions; use Asis.Exceptions;
 
41
 
 
42
with A4G.Vcheck;      use A4G.Vcheck;
 
43
with Asis.Set_Get;    use Asis.Set_Get;
 
44
 
 
45
package body Asis.Compilation_Units.Times is
 
46
 
 
47
   Standard_Time : Ada.Calendar.Time :=
 
48
      Ada.Calendar.Time_Of (1994, 12, 21, 0.0);
 
49
   --  used as Time_Of_Last_Update for the predefined Standard package
 
50
 
 
51
   --------------------
 
52
   -- Attribute_Time --
 
53
   --------------------
 
54
 
 
55
   function Attribute_Time
 
56
     (Compilation_Unit : in Asis.Compilation_Unit;
 
57
      Attribute        : in Wide_String)
 
58
      return Ada.Calendar.Time
 
59
   is
 
60
   begin
 
61
      Check_Validity (Compilation_Unit,
 
62
               "Asis.Compilation_Units.Times.Attribute_Time");
 
63
      return Nil_ASIS_Time;
 
64
 
 
65
   end Attribute_Time;
 
66
 
 
67
   ------------------------------
 
68
   -- Compilation_CPU_Duration --
 
69
   ------------------------------
 
70
 
 
71
   function Compilation_CPU_Duration
 
72
     (Compilation_Unit : in Asis.Compilation_Unit)
 
73
      return Standard.Duration
 
74
   is
 
75
   begin
 
76
      Check_Validity (Compilation_Unit,
 
77
               "Asis.Compilation_Units.Times.Compilation_CPU_Duration");
 
78
 
 
79
      Not_Implemented_Yet
 
80
        ("Asis.Compilation_Units.Times.Compilation_CPU_Duration");
 
81
 
 
82
      return 0.0;
 
83
 
 
84
   exception
 
85
      when ASIS_Inappropriate_Compilation_Unit =>
 
86
         raise;
 
87
      when ASIS_Failed =>
 
88
         Add_Call_Information (Outer_Call =>
 
89
                     "Asis.Compilation_Units.Times.Compilation_CPU_Duration");
 
90
         raise;
 
91
      when others =>
 
92
         Raise_ASIS_Failed (Diagnosis =>
 
93
                     "Asis.Compilation_Units.Times.Compilation_CPU_Duration");
 
94
   end Compilation_CPU_Duration;
 
95
 
 
96
   -------------------------
 
97
   -- Time_Of_Last_Update --
 
98
   -------------------------
 
99
 
 
100
   function Time_Of_Last_Update
 
101
     (Compilation_Unit : in Asis.Compilation_Unit)
 
102
      return Ada.Calendar.Time
 
103
   is
 
104
   begin
 
105
      Check_Validity (Compilation_Unit,
 
106
               "Asis.Compilation_Units.Times.Time_Of_Last_Update");
 
107
 
 
108
      if Get_Unit_Id (Compilation_Unit) = Standard_Id then
 
109
 
 
110
         return Standard_Time;
 
111
      else
 
112
 
 
113
         return Time_Stamp (Compilation_Unit);
 
114
      end if;
 
115
 
 
116
   exception
 
117
      when ASIS_Inappropriate_Compilation_Unit =>
 
118
         raise;
 
119
      when ASIS_Failed =>
 
120
         Add_Call_Information (Outer_Call =>
 
121
                     "Asis.Compilation_Units.Times.Time_Of_Last_Update");
 
122
         raise;
 
123
      when others =>
 
124
         Raise_ASIS_Failed (Diagnosis =>
 
125
                     "Asis.Compilation_Units.Times.Time_Of_Last_Update");
 
126
   end Time_Of_Last_Update;
 
127
 
 
128
end Asis.Compilation_Units.Times;
 
 
b'\\ No newline at end of file'