summaryrefslogtreecommitdiff
path: root/ortho/gcc34/ortho_gcc.private.ads
blob: c4a0135e1e320b66a3a85bd38660383c09b9027d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
--  Ortho implementation for GCC.
--  Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold
--
--  GHDL is free software; you can redistribute it and/or modify it under
--  the terms of the GNU General Public License as published by the Free
--  Software Foundation; either version 2, or (at your option) any later
--  version.
--
--  GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
--  WARRANTY; without even the implied warranty of MERCHANTABILITY or
--  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
--  for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with GCC; see the file COPYING.  If not, write to the Free
--  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
--  02111-1307, USA.
with Agcc.Trees; use Agcc.Trees;

package Ortho_Nodes is
   --  PUBLIC PART is defined in ortho_nodes.common.ads
   type O_Cnode is private;
   type O_Dnode is private;
   type O_Enode is private;
   type O_Fnode is private;
   type O_Lnode is private;
   type O_Tnode is private;
   type O_Snode is private;

   --  Alloca builtin, to be set during initialization.
   Alloca_Function_Ptr : Tree;

   --  Must be called during initialization, before use of any subprograms.
   procedure Init;
private
   type O_Cnode is new Tree;
   type O_Dnode is new Tree;
   type O_Enode is new Tree;
   type O_Fnode is new Tree;
   type O_Lnode is new Tree;
   type O_Tnode is new Tree;
   type O_Snode is new Nesting;

   O_Cnode_Null : constant O_Cnode := O_Cnode (NULL_TREE);
   O_Dnode_Null : constant O_Dnode := O_Dnode (NULL_TREE);
   O_Enode_Null : constant O_Enode := O_Enode (NULL_TREE);
   O_Fnode_Null : constant O_Fnode := O_Fnode (NULL_TREE);
   O_Lnode_Null : constant O_Lnode := O_Lnode (NULL_TREE);
   O_Tnode_Null : constant O_Tnode := O_Tnode (NULL_TREE);
   O_Snode_Null : constant O_Snode := O_Snode (Nesting_Null);


   --  Efficiently append element EL to a chain.
   --  FIRST is the first element of the chain (must NULL_TREE if the chain
   --   is empty),
   --  LAST is the last element of the chain (idem).
   type Chain_Constr_Type is record
      First : Tree;
      Last : Tree;
   end record;
   procedure Chain_Init (Constr : out Chain_Constr_Type);
   procedure Chain_Append (Constr : in out Chain_Constr_Type; El : Tree);

   --  Efficiently append element EL to a list.
   type List_Constr_Type is record
      First : Tree;
      Last : Tree;
   end record;
   procedure List_Init (Constr : out List_Constr_Type);
   procedure List_Append (Constr : in out List_Constr_Type; El : Tree);

   type O_Inter_List is record
      Ident : O_Ident;
      Storage : O_Storage;
      --  Return type.
      Rtype : O_Tnode;
      --  List of parameter types.
      Param_List : List_Constr_Type;
      --  Chain of parameters declarations.
      Param_Chain : Chain_Constr_Type;
   end record;

   type O_Element_List is record
      Res : Tree;
      Chain : Chain_Constr_Type;
   end record;

   type O_Case_Block is record
      Expr : Tree;
      First : Boolean;
      Label : Tree;
   end record;

   type O_If_Block is record
      null;
   end record;

   type O_Aggr_List is record
      Atype : Tree;
      Chain : Chain_Constr_Type;
   end record;

   type O_Record_Aggr_List is new O_Aggr_List;
   type O_Array_Aggr_List is new O_Aggr_List;

   type O_Assoc_List is record
      Subprg : Tree;
      List : List_Constr_Type;
   end record;

   type O_Enum_List is record
      --  The enumeral_type node.
      Res : Tree;
      --  Chain of literals.
      Chain : Chain_Constr_Type;
      --  Numeral value (from 0 to nbr - 1) of the next literal to be declared.
      Num : Natural;
      --  Size of the enumeration type.
      Size : Natural;
   end record;

end Ortho_Nodes;