Skip to content

Commit 159bf15

Browse files
Merge pull request #2205 from diffblue/rename_symbol_type
type symbols now use ID_symbol_type
2 parents 097cf71 + 355fbd2 commit 159bf15

File tree

68 files changed

+162
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+162
-169
lines changed

jbmc/src/java_bytecode/ci_lazy_methods_needed.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void ci_lazy_methods_neededt::gather_field_types(
112112
{
113113
// If class_type is not a symbol this may be a reference array,
114114
// but we can't tell what type.
115-
if(class_type.id() == ID_symbol)
115+
if(class_type.id() == ID_symbol_type)
116116
{
117117
const typet &element_type =
118118
java_array_element_type(to_symbol_type(class_type));
@@ -127,11 +127,11 @@ void ci_lazy_methods_neededt::gather_field_types(
127127
{
128128
for(const auto &field : underlying_type.components())
129129
{
130-
if(field.type().id() == ID_struct || field.type().id() == ID_symbol)
130+
if(field.type().id() == ID_struct || field.type().id() == ID_symbol_type)
131131
gather_field_types(field.type(), ns);
132132
else if(field.type().id() == ID_pointer)
133133
{
134-
if(field.type().subtype().id() == ID_symbol)
134+
if(field.type().subtype().id() == ID_symbol_type)
135135
{
136136
add_all_needed_classes(to_pointer_type(field.type()));
137137
}

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
16351635
const typecast_exprt pointer(op[0], java_array_type(statement[0]));
16361636

16371637
dereference_exprt array(pointer, pointer.type().subtype());
1638-
assert(pointer.type().subtype().id()==ID_symbol);
1638+
PRECONDITION(pointer.type().subtype().id() == ID_symbol_type);
16391639
array.set(ID_java_member_access, true);
16401640

16411641
const member_exprt length(array, "length", java_int_type());
@@ -2564,7 +2564,7 @@ codet java_bytecode_convert_methodt::convert_putstatic(
25642564
const exprt::operandst &op,
25652565
const symbol_exprt &symbol_expr)
25662566
{
2567-
if(needed_lazy_methods && arg0.type().id() == ID_symbol)
2567+
if(needed_lazy_methods && arg0.type().id() == ID_symbol_type)
25682568
{
25692569
needed_lazy_methods->add_needed_class(
25702570
to_symbol_type(arg0.type()).get_identifier());
@@ -2614,15 +2614,15 @@ void java_bytecode_convert_methodt::convert_getstatic(
26142614
{
26152615
if(needed_lazy_methods)
26162616
{
2617-
if(arg0.type().id() == ID_symbol)
2617+
if(arg0.type().id() == ID_symbol_type)
26182618
{
26192619
needed_lazy_methods->add_needed_class(
26202620
to_symbol_type(arg0.type()).get_identifier());
26212621
}
26222622
else if(arg0.type().id() == ID_pointer)
26232623
{
26242624
const auto &pointer_type = to_pointer_type(arg0.type());
2625-
if(pointer_type.subtype().id() == ID_symbol)
2625+
if(pointer_type.subtype().id() == ID_symbol_type)
26262626
{
26272627
needed_lazy_methods->add_needed_class(
26282628
to_symbol_type(pointer_type.subtype()).get_identifier());

jbmc/src/java_bytecode/java_bytecode_parse_tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ java_bytecode_parse_treet::find_annotation(
117117
if(annotation.type.id() != ID_pointer)
118118
return false;
119119
const typet &type = annotation.type.subtype();
120-
return type.id() == ID_symbol &&
120+
return type.id() == ID_symbol_type &&
121121
to_symbol_type(type).get_identifier() == annotation_type_name;
122122
});
123123
if(annotation_it == annotations.end())

jbmc/src/java_bytecode/java_bytecode_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ void java_bytecode_parsert::get_class_refs_rec(const typet &src)
616616
for(const auto &p : ct.parameters())
617617
get_class_refs_rec(p.type());
618618
}
619-
else if(src.id()==ID_symbol)
619+
else if(src.id()==ID_symbol_type)
620620
{
621621
irep_idt name=src.get(ID_C_base_name);
622622
if(has_prefix(id2string(name), "array["))

jbmc/src/java_bytecode/java_bytecode_typecheck_type.cpp

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

1717
void java_bytecode_typecheckt::typecheck_type(typet &type)
1818
{
19-
if(type.id()==ID_symbol)
19+
if(type.id() == ID_symbol_type)
2020
{
2121
irep_idt identifier=to_symbol_type(type).get_identifier();
2222

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ void java_object_factoryt::gen_nondet_init(
11791179
if(is_sub)
11801180
{
11811181
const typet &symbol = override_ ? override_type : expr.type();
1182-
PRECONDITION(symbol.id() == ID_symbol);
1182+
PRECONDITION(symbol.id() == ID_symbol_type);
11831183
generic_parameter_specialization_map_keys.insert_pairs_for_symbol(
11841184
to_symbol_type(symbol), struct_type);
11851185
}
@@ -1286,7 +1286,7 @@ void java_object_factoryt::gen_nondet_array_init(
12861286
const source_locationt &location)
12871287
{
12881288
PRECONDITION(expr.type().id()==ID_pointer);
1289-
PRECONDITION(expr.type().subtype().id()==ID_symbol);
1289+
PRECONDITION(expr.type().subtype().id() == ID_symbol_type);
12901290
PRECONDITION(update_in_place!=update_in_placet::MAY_UPDATE_IN_PLACE);
12911291

12921292
const typet &type=ns.follow(expr.type().subtype());

jbmc/src/java_bytecode/java_string_library_preprocess.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Date: April 2017
3636
irep_idt get_tag(const typet &type)
3737
{
3838
/// \todo Use follow instead of assuming tag to symbol relationship.
39-
if(type.id() == ID_symbol)
39+
if(type.id() == ID_symbol_type)
4040
return to_symbol_type(type).get_identifier();
4141
else if(type.id() == ID_struct)
4242
return irep_idt("java::" + id2string(to_struct_type(type).get_tag()));
@@ -394,11 +394,11 @@ java_string_library_preprocesst::process_equals_function_operands(
394394
/// \return type of the "data" component
395395
static typet get_data_type(const typet &type, const symbol_tablet &symbol_table)
396396
{
397-
PRECONDITION(type.id()==ID_struct || type.id()==ID_symbol);
398-
if(type.id()==ID_symbol)
397+
PRECONDITION(type.id() == ID_struct || type.id() == ID_symbol_type);
398+
if(type.id() == ID_symbol_type)
399399
{
400400
symbolt sym=*symbol_table.lookup(to_symbol_type(type).get_identifier());
401-
CHECK_RETURN(sym.type.id()!=ID_symbol);
401+
CHECK_RETURN(sym.type.id() != ID_symbol_type);
402402
return get_data_type(sym.type, symbol_table);
403403
}
404404
// else type id is ID_struct
@@ -413,11 +413,11 @@ static typet get_data_type(const typet &type, const symbol_tablet &symbol_table)
413413
static typet
414414
get_length_type(const typet &type, const symbol_tablet &symbol_table)
415415
{
416-
PRECONDITION(type.id()==ID_struct || type.id()==ID_symbol);
417-
if(type.id()==ID_symbol)
416+
PRECONDITION(type.id() == ID_struct || type.id() == ID_symbol_type);
417+
if(type.id() == ID_symbol_type)
418418
{
419419
symbolt sym=*symbol_table.lookup(to_symbol_type(type).get_identifier());
420-
CHECK_RETURN(sym.type.id()!=ID_symbol);
420+
CHECK_RETURN(sym.type.id() != ID_symbol_type);
421421
return get_length_type(sym.type, symbol_table);
422422
}
423423
// else type id is ID_struct
@@ -894,7 +894,7 @@ void java_string_library_preprocesst::code_assign_java_string_to_string_expr(
894894
PRECONDITION(implements_java_char_sequence_pointer(rhs.type()));
895895

896896
typet deref_type;
897-
if(rhs.type().subtype().id()==ID_symbol)
897+
if(rhs.type().subtype().id() == ID_symbol_type)
898898
deref_type=symbol_table.lookup_ref(
899899
to_symbol_type(rhs.type().subtype()).get_identifier()).type;
900900
else

jbmc/src/java_bytecode/java_types.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,8 @@ bool equal_java_types(const typet &type1, const typet &type2)
777777
bool arrays_with_same_element_type = true;
778778
if(
779779
type1.id() == ID_pointer && type2.id() == ID_pointer &&
780-
type1.subtype().id() == ID_symbol && type2.subtype().id() == ID_symbol)
780+
type1.subtype().id() == ID_symbol_type &&
781+
type2.subtype().id() == ID_symbol_type)
781782
{
782783
const symbol_typet &subtype_symbol1 = to_symbol_type(type1.subtype());
783784
const symbol_typet &subtype_symbol2 = to_symbol_type(type2.subtype());
@@ -824,7 +825,7 @@ void get_dependencies_from_generic_parameters_rec(
824825
}
825826

826827
// symbol type
827-
else if(t.id() == ID_symbol)
828+
else if(t.id() == ID_symbol_type)
828829
{
829830
const symbol_typet &symbol_type = to_symbol_type(t);
830831
const irep_idt class_name(symbol_type.get_identifier());
@@ -958,7 +959,7 @@ std::string pretty_java_type(const typet &type)
958959
return "byte";
959960
else if(is_reference(type))
960961
{
961-
if(type.subtype().id() == ID_symbol)
962+
if(type.subtype().id() == ID_symbol_type)
962963
{
963964
const auto &symbol_type = to_symbol_type(type.subtype());
964965
const irep_idt &id = symbol_type.get_identifier();

jbmc/src/java_bytecode/remove_instanceof.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool remove_instanceoft::lower_instanceof(
8585

8686
// Find all types we know about that satisfy the given requirement:
8787
INVARIANT(
88-
target_type.id()==ID_symbol,
88+
target_type.id() == ID_symbol_type,
8989
"instanceof second operand should have a simple type");
9090
const irep_idt &target_name=
9191
to_symbol_type(target_type).get_identifier();

jbmc/src/java_bytecode/select_pointer_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pointer_typet select_pointer_typet::specialize_generics(
108108
visited_nodes.erase(parameter_name);
109109
return returned_type;
110110
}
111-
else if(pointer_type.subtype().id() == ID_symbol)
111+
else if(pointer_type.subtype().id() == ID_symbol_type)
112112
{
113113
// if the pointer is an array, recursively specialize its element type
114114
const symbol_typet &array_subtype = to_symbol_type(pointer_type.subtype());

0 commit comments

Comments
 (0)