Skip to content

Commit b909a54

Browse files
committed
Improve code style
No functional changes intended
1 parent 7c669b2 commit b909a54

10 files changed

+110
-105
lines changed

src/goto-cc/compile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ bool compilet::parse(const std::string &file_name)
540540

541541
language_filet language_file;
542542

543-
std::pair<language_filest::filemapt::iterator, bool>
544-
res=language_files.filemap.insert(
543+
std::pair<language_filest::file_mapt::iterator, bool>
544+
res=language_files.file_map.insert(
545545
std::pair<std::string, language_filet>(file_name, language_file));
546546

547547
language_filet &lf=res.first->second;
@@ -732,7 +732,7 @@ bool compilet::parse_source(const std::string &file_name)
732732
return true;
733733

734734
// so we remove it from the list afterwards
735-
language_files.filemap.erase(file_name);
735+
language_files.file_map.erase(file_name);
736736
return false;
737737
}
738738

src/goto-programs/get_goto_model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ bool get_goto_modelt::operator()(const std::vector<std::string> &files)
7575
return true;
7676
}
7777

78-
std::pair<language_filest::filemapt::iterator, bool>
79-
result=language_files.filemap.insert(
78+
std::pair<language_filest::file_mapt::iterator, bool>
79+
result=language_files.file_map.insert(
8080
std::pair<std::string, language_filet>(filename, language_filet()));
8181

8282
language_filet &lf=result.first->second;

src/java_bytecode/java_bytecode_convert_class.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ class java_bytecode_convert_classt:public messaget
2929
message_handlert &_message_handler,
3030
bool _disable_runtime_checks,
3131
size_t _max_array_length,
32-
lazy_methodst& _lm,
32+
lazy_methodst& _lazy_methods,
3333
lazy_methods_modet _lazy_methods_mode):
3434
messaget(_message_handler),
3535
symbol_table(_symbol_table),
3636
disable_runtime_checks(_disable_runtime_checks),
3737
max_array_length(_max_array_length),
38-
lazy_methods(_lm),
38+
lazy_methods(_lazy_methods),
3939
lazy_methods_mode(_lazy_methods_mode)
4040
{
4141
}

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ Function: java_bytecode_convert_method_lazy
197197
\*******************************************************************/
198198

