Skip to content

Commit 3047678

Browse files
NlightNFotisthk123
authored andcommitted
Removed old method of specalising generics
We now use the select_pointer_type to specalise the type so we don't need to convert all references.
1 parent 2db8c45 commit 3047678

File tree

3 files changed

+1
-61
lines changed

3 files changed

+1
-61
lines changed

src/java_bytecode/generate_java_generic_type.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -126,46 +126,3 @@ irep_idt generate_java_generic_typet::build_generic_tag(
126126

127127
return new_tag_buffer.str();
128128
}
129-
130-
131-
/// Activate the generic instantiation code.
132-
/// \param message_handler
133-
/// \param symbol_table The symbol table so far.
134-
void
135-
instantiate_generics(
136-
message_handlert &message_handler,
137-
symbol_tablet &symbol_table)
138-
{
139-
generate_java_generic_typet instantiate_generic_type(message_handler);
140-
// check out the symbols in the symbol table at this point to see if we
141-
// have a a generic type in.
142-
for(const auto &symbol : symbol_table.symbols)
143-
{
144-
if(symbol.second.type.id()==ID_struct)
145-
{
146-
auto symbol_struct=to_struct_type(symbol.second.type);
147-
auto &components=symbol_struct.components();
148-
149-
for(const auto &component : components)
150-
{
151-
if(is_java_generic_type(component.type()))
152-
{
153-
const auto &type_vars=to_java_generic_type(component.type()).
154-
generic_type_variables();
155-
156-
// Before we can instantiate a generic component, we need
157-
// its type variables to be instantiated parameters
158-
if(all_of(type_vars.cbegin(), type_vars.cend(),
159-
[](const typet &type)
160-
{
161-
return is_java_generic_inst_parameter(type);
162-
}))
163-
{
164-
instantiate_generic_type(
165-
to_java_generic_type(component.type()), symbol_table);
166-
}
167-
}
168-
}
169-
}
170-
}
171-
}

src/java_bytecode/generate_java_generic_type.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,4 @@ class generate_java_generic_typet
3131
message_handlert &message_handler;
3232
};
3333

34-
void instantiate_generics(
35-
message_handlert &message_handler,
36-
symbol_tablet &symbol_table);
37-
3834
#endif // CPROVER_JAVA_BYTECODE_GENERATE_JAVA_GENERIC_TYPE_H

src/java_bytecode/java_bytecode_language.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,21 +240,8 @@ bool java_bytecode_languaget::typecheck(
240240
get_message_handler());
241241

242242
// now typecheck all
243-
bool res=java_bytecode_typecheck(
243+
return java_bytecode_typecheck(
244244
symbol_table, get_message_handler(), string_refinement_enabled);
245-
// NOTE (FOTIS): There is some unintuitive logic here, where
246-
// java_bytecode_check will return TRUE if typechecking failed, and FALSE
247-
// if everything went well...
248-
if(res)
249-
{
250-
// there is no point in continuing to concretise
251-
// the generic types if typechecking failed.
252-
return res;
253-
}
254-
255-
instantiate_generics(get_message_handler(), symbol_table);
256-
257-
return res;
258245
}
259246

260247
bool java_bytecode_languaget::generate_support_functions(

0 commit comments

Comments
 (0)