@@ -158,12 +158,10 @@ void statement_list_typecheckt::typecheck_function_block_declaration(
158158 const statement_list_parse_treet::function_blockt &function_block)
159159{
160160 // Create FB symbol.
161- symbolt function_block_sym;
161+ symbolt function_block_sym{function_block. name , typet{}, ID_statement_list} ;
162162 function_block_sym.module = module ;
163- function_block_sym.name = function_block.name ;
164163 function_block_sym.base_name = function_block_sym.name ;
165164 function_block_sym.pretty_name = function_block_sym.name ;
166- function_block_sym.mode = ID_statement_list;
167165
168166 // When calling function blocks, the passed parameters are value-copied to a
169167 // corresponding instance data block. This block contains all input, inout,
@@ -175,11 +173,11 @@ void statement_list_typecheckt::typecheck_function_block_declaration(
175173 // Create and add DB type symbol.
176174 const struct_typet data_block_type{
177175 create_instance_data_block_type (function_block)};
178- type_symbolt data_block{data_block_type};
179- data_block.name =
180- id2string (function_block_sym.name ) + DATA_BLOCK_TYPE_POSTFIX;
176+ type_symbolt data_block{
177+ id2string (function_block_sym.name ) + DATA_BLOCK_TYPE_POSTFIX,
178+ data_block_type,
179+ ID_statement_list};
181180 data_block.base_name = data_block.name ;
182- data_block.mode = ID_statement_list;
183181 symbol_table.add (data_block);
184182
185183 // Create and add parameter symbol.
@@ -206,12 +204,10 @@ void statement_list_typecheckt::typecheck_function_block_declaration(
206204void statement_list_typecheckt::typecheck_function_declaration (
207205 const statement_list_parse_treet::functiont &function)
208206{
209- symbolt function_sym;
207+ symbolt function_sym{function. name , typet{}, ID_statement_list} ;
210208 function_sym.module = module ;
211- function_sym.name = function.name ;
212209 function_sym.base_name = function_sym.name ;
213210 function_sym.pretty_name = function_sym.name ;
214- function_sym.mode = ID_statement_list;
215211 code_typet::parameterst params;
216212 typecheck_function_var_decls (
217213 function.var_input , params, function.name , ID_statement_list_var_input);
@@ -230,28 +226,22 @@ void statement_list_typecheckt::typecheck_tag_list()
230226{
231227 for (const symbol_exprt &tag : parse_tree.tags )
232228 {
233- symbolt tag_sym;
229+ symbolt tag_sym{tag. get_identifier (), tag. type (), ID_statement_list} ;
234230 tag_sym.is_static_lifetime = true ;
235231 tag_sym.module = module ;
236- tag_sym.name = tag.get_identifier ();
237232 tag_sym.base_name = tag_sym.name ;
238233 tag_sym.pretty_name = tag_sym.name ;
239- tag_sym.type = tag.type ();
240- tag_sym.mode = ID_statement_list;
241234 symbol_table.add (tag_sym);
242235 }
243236}
244237
245238void statement_list_typecheckt::add_temp_rlo ()
246239{
247- symbolt temp_rlo;
240+ symbolt temp_rlo{CPROVER_TEMP_RLO, get_bool_type (), ID_statement_list} ;
248241 temp_rlo.is_static_lifetime = true ;
249242 temp_rlo.module = module ;
250- temp_rlo.name = CPROVER_TEMP_RLO;
251243 temp_rlo.base_name = temp_rlo.name ;
252244 temp_rlo.pretty_name = temp_rlo.name ;
253- temp_rlo.type = get_bool_type ();
254- temp_rlo.mode = ID_statement_list;
255245 symbol_table.add (temp_rlo);
256246}
257247
@@ -321,13 +311,13 @@ void statement_list_typecheckt::typecheck_temp_var_decls(
321311 for (const statement_list_parse_treet::var_declarationt &declaration :
322312 tia_module.var_temp )
323313 {
324- symbolt temp_sym;
325- temp_sym.name = id2string (tia_symbol.name ) +
326- " ::" + id2string (declaration.variable .get_identifier ());
314+ symbolt temp_sym{
315+ id2string (tia_symbol.name ) +
316+ " ::" + id2string (declaration.variable .get_identifier ()),
317+ declaration.variable .type (),
318+ ID_statement_list};
327319 temp_sym.base_name = declaration.variable .get_identifier ();
328320 temp_sym.pretty_name = temp_sym.base_name ;
329- temp_sym.type = declaration.variable .type ();
330- temp_sym.mode = ID_statement_list;
331321 temp_sym.module = module ;
332322 symbol_table.add (temp_sym);
333323
0 commit comments