Skip to content

Commit 5b09acf

Browse files
committed
cpplint
1 parent 39ef50b commit 5b09acf

File tree

1 file changed

+44
-48
lines changed

1 file changed

+44
-48
lines changed

src/summaries/summary_dump.cpp

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -235,21 +235,19 @@ std::string dump_function_body_in_html(
235235
" <th>Index</th>\n"
236236
" <th>Name</th>\n"
237237
" <th>Type</th>\n"
238-
" </tr>\n"
239-
;
238+
" </tr>\n";
240239
assert(ns.get_symbol_table().has_symbol(raw_fn_name));
241240
const symbolt &fn_symbol=ns.lookup(raw_fn_name);
242241
const code_typet &fn_type=to_code_type(fn_symbol.type);
243-
for (std::size_t i=0UL, n=fn_type.parameters().size(); i!=n; ++i)
242+
for(std::size_t i=0UL, n=fn_type.parameters().size(); i!=n; ++i)
244243
{
245244
const code_typet::parametert &param=fn_type.parameters().at(i);
246245
ostr << " <tr>\n"
247246
" <td>" << i << "</td>\n"
248247
" <td>" << param.get_base_name() << "</td>\n"
249248
" <td>" << to_html_text(from_type(ns,"",param.type()))
250249
<< "</td>\n"
251-
" </tr>\n"
252-
;
250+
" </tr>\n";
253251
}
254252
ostr << "</table>\n";
255253

@@ -290,7 +288,7 @@ std::string dump_function_body_in_html(
290288

291289
// Dumping instruction
292290
ostr << " <td>\n";
293-
dump_instruction_code_in_html(*it,ns,ostr);
291+
dump_instruction_code_in_html(*it, ns, ostr);
294292
ostr << "</td>\n";
295293

296294
// Dumping labels
@@ -439,7 +437,7 @@ std::string dump_symbol_table_symbols_in_html(
439437
{
440438
fileutl_create_directory(fileutl_parse_path_in_pathname(pathname));
441439
std::fstream ostr(pathname, std::ios_base::out);
442-
if (!ostr.is_open())
440+
if(!ostr.is_open())
443441
return msgstream() << "ERROR: dump_symbol_table_symbols_in_html() : "
444442
"Cannot open the symbol-table-symbols log file '"
445443
<< pathname << "'.";
@@ -451,11 +449,11 @@ std::string dump_symbol_table_symbols_in_html(
451449
" <th>Symbol name</th>\n"
452450
" <th>Properties</th>\n"
453451
" </tr>\n";
454-
std::map<std::string,irep_idt> sorted_keys;
455-
for (const auto &name_props : symbol_table.symbols)
452+
std::map<std::string, irep_idt> sorted_keys;
453+
for(const auto &name_props : symbol_table.symbols)
456454
sorted_keys.insert({to_html_text(as_string(name_props.first)),
457455
name_props.first});
458-
for (const auto &name_key : sorted_keys)
456+
for(const auto &name_key : sorted_keys)
459457
{
460458
const symbolt &symbol=symbol_table.symbols.at(name_key.second);
461459
ostr << " <tr>\n";
@@ -496,7 +494,7 @@ std::string dump_symbol_table_symbols_in_html(
496494
ostr << " <tr>\n";
497495
ostr << " <td>Type of symbol</td>\n";
498496
ostr << " <td>"
499-
<< to_html_text(from_type(namespacet(symbol_table),"",symbol.type))
497+
<< to_html_text(from_type(namespacet(symbol_table), "", symbol.type))
500498
<< "</td>\n";
501499
ostr << " </tr>\n";
502500
ostr << " <tr>\n";
@@ -505,7 +503,8 @@ std::string dump_symbol_table_symbols_in_html(
505503
if(symbol.value.id()==ID_code)
506504
ostr << "&lt;function-body&gt;";
507505
else
508-
ostr << to_html_text(from_expr(namespacet(symbol_table),"",symbol.value));
506+
ostr << to_html_text(from_expr(namespacet(symbol_table), "",
507+
symbol.value));
509508
ostr << "</td>\n";
510509
ostr << " </tr>\n";
511510
ostr << " </table>\n";
@@ -524,19 +523,19 @@ std::string dump_symbol_table_base_map_in_html(
524523
{
525524
fileutl_create_directory(fileutl_parse_path_in_pathname(pathname));
526525
std::fstream ostr(pathname, std::ios_base::out);
527-
if (!ostr.is_open())
526+
if(!ostr.is_open())
528527
return msgstream() << "ERROR: dump_symbol_table_base_map_in_html() : "
529528
"Cannot open the symbol-table-base-map log file '"
530529
<< pathname << "'.";
531530

532-
dump_html_prefix(ostr,"Symbol table base");
531+
dump_html_prefix(ostr, "Symbol table base");
533532
ostr << "<h2>Content of multimap 'symbol_tablet::symbol_base_map'.</h2>\n";
534533
ostr << "<table>\n"
535534
" <tr>\n"
536535
" <th>Key</th>\n"
537536
" <th>Value</th>\n"
538537
" </tr>\n";
539-
for (const auto &name_base : base_map)
538+
for(const auto &name_base : base_map)
540539
{
541540
ostr << " <tr>\n";
542541
ostr << " <td>" << name_base.first << "</td>\n"
@@ -555,20 +554,20 @@ std::string dump_symbol_table_module_map_in_html(
555554
{
556555
fileutl_create_directory(fileutl_parse_path_in_pathname(pathname));
557556
std::fstream ostr(pathname, std::ios_base::out);
558-
if (!ostr.is_open())
557+
if(!ostr.is_open())
559558
return msgstream() << "ERROR: dump_symbol_table_module_map_in_html() : "
560559
"Cannot open the symbol-table-module-map log "
561560
"file '"
562561
<< pathname << "'.";
563-
dump_html_prefix(ostr,"Symbol table module");
562+
dump_html_prefix(ostr, "Symbol table module");
564563
ostr << "<h2>Content of multimap 'symbol_tablet::symbol_module_map'."
565564
"</h2>\n";
566565
ostr << "<table>\n"
567566
" <tr>\n"
568567
" <th>Key</th>\n"
569568
" <th>Value</th>\n"
570569
" </tr>\n";
571-
for (const auto &name_module : module_map)
570+
for(const auto &name_module : module_map)
572571
{
573572
ostr << " <tr>\n";
574573
ostr << " <td>" << name_module.first << "</td>\n"
@@ -631,16 +630,16 @@ std::string dump_symbol_table_in_html(
631630
{
632631
fileutl_create_directory(dump_root_directory);
633632
const std::string pathname=
634-
fileutl_concatenate_file_paths(dump_root_directory,"symbol_table.html");
635-
std::fstream ostr(pathname,std::ios_base::out);
636-
if (!ostr.is_open())
633+
fileutl_concatenate_file_paths(dump_root_directory, "symbol_table.html");
634+
std::fstream ostr(pathname, std::ios_base::out);
635+
if(!ostr.is_open())
637636
return msgstream() << "ERROR: dump_symbol_table_in_html() : "
638637
"Cannot open the symbol-table log file '"
639638
<< pathname << "'.";
640-
dump_html_prefix(ostr,"Symbol table module");
639+
dump_html_prefix(ostr, "Symbol table module");
641640
ostr << "<h3>Symbol table</h3>\n";
642641
std::string error=
643-
dump_symbol_table_as_html_table(symbol_table,dump_root_directory,ostr);
642+
dump_symbol_table_as_html_table(symbol_table, dump_root_directory, ostr);
644643
if(!error.empty())
645644
return error;
646645
dump_html_suffix(ostr);
@@ -708,7 +707,7 @@ std::string dump_goto_program_in_html(
708707
ostr << "<h3>Symbol table</h3>\n";
709708

710709
std::string error=
711-
dump_symbol_table_as_html_table(symbol_table,dump_root_directory,ostr);
710+
dump_symbol_table_as_html_table(symbol_table, dump_root_directory, ostr);
712711
if(!error.empty())
713712
return error;
714713

@@ -721,11 +720,11 @@ std::string dump_goto_program_in_html(
721720
std::string const cg_file =
722721
msgstream() << dump_root_directory << "/call_graph.html";
723722
std::fstream cg_ostr(cg_file, std::ios_base::out);
724-
if (!cg_ostr.is_open())
723+
if(!cg_ostr.is_open())
725724
return msgstream() << "ERROR: sumfn::dump_goto_program_in_html() : "
726725
"Cannot open the call-graph log file '"
727726
<< cg_file << "'.";
728-
dump_html_prefix(cg_ostr,"Call Graph");
727+
dump_html_prefix(cg_ostr, "Call Graph");
729728
cg_ostr << "<img style=\"max-width: 1920px;\" "
730729
"src=\"./call_graph.svg\" alt=\"call graph SVG file\">\n";
731730
dump_html_suffix(cg_ostr);
@@ -745,16 +744,16 @@ std::string dump_goto_program_in_html(
745744
{
746745
std::string const class_hierarchy_svg_file =
747746
msgstream() << dump_root_directory << "/class_hierarchy.svg";
748-
dump_classhierarchy_in_svg(class_hierarchy,class_hierarchy_svg_file);
747+
dump_classhierarchy_in_svg(class_hierarchy, class_hierarchy_svg_file);
749748

750749
std::string const ch_file =
751750
msgstream() << dump_root_directory << "/class_hierarchy.html";
752751
std::fstream ch_ostr(ch_file, std::ios_base::out);
753-
if (!ch_ostr.is_open())
752+
if(!ch_ostr.is_open())
754753
return msgstream() << "ERROR: sumfn::dump_goto_program_in_html() : "
755754
"Cannot open the class-hierarchy log file '"
756755
<< ch_file << "'.";
757-
dump_html_prefix(ch_ostr,"Class Hierarchy");
756+
dump_html_prefix(ch_ostr, "Class Hierarchy");
758757
ch_ostr << "<img style=\"max-width: 1920px;\" "
759758
"src=\"./class_hierarchy.svg\" "
760759
"alt=\"class hierarchy SVG file\">\n";
@@ -774,7 +773,7 @@ std::string dump_goto_program_in_html(
774773
ostr << "<h3>Inverted (partial) topological order of functions (i.e. "
775774
"from callees to callers):</h3>\n";
776775
ostr << "<ul>\n";
777-
for (irep_idt const& fn_name : inverted_functions_topological_order)
776+
for(irep_idt const& fn_name : inverted_functions_topological_order)
778777
ostr << "<li>" << to_html_text(as_string(fn_name)) << "</li>\n";
779778
ostr << "</ul>\n";
780779

@@ -794,43 +793,40 @@ std::string dump_goto_functions_in_html(
794793
if(it->second.body_available())
795794
{
796795
std::string err_message =
797-
dump_function_body_in_html(
798-
it->first,
799-
it->second.body,
800-
ns,
801-
fileutl_concatenate_file_paths(
802-
dump_root_directory,to_file_name(as_string(it->first)))
803-
);
804-
if (!err_message.empty())
796+
dump_function_body_in_html(
797+
it->first,
798+
it->second.body,
799+
ns,
800+
fileutl_concatenate_file_paths(
801+
dump_root_directory, to_file_name(as_string(it->first))));
802+
if(!err_message.empty())
805803
return err_message;
806804
}
807805

808806
const std::string log_filename =
809807
msgstream() << dump_root_directory << "/index.html";
810808
std::fstream ostr(log_filename, std::ios_base::out);
811-
if (!ostr.is_open())
809+
if(!ostr.is_open())
812810
return msgstream() << "ERROR: sumfn::dump_goto_functions_in_html() : "
813-
"Cannot open the log file '" << log_filename << "'."
814-
;
815-
dump_html_prefix(ostr,"Functions");
811+
"Cannot open the log file '" << log_filename
812+
<< "'.";
813+
dump_html_prefix(ostr, "Functions");
816814
ostr << "<h3>Listing of functions</h3>\n";
817815
ostr << "<table>\n"
818816
" <tr>\n"
819817
" <th>Function name</th>\n"
820818
" <th>Code</th>\n"
821-
" </tr>\n"
822-
;
823-
std::set<std::string> ordered;
819+
" </tr>\n";
820+
std::set<std::string> ordered;
824821
for(auto it=functions.cbegin(); it!=functions.cend(); ++it)
825822
if(it->second.body_available())
826823
ordered.insert(as_string(it->first));
827-
for (const auto &fn_name : ordered)
824+
for(const auto &fn_name : ordered)
828825
ostr << " <tr>\n"
829826
" <td>" << to_html_text(fn_name) << "</td>\n"
830827
" <td><a href=\"./" << to_file_name(fn_name)
831828
<< "/index.html\">here</a></td>\n"
832-
" </tr>\n"
833-
;
829+
" </tr>\n";
834830
ostr << "</table>\n";
835831
dump_html_suffix(ostr);
836832
return ""; // no error.

0 commit comments

Comments
 (0)