@@ -431,15 +431,16 @@ std::string dump_symbol_table_symbols_in_html(
431
431
432
432
dump_html_prefix (ostr, " Symbol table symbols" );
433
433
ostr << " <h2>Symbols table</h2>\n " ;
434
- ostr << " <table>\n "
435
- " <tr>\n "
436
- " <th>Symbol name</th>\n "
437
- " <th>Properties</th>\n "
438
- " </tr>\n " ;
439
434
std::map<std::string, irep_idt> sorted_keys;
440
435
for (const auto &name_props : symbol_table.symbols )
441
436
sorted_keys.insert ({to_html_text (as_string (name_props.first )),
442
437
name_props.first });
438
+ ostr << " <table>\n "
439
+ " <caption>There are " << sorted_keys.size () << " symbols.</caption>\n "
440
+ " <tr>\n "
441
+ " <th>Symbol name</th>\n "
442
+ " <th>Properties</th>\n "
443
+ " </tr>\n " ;
443
444
for (const auto &name_key : sorted_keys)
444
445
{
445
446
const symbolt &symbol=symbol_table.symbols .at (name_key.second );
@@ -684,25 +685,29 @@ std::string dump_symbol_table_as_html_table(
684
685
if (!error.empty ())
685
686
return error;
686
687
687
- ostr << " <table>\n "
688
- " <tr>\n "
689
- " <th>Property</th>\n "
690
- " <th>Value</th>\n "
691
- " </tr>\n "
692
- " <tr>\n "
693
- " <td>Detailed information about all symbols in the table</td>\n "
694
- " <td><a href=\" ./symbol_table_symbols.html\" >here</a></td>\n "
695
- " </tr>\n "
696
- " <tr>\n "
697
- " <td>Content of multimap 'symbol_tablet::symbol_base_map'</td>\n "
698
- " <td><a href=\" ./symbol_table_base.html\" >here</a></td>\n "
699
- " </tr>\n "
700
- " <tr>\n "
701
- " <td>Content of multimap 'symbol_tablet::symbol_module_map'"
702
- " </td>\n "
703
- " <td><a href=\" ./symbol_table_module.html\" >here</a></td>\n "
704
- " </tr>\n "
705
- " </table>\n " ;
688
+ ostr
689
+ << " <table>\n "
690
+ << " <caption>There are "
691
+ << symbol_table.symbols .size ()
692
+ << " symbols.</caption>\n "
693
+ << " <tr>\n "
694
+ << " <th>Property</th>\n "
695
+ << " <th>Value</th>\n "
696
+ << " </tr>\n "
697
+ << " <tr>\n "
698
+ << " <td>Detailed information about all symbols in the table</td>\n "
699
+ << " <td><a href=\" ./symbol_table_symbols.html\" >here</a></td>\n "
700
+ << " </tr>\n "
701
+ << " <tr>\n "
702
+ << " <td>Content of multimap 'symbol_tablet::symbol_base_map'</td>\n "
703
+ << " <td><a href=\" ./symbol_table_base.html\" >here</a></td>\n "
704
+ << " </tr>\n "
705
+ << " <tr>\n "
706
+ << " <td>Content of multimap 'symbol_tablet::symbol_module_map'"
707
+ << " </td>\n "
708
+ << " <td><a href=\" ./symbol_table_module.html\" >here</a></td>\n "
709
+ << " </tr>\n "
710
+ << " </table>\n " ;
706
711
707
712
return error;
708
713
}
@@ -769,16 +774,21 @@ std::string dump_goto_program_in_html(
769
774
ostr << " <h1>Properties of the analysed GOTO program</h1>\n " ;
770
775
771
776
ostr << " <h3>Listing of functions with bodies (definitions).</h3>\n " ;
772
- ostr << " <table>\n "
773
- " <tr>\n "
774
- " <th>Function name</th>\n "
775
- " <th>Code</th>\n "
776
- " </tr>\n "
777
- ;
778
- std::set<std::string> ordered;
777
+ std::set<std::string> ordered, ordered_declarations;
779
778
for (auto it = functions.cbegin (); it != functions.cend (); it++)
779
+ {
780
780
if (it->second .body_available ())
781
781
ordered.insert (as_string (it->first ));
782
+ else
783
+ ordered_declarations.insert (as_string (it->first ));
784
+ }
785
+ ostr
786
+ << " <table>\n "
787
+ << " <caption>There are " << ordered.size () << " functions.</caption>\n "
788
+ << " <tr>\n "
789
+ << " <th>Function name</th>\n "
790
+ << " <th>Code</th>\n "
791
+ << " </tr>\n " ;
782
792
for (auto const & fn_name : ordered)
783
793
ostr << " <tr>\n "
784
794
" <td>" << to_html_text (fn_name) << " </td>\n "
@@ -788,6 +798,25 @@ std::string dump_goto_program_in_html(
788
798
;
789
799
ostr << " </table>\n " ;
790
800
801
+ if (!ordered_declarations.empty ())
802
+ {
803
+ ostr
804
+ << " <h3>Listing of functions without bodies (undefined references)</h3>\n "
805
+ << " <table>\n "
806
+ << " <caption>There are "
807
+ << ordered_declarations.size ()
808
+ << " functions." ;
809
+ for (const auto &fn_name : ordered_declarations)
810
+ {
811
+ ostr
812
+ << " <tr>\n "
813
+ << " <td>" << to_html_text (fn_name) << " </td>\n "
814
+ << " </tr>\n " ;
815
+ }
816
+ ostr << " </table>\n " ;
817
+ }
818
+
819
+
791
820
ostr << " <h3>Symbol table</h3>\n " ;
792
821
793
822
std::string error=
@@ -895,23 +924,51 @@ std::string dump_goto_functions_in_html(
895
924
" Cannot open the log file '" << log_filename
896
925
<< " '." ;
897
926
dump_html_prefix (ostr, " Functions" );
898
- ostr << " <h3>Listing of functions</h3>\n " ;
899
- ostr << " <table>\n "
900
- " <tr>\n "
901
- " <th>Function name</th>\n "
902
- " <th>Code</th>\n "
903
- " </tr>\n " ;
904
- std::set<std::string> ordered;
927
+ ostr << " <h3>Listing of functions with bodies (definitions)</h3>\n " ;
928
+ std::set<std::string> ordered, ordered_declarations;
905
929
for (auto it=functions.cbegin (); it!=functions.cend (); ++it)
930
+ {
906
931
if (it->second .body_available ())
907
932
ordered.insert (as_string (it->first ));
933
+ else
934
+ ordered_declarations.insert (as_string (it->first ));
935
+ }
936
+ ostr
937
+ << " <table>\n "
938
+ << " <caption>There are "
939
+ << ordered.size ()
940
+ << " functions."
941
+ <<" </caption>\n "
942
+ << " <tr>\n "
943
+ << " <th>Function name</th>\n "
944
+ << " <th>Code</th>\n "
945
+ << " </tr>\n " ;
908
946
for (const auto &fn_name : ordered)
909
947
ostr << " <tr>\n "
910
948
" <td>" << to_html_text (fn_name) << " </td>\n "
911
949
" <td><a href=\" ./" << to_file_name (fn_name)
912
950
<< " /index.html\" >here</a></td>\n "
913
951
" </tr>\n " ;
914
952
ostr << " </table>\n " ;
953
+
954
+ if (!ordered_declarations.empty ())
955
+ {
956
+ ostr
957
+ << " <h3>Listing of functions without bodies (undefined references)</h3>\n "
958
+ << " <table>\n "
959
+ << " <caption>There are "
960
+ << ordered_declarations.size ()
961
+ << " functions." ;
962
+ for (const auto &fn_name : ordered_declarations)
963
+ {
964
+ ostr
965
+ << " <tr>\n "
966
+ << " <td>" << to_html_text (fn_name) << " </td>\n "
967
+ << " </tr>\n " ;
968
+ }
969
+ ostr << " </table>\n " ;
970
+ }
971
+
915
972
dump_html_suffix (ostr);
916
973
return " " ; // no error.
917
974
}
0 commit comments