]>
Commit | Line | Data |
---|---|---|
1eee94d3 GM |
1 | (* M2BasicBlock.def converts a scope block into a list of basic blocks. |
2 | ||
83ffe9cd | 3 | Copyright (C) 2001-2023 Free Software Foundation, Inc. |
1eee94d3 GM |
4 | Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>. |
5 | ||
6 | This file is part of GNU Modula-2. | |
7 | ||
8 | GNU Modula-2 is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 3, or (at your option) | |
11 | any later version. | |
12 | ||
13 | GNU Modula-2 is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GNU Modula-2; see the file COPYING3. If not see | |
20 | <http://www.gnu.org/licenses/>. *) | |
21 | ||
22 | DEFINITION 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 | ||
34 | FROM M2Scope IMPORT ScopeBlock ; | |
35 | EXPORT QUALIFIED BasicBlock, BasicBlockProc, | |
36 | InitBasicBlocks, InitBasicBlocksFromRange, | |
37 | KillBasicBlocks, FreeBasicBlocks, | |
38 | ForeachBasicBlockDo ; | |
39 | ||
40 | ||
41 | TYPE | |
42 | BasicBlock ; | |
43 | BasicBlockProc = PROCEDURE (CARDINAL, CARDINAL) ; | |
44 | ||
45 | ||
46 | (* | |
47 | InitBasicBlocks - converts a list of quadruples as defined by | |
48 | scope blocks into a set of basic blocks. | |
49 | All quadruples within this list which are not | |
50 | reachable are removed. | |
51 | *) | |
52 | ||
53 | PROCEDURE InitBasicBlocks (sb: ScopeBlock) : BasicBlock ; | |
54 | ||
55 | ||
56 | (* | |
57 | InitBasicBlocksFromRange - converts a list of quadruples as defined by | |
58 | start..end. | |
59 | All quadruples within this list which are not | |
60 | reachable are removed. | |
61 | *) | |
62 | ||
63 | PROCEDURE InitBasicBlocksFromRange (start, end: CARDINAL) : BasicBlock ; | |
64 | ||
65 | ||
66 | (* | |
67 | KillBasicBlocks - destroys the list of Basic Blocks and assigns bb to NIL. | |
68 | *) | |
69 | ||
70 | PROCEDURE KillBasicBlocks (VAR bb: BasicBlock) ; | |
71 | ||
72 | ||
73 | (* | |
74 | FreeBasicBlocks - destroys the list of Basic Blocks. | |
75 | *) | |
76 | ||
77 | PROCEDURE FreeBasicBlocks (bb: BasicBlock) ; | |
78 | ||
79 | ||
80 | (* | |
81 | ForeachBasicBlockDo - for each basic block call procedure, p. | |
82 | *) | |
83 | ||
84 | PROCEDURE ForeachBasicBlockDo (bb: BasicBlock; p: BasicBlockProc) ; | |
85 | ||
86 | ||
87 | END M2BasicBlock. |