Skip to content

Commit 4ea5de8

Browse files
committed
clang-format code moved from link_goto_model.cpp
1 parent 9cc113c commit 4ea5de8

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/goto-programs/read_goto_binary.cpp

+17-16
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@ static bool link_functions(
7575
Forall_goto_functions(src_it, src_functions)
7676
{
7777
// the function might have been renamed
78-
rename_symbolt::expr_mapt::const_iterator e_it=
78+
rename_symbolt::expr_mapt::const_iterator e_it =
7979
rename_symbol.expr_map.find(src_it->first);
8080

81-
irep_idt final_id=src_it->first;
81+
irep_idt final_id = src_it->first;
8282

83-
if(e_it!=rename_symbol.expr_map.end())
84-
final_id=e_it->second;
83+
if(e_it != rename_symbol.expr_map.end())
84+
final_id = e_it->second;
8585

8686
// already there?
87-
goto_functionst::function_mapt::iterator dest_f_it=
87+
goto_functionst::function_mapt::iterator dest_f_it =
8888
dest_functions.function_map.find(final_id);
8989

9090
goto_functionst::goto_functiont &src_func = src_it->second;
91-
if(dest_f_it==dest_functions.function_map.end()) // not there yet
91+
if(dest_f_it == dest_functions.function_map.end()) // not there yet
9292
{
9393
rename_symbols_in_function(src_func, final_id, rename_symbol);
9494
dest_functions.function_map.emplace(final_id, std::move(src_func));
@@ -97,8 +97,9 @@ static bool link_functions(
9797
{
9898
goto_functionst::goto_functiont &in_dest_symbol_table = dest_f_it->second;
9999

100-
if(in_dest_symbol_table.body.instructions.empty() ||
101-
weak_symbols.find(final_id)!=weak_symbols.end())
100+
if(
101+
in_dest_symbol_table.body.instructions.empty() ||
102+
weak_symbols.find(final_id) != weak_symbols.end())
102103
{
103104
// the one with body wins!
104105
rename_symbols_in_function(src_func, final_id, rename_symbol);
@@ -107,8 +108,9 @@ static bool link_functions(
107108
in_dest_symbol_table.parameter_identifiers.swap(
108109
src_func.parameter_identifiers);
109110
}
110-
else if(src_func.body.instructions.empty() ||
111-
src_ns.lookup(src_it->first).is_weak)
111+
else if(
112+
src_func.body.instructions.empty() ||
113+
src_ns.lookup(src_it->first).is_weak)
112114
{
113115
// just keep the old one in dest
114116
}
@@ -161,9 +163,8 @@ static void link_goto_model(
161163
linking.object_type_updates.get_expr_map().end());
162164
}
163165

164-
static void finalize_linking(
165-
goto_modelt &dest,
166-
const replace_symbolt &object_type_updates)
166+
static void
167+
finalize_linking(goto_modelt &dest, const replace_symbolt &object_type_updates)
167168
{
168169
goto_functionst &dest_functions = dest.goto_functions;
169170
symbol_tablet &dest_symbol_table = dest.symbol_table;
@@ -180,15 +181,15 @@ static void finalize_linking(
180181
INVARIANT(symbol.value.id() == ID_symbol, "must have symbol");
181182
const irep_idt &id = to_symbol_expr(symbol.value).get_identifier();
182183

183-
#if 0
184+
#if 0
184185
if(!base_type_eq(symbol.type, ns.lookup(id).type, ns))
185186
{
186187
std::cerr << symbol << '\n';
187188
std::cerr << ns.lookup(id) << '\n';
188189
}
189190
INVARIANT(base_type_eq(symbol.type, ns.lookup(id).type, ns),
190191
"type matches");
191-
#endif
192+
#endif
192193

193194
macro_application.insert_expr(symbol.name, id);
194195
}
@@ -197,7 +198,7 @@ static void finalize_linking(
197198
if(!macro_application.expr_map.empty())
198199
Forall_goto_functions(dest_it, dest_functions)
199200
{
200-
irep_idt final_id=dest_it->first;
201+
irep_idt final_id = dest_it->first;
201202
rename_symbols_in_function(dest_it->second, final_id, macro_application);
202203
}
203204

0 commit comments

Comments
 (0)