Debian Codegraph @

gcc/ada/libgnat/s-stalib.adb

raw
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S Y S T E M . S T A N D A R D _ L I B R A R Y --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1995-2025, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
31
32 -- The purpose of this body is simply to ensure that the two with'ed units
33 -- are properly included in the link. They are not with'ed from the spec
34 -- of System.Standard_Library, since this would cause order of elaboration
35 -- problems (Elaborate_Body would have the same problem).
36
37 pragma Warnings (Off);
38 -- Kill warnings from unused withs. These unused with's are here to make
39 -- sure the relevant units are loaded and properly elaborated.
40
41 with System.Soft_Links;
42 -- Referenced directly from generated code using external symbols so it
43 -- must always be present in a build, even if no unit has a direct with
44 -- of this unit. Also referenced from exception handling routines.
45 -- This is needed for programs that don't use exceptions explicitly but
46 -- direct calls to Ada.Exceptions are generated by gigi (for example,
47 -- by calling __gnat_raise_constraint_error directly).
48
49 with System.Memory;
50 -- Referenced directly from generated code using external symbols, so it
51 -- must always be present in a build, even if no unit has a direct with
52 -- of this unit.
53
54 pragma Warnings (On);
55
56 package body System.Standard_Library is
57
58 Runtime_Finalized : Boolean := False;
59 -- Set to True when adafinal is called. Used to ensure that subsequent
60 -- calls to adafinal after the first have no effect.
61
62 --------------------------
63 -- Abort_Undefer_Direct --
64 --------------------------
65
66 procedure Abort_Undefer_Direct is
67 begin
68 System.Soft_Links.Abort_Undefer.all;
69 end Abort_Undefer_Direct;
70
71 --------------
72 -- Adafinal --
73 --------------
74
75 procedure Adafinal is
76 begin
77 if not Runtime_Finalized then
78 Runtime_Finalized := True;
79 System.Soft_Links.Adafinal.all;
80 end if;
81 end Adafinal;
82
83 -----------------
84 -- Break_Start --
85 -----------------
86
87 procedure Break_Start;
88 pragma Export (C, Break_Start, "__gnat_break_start");
89 -- This is a dummy procedure that is called at the start of execution.
90 -- Its sole purpose is to provide a well defined point for the placement
91 -- of a main program breakpoint. This is not used anymore but kept for
92 -- bootstrapping issues (still referenced by old gnatbind generated files).
93
94 procedure Break_Start is
95 begin
96 null;
97 end Break_Start;
98
99 end System.Standard_Library;