Skip to content

Commit 1f64e15

Browse files
Remove Java dependency from remove_virtual_functions
1 parent 3bad97a commit 1f64e15

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>
@@ -317,6 +320,10 @@ void remove_virtual_functionst::get_child_functions_rec(
317320
if(findit==class_hierarchy.class_map.end())
318321
return;
319322

323+
const auto language = get_language_from_identifier(ns, this_id);
324+
CHECK_RETURN(language);
325+
const irep_idt root_base_class_type_name =
326+
language->root_base_class_type().get_identifier();
320327
for(const auto &child : findit->second.children)
321328
{
322329
// Skip if we have already visited this and we found a function call that
@@ -326,7 +333,7 @@ void remove_virtual_functionst::get_child_functions_rec(
326333
it != entry_map.end() &&
327334
!has_prefix(
328335
id2string(it->second.symbol_expr.get_identifier()),
329-
"java::java.lang.Object"))
336+
id2string(root_base_class_type_name)))
330337
{
331338
continue;
332339
}

0 commit comments

Comments
 (0)