]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-compiler/M2BasicBlock.def
Add myself to write after approval
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / M2BasicBlock.def
CommitLineData
1eee94d3
GM
1(* M2BasicBlock.def converts a scope block into a list of basic blocks.
2
a945c346 3Copyright (C) 2001-2024 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU Modula-2; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. *)
21
22DEFINITION MODULE M2BasicBlock ;
23
24(*
25 Title : M2BasicBlock
26 Author : Gaius Mulley
27 Date : 20/8/2003
28 System : GNU Modula-2
29 Description: Converts a scope block into a list of basic blocks.
30 The basic blocks are either converted back into quadruples
31 or alternatively translated into GCC trees.
32*)
33
34FROM M2Scope IMPORT ScopeBlock ;
1eee94d3
GM
35
36
37TYPE
38 BasicBlock ;
9f168b41 39 BasicBlockProc = PROCEDURE (BasicBlock) ;
1eee94d3
GM
40
41
42(*
43 InitBasicBlocks - converts a list of quadruples as defined by
44 scope blocks into a set of basic blocks.
45 All quadruples within this list which are not
46 reachable are removed.
47*)
48
49PROCEDURE InitBasicBlocks (sb: ScopeBlock) : BasicBlock ;
50
51
52(*
53 InitBasicBlocksFromRange - converts a list of quadruples as defined by
54 start..end.
55 All quadruples within this list which are not
56 reachable are removed.
57*)
58
40b91158
GM
59PROCEDURE InitBasicBlocksFromRange (ScopeSym: CARDINAL;
60 start, end: CARDINAL) : BasicBlock ;
1eee94d3
GM
61
62
63(*
64 KillBasicBlocks - destroys the list of Basic Blocks and assigns bb to NIL.
65*)
66
67PROCEDURE KillBasicBlocks (VAR bb: BasicBlock) ;
68
69
70(*
71 FreeBasicBlocks - destroys the list of Basic Blocks.
72*)
73
74PROCEDURE FreeBasicBlocks (bb: BasicBlock) ;
75
76
77(*
78 ForeachBasicBlockDo - for each basic block call procedure, p.
79*)
80
81PROCEDURE ForeachBasicBlockDo (bb: BasicBlock; p: BasicBlockProc) ;
82
83
9f168b41
GM
84(*
85 GetBasicBlockScope - return the scope associated with the basic block.
86*)
87
88PROCEDURE GetBasicBlockScope (bb: BasicBlock) : CARDINAL ;
89
90
91(*
92 GetBasicBlockStart - return the quad associated with the start of the basic block.
93*)
94
95PROCEDURE GetBasicBlockStart (bb: BasicBlock) : CARDINAL ;
96
97
98(*
99 GetBasicBlockEnd - return the quad associated with the end of the basic block.
100*)
101
102PROCEDURE GetBasicBlockEnd (bb: BasicBlock) : CARDINAL ;
103
104
105(*
106 IsBasicBlockFirst - return TRUE if this basic block is the first in the sequence.
107*)
108
109PROCEDURE IsBasicBlockFirst (bb: BasicBlock) : BOOLEAN ;
110
111
1eee94d3 112END M2BasicBlock.