Skip to content

Commit 2f18e98

Browse files
Remove Java dependency from remove_virtual_functions
1 parent c861b0a commit 2f18e98

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/goto-programs/remove_virtual_functions.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Author: Daniel Kroening, [email protected]
1616

1717
#include <goto-programs/resolve_inherited_component.h>
1818

19+
#include <langapi/mode.h>
20+
#include <langapi/language.h>
21+
1922
#include <util/c_types.h>
2023
#include <util/prefix.h>
2124
#include <util/type_eq.h>
@@ -333,6 +336,10 @@ void remove_virtual_functionst::get_child_functions_rec(
333336
if(findit==class_hierarchy.class_map.end())
334337
return;
335338

339+
const auto language = get_language_from_identifier(symbol_table, this_id);
340+
CHECK_RETURN(language);
341+
const irep_idt root_base_class_type_name =
342+
language->root_base_class_type().get_identifier();
336343
for(const auto &child : findit->second.children)
337344
{
338345
// Skip if we have already visited this and we found a function call that
@@ -342,7 +349,7 @@ void remove_virtual_functionst::get_child_functions_rec(
342349
it != entry_map.end() &&
343350
!has_prefix(
344351
id2string(it->second.symbol_expr.get_identifier()),
345-
"java::java.lang.Object"))
352+
id2string(root_base_class_type_name)))
346353
{
347354
continue;
348355
}

0 commit comments

Comments
 (0)