File tree 2 files changed +13
-4
lines changed 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,13 @@ void goto_convert_functionst::convert_function(
153
153
154
154
f.type =to_code_type (symbol.type );
155
155
156
+ // store the parameter identifiers in the goto functions
157
+ const code_typet &code_type = to_code_type (symbol.type );
158
+ f.parameter_identifiers .clear ();
159
+ f.parameter_identifiers .reserve (code_type.parameters ().size ());
160
+ for (const auto ¶meter : code_type.parameters ())
161
+ f.parameter_identifiers .push_back (parameter.get_identifier ());
162
+
156
163
if (symbol.value .is_nil () ||
157
164
symbol.is_compiled ()) /* goto_inline may have removed the body */
158
165
return ;
Original file line number Diff line number Diff line change @@ -29,33 +29,35 @@ class goto_functiont
29
29
goto_programt body;
30
30
31
31
// / The type of the function, indicating the return type and parameter types
32
+ // / This is deprecated; get the type from the namespace instead.
32
33
code_typet type;
33
34
34
35
typedef std::vector<irep_idt> parameter_identifierst;
35
36
36
37
// / The identifiers of the parameters of this function
37
38
// /
38
- // / Note: This variable is currently unused and the vector is thus always
39
- // / empty. In the future the code base may be refactored to fill in the
40
- // / parameter identifiers here when creating a `goto_functiont`. For now the
41
- // / parameter identifiers should be retrieved from the type (`code_typet`).
39
+ // / Note: This is now the preferred way of getting the identifiers of the
40
+ // / parameters. The identifiers in the type will go away.
42
41
parameter_identifierst parameter_identifiers;
43
42
44
43
bool body_available () const
45
44
{
46
45
return !body.instructions .empty ();
47
46
}
48
47
48
+ // / This is deprecated; get the type from the namespace instead.
49
49
bool is_inlined () const
50
50
{
51
51
return type.get_bool (ID_C_inlined);
52
52
}
53
53
54
+ // / This is deprecated; get the type from the namespace instead.
54
55
bool is_hidden () const
55
56
{
56
57
return type.get_bool (ID_C_hide);
57
58
}
58
59
60
+ // / This is deprecated; modify the type in the namespace instead.
59
61
void make_hidden ()
60
62
{
61
63
type.set (ID_C_hide, true );
You can’t perform that action at this time.
0 commit comments