2018-08-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / ada / vxlink-bind.ads
blob7e6a1b09e482495ff30ee38acb400a3b202bd383
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- V X L I N K . B I N D --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2018, AdaCore --
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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 pragma Ada_2012;
28 private with Ada.Containers.Ordered_Sets;
29 private with Ada.Strings.Unbounded;
31 package VxLink.Bind is
33 type VxLink_Binder is private;
35 procedure Initialize
36 (Binder : out VxLink_Binder;
37 Object_File : String);
39 procedure Parse_Tag_File
40 (Binder : in out VxLink_Binder;
41 File : String);
43 procedure Emit_CTDT
44 (Binder : in out VxLink_Binder;
45 Namespace : String);
47 function CTDT_File (Binder : VxLink_Binder) return String;
49 private
51 use Ada.Strings.Unbounded;
53 type Symbol_Kind is (Sym_Ctor, Sym_Dtor, Sym_Other);
55 type Symbol is record
56 Name : Unbounded_String;
57 Cat : Character;
58 Internal : Boolean;
59 Kind : Symbol_Kind;
60 Priority : Integer;
61 end record;
63 function "=" (S1, S2 : Symbol) return Boolean
64 is (S1.Name = S2.Name and then S1.Cat = S2.Cat);
66 function "<" (S1, S2 : Symbol) return Boolean
67 is (if S1.Priority /= S2.Priority
68 then S1.Priority < S2.Priority
69 elsif S1.Name /= S2.Name
70 then S1.Name < S2.Name
71 else S1.Cat < S2.Cat);
73 package Symbol_Sets is new Ada.Containers.Ordered_Sets
74 (Symbol,
75 "<" => "<",
76 "=" => "=");
78 type VxLink_Binder is record
79 CTDT_File : Unbounded_String;
80 Constructors : Symbol_Sets.Set;
81 Destructors : Symbol_Sets.Set;
82 Module_Dtor_Needed : Boolean;
83 EH_Frame_Needed : Boolean;
84 Tags_List : Strings_List.Vector;
85 end record;
87 end VxLink.Bind;