199199
void java_bytecode_convert_method_lazy(
200-
const symbolt& class_symbol,
201-
const irep_idt method_identifier,
200+
const symbolt &class_symbol,
201+
const irep_idt &method_identifier,
202202
const java_bytecode_parse_treet::methodt &m,
203-
symbol_tablet& symbol_table)
203+
symbol_tablet &symbol_table)
204204
{
205205
symbolt method_symbol;
206206
typet member_type=java_type_from_string(m.signature);
@@ -213,12 +213,14 @@ void java_bytecode_convert_method_lazy(
213213

214214
if(method_symbol.base_name=="<init>")
215215
{
216-
method_symbol.pretty_name=id2string(class_symbol.pretty_name)+"."+
217-
id2string(class_symbol.base_name)+"()";
216+
method_symbol.pretty_name=
217+
id2string(class_symbol.pretty_name)+"."+
218+
id2string(class_symbol.base_name)+"()";
218219
member_type.set(ID_constructor, true);
219220
}
220221
else
221-
method_symbol.pretty_name=id2string(class_symbol.pretty_name)+"."+
222+
method_symbol.pretty_name=
223+
id2string(class_symbol.pretty_name)+"."+
222224
id2string(m.base_name)+"()";
223225

224226
// do we need to add 'this' as a parameter?
@@ -257,7 +259,7 @@ void java_bytecode_convert_methodt::convert(
257259
id2string(class_symbol.name)+"."+id2string(m.name)+":"+m.signature;
258260
method_id=method_identifier;
259261

260-
const auto& old_sym=symbol_table.lookup(method_identifier);
262+
const auto &old_sym=symbol_table.lookup(method_identifier);
261263

262264
typet member_type=old_sym.type;
263265
code_typet &code_type=to_code_type(member_type);

src/java_bytecode/java_bytecode_convert_method.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inline void java_bytecode_convert_method(
4848

4949
void java_bytecode_convert_method_lazy(
5050
const symbolt &class_symbol,
51-
const irep_idt method_identifier,
51+
const irep_idt &method_identifier,
5252
const java_bytecode_parse_treet::methodt &,
5353
symbol_tablet &symbol_table);
5454

src/java_bytecode/java_bytecode_language.cpp

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool java_bytecode_languaget::parse(
156156
{
157157
status() << "JAR file without entry point: loading it all" << eom;
158158
java_class_loader.load_entire_jar(path);
159-
for(const auto& kv : java_class_loader.jar_map.at(path).entries)
159+
for(const auto &kv : java_class_loader.jar_map.at(path).entries)
160160
main_jar_classes.push_back(kv.first);
161161
}
162162
else
@@ -201,10 +201,10 @@ Function: get_virtual_method_target
201201
\*******************************************************************/
202202

203203
static irep_idt get_virtual_method_target(
204-
const std::set<irep_idt>& needed_classes,
205-
const irep_idt& call_basename,
206-
const irep_idt& classname,
207-
const symbol_tablet& symbol_table)
204+
const std::set<irep_idt> &needed_classes,
205+
const irep_idt &call_basename,
206+
const irep_idt &classname,
207+
const symbol_tablet &symbol_table)
208208
{
209209
// Program-wide, is this class ever instantiated?
210210
if(!needed_classes.count(classname))
@@ -238,24 +238,24 @@ Function: get_virtual_method_target
238238
\*******************************************************************/
239239

240240
static void get_virtual_method_targets(
241-
const code_function_callt& c,
242-
const std::set<irep_idt>& needed_classes,
243-
std::vector<irep_idt>& needed_methods,
244-
symbol_tablet& symbol_table,
245-
const class_hierarchyt& class_hierarchy)
241+
const code_function_callt &c,
242+
const std::set<irep_idt> &needed_classes,
243+
std::vector<irep_idt> &needed_methods,
244+
symbol_tablet &symbol_table,
245+
const class_hierarchyt &class_hierarchy)
246246
{
247-
const auto& called_function=c.function();
247+
const auto &called_function=c.function();
248248
assert(called_function.id()==ID_virtual_function);
249249

250-
const auto& call_class=called_function.get(ID_C_class);
250+
const auto &call_class=called_function.get(ID_C_class);
251251
assert(call_class!=irep_idt());
252-
const auto& call_basename=called_function.get(ID_component_name);
252+
const auto &call_basename=called_function.get(ID_component_name);
253253
assert(call_basename!=irep_idt());
254254

255255
auto old_size=needed_methods.size();
256256

257257
auto child_classes=class_hierarchy.get_children_trans(call_class);
258-
for(const auto& child_class : child_classes)
258+
for(const auto &child_class : child_classes)
259259
{
260260
auto child_method=
261261
get_virtual_method_target(
@@ -288,8 +288,8 @@ static void get_virtual_method_targets(
288288
break;
289289
else
290290
{
291-
const auto& entry=findit->second;
292-
if(entry.parents.size()==0)
291+
const auto &entry=findit->second;
292+
if(entry.parents.empty())
293293
break;
294294
else
295295
parent_class_id=entry.parents[0];
@@ -325,12 +325,12 @@ Function: gather_virtual_callsites
325325
\*******************************************************************/
326326

327327
static void gather_virtual_callsites(
328-
const exprt& e,
329-
std::vector<const code_function_callt*>& result)
328+
const exprt &e,
329+
std::vector<const code_function_callt *> &result)
330330
{
331331
if(e.id()!=ID_code)
332332
return;
333-
const codet& c=to_code(e);
333+
const codet &c=to_code(e);
334334
if(c.get_statement()==ID_function_call &&
335335
to_code_function_call(c).function().id()==ID_virtual_function)
336336
result.push_back(&to_code_function_call(c));
@@ -354,13 +354,13 @@ Function: gather_needed_globals
354354
\*******************************************************************/
355355

356356
static void gather_needed_globals(
357-
const exprt& e,
358-
const symbol_tablet& symbol_table,
359-
symbol_tablet& needed)
357+
const exprt &e,
358+
const symbol_tablet &symbol_table,
359+
symbol_tablet &needed)
360360
{
361361
if(e.id()==ID_symbol)
362362
{
363-
const auto& sym=symbol_table.lookup(to_symbol_expr(e).get_identifier());
363+
const auto &sym=symbol_table.lookup(to_symbol_expr(e).get_identifier());
364364
if(sym.is_static_lifetime)
365365
needed.add(sym);
366366
}
@@ -387,12 +387,12 @@ Function: gather_field_types
387387
\*******************************************************************/
388388

389389
static void gather_field_types(
390-
const typet& class_type,
391-
const namespacet& ns,
392-
std::set<irep_idt>& needed_classes)
390+
const typet &class_type,
391+
const namespacet &ns,
392+
std::set<irep_idt> &needed_classes)
393393
{
394-
const auto& underlying_type=to_struct_type(ns.follow(class_type));
395-
for(const auto& field : underlying_type.components())
394+
const auto &underlying_type=to_struct_type(ns.follow(class_type));
395+
for(const auto &field : underlying_type.components())
396396
{
397397
if(field.type().id()==ID_struct || field.type().id()==ID_symbol)
398398
gather_field_types(field.type(), ns, needed_classes);
@@ -401,7 +401,7 @@ static void gather_field_types(
401401
// Skip array primitive pointers, for example:
402402
if(field.type().subtype().id()!=ID_symbol)
403403
continue;
404-
const auto& field_classid=
404+
const auto &field_classid=
405405
to_symbol_type(field.type().subtype()).get_identifier();
406406
if(needed_classes.insert(field_classid).second)
407407
gather_field_types(field.type().subtype(), ns, needed_classes);
@@ -411,7 +411,7 @@ static void gather_field_types(
411411

412412
/*******************************************************************\
413413
414-
Function: initialise_needed_classes
414+
Function: initialize_needed_classes
415415
416416
Inputs: `entry_points`: list of fully-qualified function names that
417417
we should assume are reachable
@@ -426,26 +426,26 @@ Function: initialise_needed_classes
426426
427427
\*******************************************************************/
428428

429-
static void initialise_needed_classes(
430-
const std::vector<irep_idt>& entry_points,
431-
const namespacet& ns,
432-
const class_hierarchyt& ch,
433-
std::set<irep_idt>& needed_classes)
429+
static void initialize_needed_classes(
430+
const std::vector<irep_idt> &entry_points,
431+
const namespacet &ns,
432+
const class_hierarchyt &ch,
433+
std::set<irep_idt> &needed_classes)
434434
{
435-
for(const auto& mname : entry_points)
435+
for(const auto &mname : entry_points)
436436
{
437-
const auto& symbol=ns.lookup(mname);
438-
const auto& mtype=to_code_type(symbol.type);
439-
for(const auto& param : mtype.parameters())
437+
const auto &symbol=ns.lookup(mname);
438+
const auto &mtype=to_code_type(symbol.type);
439+
for(const auto &param : mtype.parameters())
440440
{
441441
if(param.type().id()==ID_pointer)
442442
{
443-
const auto& param_classid=
443+
const auto &param_classid=
444444
to_symbol_type(param.type().subtype()).get_identifier();
445445
std::vector<irep_idt> class_and_parents=
446446
ch.get_parents_trans(param_classid);
447447
class_and_parents.push_back(param_classid);
448-
for(const auto& classid : class_and_parents)
448+
for(const auto &classid : class_and_parents)
449449
needed_classes.insert(classid);
450450
gather_field_types(param.type().subtype(), ns, needed_classes);
451451
}
@@ -534,11 +534,11 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion(
534534
reachable_classes.push_back(main_class);
535535
else
536536
reachable_classes=main_jar_classes;
537-
for(const auto& classname : reachable_classes)
537+
for(const auto &classname : reachable_classes)
538538
{
539-
const auto& methods=
539+
const auto &methods=
540540
java_class_loader.class_map.at(classname).parsed_class.methods;
541-
for(const auto& method : methods)
541+
for(const auto &method : methods)
542542
{
543543
const irep_idt methodid="java::"+id2string(classname)+"."+
544544
id2string(method.name)+":"+
@@ -551,7 +551,7 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion(
551551
method_worklist2.push_back(main_function.main_function.name);
552552

553553
std::set<irep_idt> needed_classes;
554-
initialise_needed_classes(
554+
initialize_needed_classes(
555555
method_worklist2,
556556
namespacet(symbol_table),
557557
ch,
@@ -567,7 +567,7 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion(
567567
while(method_worklist2.size()!=0)
568568
{
569569
std::swap(method_worklist1, method_worklist2);
570-
for(const auto& mname : method_worklist1)
570+
for(const auto &mname : method_worklist1)
571571
{
572572
if(!methods_already_populated.insert(mname).second)
573573
continue;
@@ -578,7 +578,7 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion(
578578
continue;
579579
}
580580
debug() << "CI lazy methods: elaborate " << mname << eom;
581-
const auto& parsed_method=findit->second;
581+
const auto &parsed_method=findit->second;
582582
java_bytecode_convert_method(
583583
*parsed_method.first,
584584
*parsed_method.second,
@@ -604,7 +604,7 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion(
604604
<< " callsites)"
605605
<< eom;
606606

607-
for(const auto& callsite : virtual_callsites)
607+
for(const auto &callsite : virtual_callsites)
608608
{
609609
// This will also create a stub if a virtual callsite has no targets.
610610
get_virtual_method_targets(*callsite, needed_classes, method_worklist2,
@@ -616,7 +616,7 @@ bool java_bytecode_languaget::do_ci_lazy_method_conversion(
616616
// Remove symbols for methods that were declared but never used:
617617
symbol_tablet keep_symbols;
618618

619-
for(const auto& sym : symbol_table.symbols)
619+
for(const auto &sym : symbol_table.symbols)
620620
{
621621
if(sym.second.is_static_lifetime)
622622
continue;

src/java_bytecode/java_entry_point.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ main_function_resultt get_main_symbol(
2929
symbol_tablet &symbol_table,
3030
const irep_idt &main_class,
3131
message_handlert &,
32-
bool allow_no_body = false);
32+
bool allow_no_body=false);
3333

3434
#endif // CPROVER_JAVA_BYTECODE_JAVA_ENTRY_POINT_H

src/langapi/language_ui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ bool language_uit::parse(const std::string &filename)
104104
return true;
105105
}
106106

107-
std::pair<language_filest::filemapt::iterator, bool>
108-
result=language_files.filemap.insert(
107+
std::pair<language_filest::file_mapt::iterator, bool>
108+
result=language_files.file_map.insert(
109109
std::pair<std::string, language_filet>(filename, language_filet()));
110110

111111
language_filet &lf=result.first->second;

0 commit comments

Comments
 (0)