@@ -172,13 +172,16 @@ void dump_ct::operator()(std::ostream &os)
172
172
type_id==ID_incomplete_union ||
173
173
type_id==ID_c_enum))
174
174
{
175
- os << " // " << symbol.name << ' \n ' ;
176
- os << " // " << symbol.location << ' \n ' ;
175
+ if (!ignore (symbol))
176
+ {
177
+ os << " // " << symbol.name << ' \n ' ;
178
+ os << " // " << symbol.location << ' \n ' ;
177
179
178
- if (type_id==ID_c_enum)
179
- convert_compound_enum (symbol.type , os);
180
- else
181
- os << type_to_string (symbol_typet (symbol.name )) << " ;\n\n " ;
180
+ if (type_id==ID_c_enum)
181
+ convert_compound_enum (symbol.type , os);
182
+ else
183
+ os << type_to_string (symbol_typet (symbol.name )) << " ;\n\n " ;
184
+ }
182
185
}
183
186
else if (symbol.is_static_lifetime && symbol.type .id ()!=ID_code)
184
187
convert_global_variable (
@@ -749,6 +752,38 @@ void dump_ct::init_system_library_map()
749
752
ADD_TO_SYSTEM_LIBRARY (sys_wait_syms, " sys/wait.h" );
750
753
}
751
754
755
+ /* ******************************************************************\
756
+
757
+ Function: dump_ct::ignore
758
+
759
+ Inputs: type input to check whether it should not be dumped
760
+
761
+ Outputs: true, iff the type should not be printed
762
+
763
+ Purpose: Ignore selected types as they are covered via system headers
764
+
765
+ \*******************************************************************/
766
+
767
+ bool dump_ct::ignore (const typet &type)
768
+ {
769
+ symbolt symbol;
770
+ symbol.type =type;
771
+
772
+ return ignore (symbol);
773
+ }
774
+
775
+ /* ******************************************************************\
776
+
777
+ Function: dump_ct::ignore
778
+
779
+ Inputs: type input to check whether it should not be dumped
780
+
781
+ Outputs: true, iff the symbol should not be printed
782
+
783
+ Purpose: Ignore selected symbols as they are covered via system headers
784
+
785
+ \*******************************************************************/
786
+
752
787
bool dump_ct::ignore (const symbolt &symbol)
753
788
{
754
789
const std::string &name_str=id2string (symbol.name );
0 commit comments