@@ -43,7 +43,7 @@ static void rename_symbols_in_function(
43
43
identifier = entry->second ;
44
44
}
45
45
46
- goto_programt &program= function.body ;
46
+ goto_programt &program = function.body ;
47
47
rename_symbol (function.type );
48
48
49
49
Forall_goto_program_instructions (iit, program)
@@ -76,20 +76,20 @@ static bool link_functions(
76
76
Forall_goto_functions (src_it, src_functions)
77
77
{
78
78
// the function might have been renamed
79
- rename_symbolt::expr_mapt::const_iterator e_it=
79
+ rename_symbolt::expr_mapt::const_iterator e_it =
80
80
rename_symbol.expr_map .find (src_it->first );
81
81
82
- irep_idt final_id= src_it->first ;
82
+ irep_idt final_id = src_it->first ;
83
83
84
- if (e_it!= rename_symbol.expr_map .end ())
85
- final_id= e_it->second ;
84
+ if (e_it != rename_symbol.expr_map .end ())
85
+ final_id = e_it->second ;
86
86
87
87
// already there?
88
- goto_functionst::function_mapt::iterator dest_f_it=
88
+ goto_functionst::function_mapt::iterator dest_f_it =
89
89
dest_functions.function_map .find (final_id);
90
90
91
91
goto_functionst::goto_functiont &src_func = src_it->second ;
92
- if (dest_f_it== dest_functions.function_map .end ()) // not there yet
92
+ if (dest_f_it == dest_functions.function_map .end ()) // not there yet
93
93
{
94
94
rename_symbols_in_function (src_func, final_id, rename_symbol);
95
95
dest_functions.function_map .emplace (final_id, std::move (src_func));
@@ -98,19 +98,21 @@ static bool link_functions(
98
98
{
99
99
goto_functionst::goto_functiont &in_dest_symbol_table = dest_f_it->second ;
100
100
101
- if (in_dest_symbol_table.body .instructions .empty () ||
102
- weak_symbols.find (final_id)!=weak_symbols.end ())
101
+ if (
102
+ in_dest_symbol_table.body .instructions .empty () ||
103
+ weak_symbols.find (final_id) != weak_symbols.end ())
103
104
{
104
105
// the one with body wins!
105
106
rename_symbols_in_function (src_func, final_id, rename_symbol);
106
107
107
108
in_dest_symbol_table.body .swap (src_func.body );
108
109
in_dest_symbol_table.parameter_identifiers .swap (
109
110
src_func.parameter_identifiers );
110
- in_dest_symbol_table.type = src_func.type ;
111
+ in_dest_symbol_table.type = src_func.type ;
111
112
}
112
- else if (src_func.body .instructions .empty () ||
113
- src_ns.lookup (src_it->first ).is_weak )
113
+ else if (
114
+ src_func.body .instructions .empty () ||
115
+ src_ns.lookup (src_it->first ).is_weak )
114
116
{
115
117
// just keep the old one in dest
116
118
}
@@ -122,8 +124,9 @@ static bool link_functions(
122
124
{
123
125
// the linking code will have ensured that types match
124
126
rename_symbol (src_func.type );
125
- INVARIANT (base_type_eq (in_dest_symbol_table.type , src_func.type , ns),
126
- " linking ensures that types match" );
127
+ INVARIANT (
128
+ base_type_eq (in_dest_symbol_table.type , src_func.type , ns),
129
+ " linking ensures that types match" );
127
130
}
128
131
}
129
132
}
@@ -166,9 +169,8 @@ static void link_goto_model(
166
169
linking.object_type_updates .get_expr_map ().end ());
167
170
}
168
171
169
- static void finalize_linking (
170
- goto_modelt &dest,
171
- const replace_symbolt &object_type_updates)
172
+ static void
173
+ finalize_linking (goto_modelt &dest, const replace_symbolt &object_type_updates)
172
174
{
173
175
goto_functionst &dest_functions = dest.goto_functions ;
174
176
symbol_tablet &dest_symbol_table = dest.symbol_table ;
@@ -185,15 +187,15 @@ static void finalize_linking(
185
187
INVARIANT (symbol.value .id () == ID_symbol, " must have symbol" );
186
188
const irep_idt &id = to_symbol_expr (symbol.value ).get_identifier ();
187
189
188
- #if 0
190
+ #if 0
189
191
if(!base_type_eq(symbol.type, ns.lookup(id).type, ns))
190
192
{
191
193
std::cerr << symbol << '\n';
192
194
std::cerr << ns.lookup(id) << '\n';
193
195
}
194
196
INVARIANT(base_type_eq(symbol.type, ns.lookup(id).type, ns),
195
197
"type matches");
196
- #endif
198
+ #endif
197
199
198
200
macro_application.insert_expr (symbol.name , id);
199
201
}
@@ -202,7 +204,7 @@ static void finalize_linking(
202
204
if (!macro_application.expr_map .empty ())
203
205
Forall_goto_functions (dest_it, dest_functions)
204
206
{
205
- irep_idt final_id= dest_it->first ;
207
+ irep_idt final_id = dest_it->first ;
206
208
rename_symbols_in_function (dest_it->second , final_id, macro_application);
207
209
}
208
210
0 commit comments