@@ -27,12 +27,15 @@ resolve_inherited_componentt::resolve_inherited_componentt(
27
27
// / class specifier)
28
28
// / \param include_interfaces: If true, consider inheritance from interfaces
29
29
// / (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.
30
32
// / \return The concrete component that has been resolved
31
33
optionalt<resolve_inherited_componentt::inherited_componentt>
32
34
resolve_inherited_componentt::operator ()(
33
35
const irep_idt &class_id,
34
36
const irep_idt &component_name,
35
- bool include_interfaces)
37
+ bool include_interfaces,
38
+ const std::function<bool (const symbolt &)> user_filter)
36
39
{
37
40
PRECONDITION (!class_id.empty ());
38
41
PRECONDITION (!component_name.empty ());
@@ -47,7 +50,8 @@ resolve_inherited_componentt::operator()(
47
50
const irep_idt &full_component_identifier=
48
51
build_full_component_identifier (current_class, component_name);
49
52
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))
51
55
{
52
56
return inherited_componentt (current_class, component_name);
53
57
}
0 commit comments