]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-gcc/m2treelib.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-gcc / m2treelib.def
CommitLineData
1eee94d3
GM
1(* m2treelib.def definition module for m2treelib.cc.
2
a945c346 3Copyright (C) 2011-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 FOR "C" m2treelib ;
23
24FROM m2tree IMPORT Tree ;
25FROM m2linemap IMPORT location_t ;
26FROM SYSTEM IMPORT ADDRESS ;
27
28TYPE
29 tree_code = INTEGER ;
30
31
32(*
33 get_set_address_if_var - returns the address of, op, providing
34 it is not a constant.
35 NULL is returned if, op, is a constant.
36*)
37
8804eb0b 38PROCEDURE get_set_address_if_var (location: location_t; op: Tree; is_lvalue, is_const: BOOLEAN) : Tree ;
1eee94d3
GM
39
40
41(*
42 get_set_field_rhs - returns the value of p->field.
43*)
44
45PROCEDURE get_set_field_rhs (location: location_t; p: Tree; field: Tree) : Tree ;
46
47
48(*
49 get_set_field_lhs - returns the address of p->field.
50*)
51
52PROCEDURE get_set_field_lhs (location: location_t; p: Tree; field: Tree) : Tree ;
53
54
55(*
56 get_set_address - returns the address of op1.
57*)
58
8804eb0b 59PROCEDURE get_set_address (location: location_t; op1: Tree; is_lvalue: BOOLEAN) : Tree ;
1eee94d3
GM
60
61
62(*
63 get_set_value - returns the value indicated by, field, in the set.
64 Either p->field or the constant(op.fieldNo) is returned.
65*)
66
8804eb0b 67PROCEDURE get_set_value (location: location_t; p: Tree; field: Tree; is_const: BOOLEAN; op: Tree; fieldNo: CARDINAL) : Tree ;
1eee94d3
GM
68
69
70(*
71 get_field_no - returns the field no for, op. The, op, is either
72 a constructor or a variable of type record.
73 If, op, is a constructor (a set constant in GNU Modula-2)
74 then this function is essentially a no-op and it returns op.
75 Else we iterate over the field list and return the
76 appropriate field number.
77*)
78
8804eb0b 79PROCEDURE get_field_no (type: Tree; op: Tree; is_const: BOOLEAN; fieldNo: CARDINAL) : Tree ;
1eee94d3
GM
80
81
82(*
83 get_rvalue - returns the rvalue of t. The, type, is the object type to be
84 copied upon indirection.
85*)
86
8804eb0b 87PROCEDURE get_rvalue (location: location_t; t: Tree; type: Tree; is_lvalue: BOOLEAN) : Tree ;
1eee94d3
GM
88
89
90(*
91 DoCall - build a call tree arranging the parameter list as a vector.
92*)
93
94PROCEDURE DoCall (location: location_t; rettype: Tree; funcptr: Tree; param_list: Tree) : Tree ;
95
96
97
98PROCEDURE build_modify_expr (location: location_t; des: Tree; modifycode: tree_code; copy: Tree) : Tree ;
99
100
101(*
102 do_jump_if_bit - tests bit in word against integer zero using operator, code.
103 If the result is true then jump to label.
104*)
105
106PROCEDURE do_jump_if_bit (location: location_t; code: tree_code; word: Tree; bit: Tree; label: ADDRESS) ;
107
108
109END m2treelib.