@@ -27,12 +27,15 @@ resolve_inherited_componentt::resolve_inherited_componentt(
2727// / class specifier)
2828// / \param include_interfaces: If true, consider inheritance from interfaces
2929// / (parent types other than the first listed)
30+ // / \param user_filter: Predicate that should return true for symbols that can
31+ // / be returned. Those for which it returns false will be ignored.
3032// / \return The concrete component that has been resolved
3133optionalt<resolve_inherited_componentt::inherited_componentt>
3234resolve_inherited_componentt::operator ()(
3335 const irep_idt &class_id,
3436 const irep_idt &component_name,
35- bool include_interfaces)
37+ bool include_interfaces,
38+ const std::function<bool (const symbolt &)> user_filter)
3639{
3740 PRECONDITION (!class_id.empty ());
3841 PRECONDITION (!component_name.empty ());
@@ -47,7 +50,8 @@ resolve_inherited_componentt::operator()(
4750 const irep_idt &full_component_identifier=
4851 build_full_component_identifier (current_class, component_name);
4952
50- if (symbol_table.has_symbol (full_component_identifier))
53+ const symbolt *symbol = symbol_table.lookup (full_component_identifier);
54+ if (symbol && user_filter (*symbol))
5155 {
5256 return inherited_componentt (current_class, component_name);
5357 }
0 commit comments