1
------------------------------------------------------------------------------
3
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
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 --
9
-- Copyright (c) 1995-1999, Free Software Foundation, Inc. --
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. --
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. --
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). --
38
------------------------------------------------------------------------------
40
with Asis.Exceptions; use Asis.Exceptions;
42
with A4G.Vcheck; use A4G.Vcheck;
43
with Asis.Set_Get; use Asis.Set_Get;
45
package body Asis.Compilation_Units.Times is
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
55
function Attribute_Time
56
(Compilation_Unit : in Asis.Compilation_Unit;
57
Attribute : in Wide_String)
58
return Ada.Calendar.Time
61
Check_Validity (Compilation_Unit,
62
"Asis.Compilation_Units.Times.Attribute_Time");
67
------------------------------
68
-- Compilation_CPU_Duration --
69
------------------------------
71
function Compilation_CPU_Duration
72
(Compilation_Unit : in Asis.Compilation_Unit)
73
return Standard.Duration
76
Check_Validity (Compilation_Unit,
77
"Asis.Compilation_Units.Times.Compilation_CPU_Duration");
80
("Asis.Compilation_Units.Times.Compilation_CPU_Duration");
85
when ASIS_Inappropriate_Compilation_Unit =>
88
Add_Call_Information (Outer_Call =>
89
"Asis.Compilation_Units.Times.Compilation_CPU_Duration");
92
Raise_ASIS_Failed (Diagnosis =>
93
"Asis.Compilation_Units.Times.Compilation_CPU_Duration");
94
end Compilation_CPU_Duration;
96
-------------------------
97
-- Time_Of_Last_Update --
98
-------------------------
100
function Time_Of_Last_Update
101
(Compilation_Unit : in Asis.Compilation_Unit)
102
return Ada.Calendar.Time
105
Check_Validity (Compilation_Unit,
106
"Asis.Compilation_Units.Times.Time_Of_Last_Update");
108
if Get_Unit_Id (Compilation_Unit) = Standard_Id then
110
return Standard_Time;
113
return Time_Stamp (Compilation_Unit);
117
when ASIS_Inappropriate_Compilation_Unit =>
120
Add_Call_Information (Outer_Call =>
121
"Asis.Compilation_Units.Times.Time_Of_Last_Update");
124
Raise_ASIS_Failed (Diagnosis =>
125
"Asis.Compilation_Units.Times.Time_Of_Last_Update");
126
end Time_Of_Last_Update;
128
end Asis.Compilation_Units.Times;
b'\\ No newline at end of file'