Skip to content

Commit e0288d1

Browse files
committed
clang-format code moved from link_goto_model.cpp
1 parent b8a68fc commit e0288d1

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

src/goto-programs/read_goto_binary.cpp

+22-20
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void rename_symbols_in_function(
4343
identifier = entry->second;
4444
}
4545

46-
goto_programt &program=function.body;
46+
goto_programt &program = function.body;
4747
rename_symbol(function.type);
4848

4949
Forall_goto_program_instructions(iit, program)
@@ -76,20 +76,20 @@ static bool link_functions(
7676
Forall_goto_functions(src_it, src_functions)
7777
{
7878
// the function might have been renamed
79-
rename_symbolt::expr_mapt::const_iterator e_it=
79+
rename_symbolt::expr_mapt::const_iterator e_it =
8080
rename_symbol.expr_map.find(src_it->first);
8181

82-
irep_idt final_id=src_it->first;
82+
irep_idt final_id = src_it->first;
8383

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;
8686

8787
// already there?
88-
goto_functionst::function_mapt::iterator dest_f_it=
88+
goto_functionst::function_mapt::iterator dest_f_it =
8989
dest_functions.function_map.find(final_id);
9090

9191
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
9393
{
9494
rename_symbols_in_function(src_func, final_id, rename_symbol);
9595
dest_functions.function_map.emplace(final_id, std::move(src_func));
@@ -98,19 +98,21 @@ static bool link_functions(
9898
{
9999
goto_functionst::goto_functiont &in_dest_symbol_table = dest_f_it->second;
100100

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())
103104
{
104105
// the one with body wins!
105106
rename_symbols_in_function(src_func, final_id, rename_symbol);
106107

107108
in_dest_symbol_table.body.swap(src_func.body);
108109
in_dest_symbol_table.parameter_identifiers.swap(
109110
src_func.parameter_identifiers);
110-
in_dest_symbol_table.type=src_func.type;
111+
in_dest_symbol_table.type = src_func.type;
111112
}
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)
114116
{
115117
// just keep the old one in dest
116118
}
@@ -122,8 +124,9 @@ static bool link_functions(
122124
{
123125
// the linking code will have ensured that types match
124126
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");
127130
}
128131
}
129132
}
@@ -166,9 +169,8 @@ static void link_goto_model(
166169
linking.object_type_updates.get_expr_map().end());
167170
}
168171

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)
172174
{
173175
goto_functionst &dest_functions = dest.goto_functions;
174176
symbol_tablet &dest_symbol_table = dest.symbol_table;
@@ -185,15 +187,15 @@ static void finalize_linking(
185187
INVARIANT(symbol.value.id() == ID_symbol, "must have symbol");
186188
const irep_idt &id = to_symbol_expr(symbol.value).get_identifier();
187189

188-
#if 0
190+
#if 0
189191
if(!base_type_eq(symbol.type, ns.lookup(id).type, ns))
190192
{
191193
std::cerr << symbol << '\n';
192194
std::cerr << ns.lookup(id) << '\n';
193195
}
194196
INVARIANT(base_type_eq(symbol.type, ns.lookup(id).type, ns),
195197
"type matches");
196-
#endif
198+
#endif
197199

198200
macro_application.insert_expr(symbol.name, id);
199201
}
@@ -202,7 +204,7 @@ static void finalize_linking(
202204
if(!macro_application.expr_map.empty())
203205
Forall_goto_functions(dest_it, dest_functions)
204206
{
205-
irep_idt final_id=dest_it->first;
207+
irep_idt final_id = dest_it->first;
206208
rename_symbols_in_function(dest_it->second, final_id, macro_application);
207209
}
208210

0 commit comments

Comments
 (0)