Skip to content

Commit 2855c2a

Browse files
author
Daniel Kroening
committed
type symbols now use ID_symbol_type
1 parent 0e72433 commit 2855c2a

Some content is hidden

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

62 files changed

+156
-161
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+
assert(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());
@@ -2568,7 +2568,7 @@ codet java_bytecode_convert_methodt::convert_putstatic(
25682568
const exprt::operandst &op,
25692569
const symbol_exprt &symbol_expr)
25702570
{
2571-
if(needed_lazy_methods && arg0.type().id() == ID_symbol)
2571+
if(needed_lazy_methods && arg0.type().id() == ID_symbol_type)
25722572
{
25732573
needed_lazy_methods->add_needed_class(
25742574
to_symbol_type(arg0.type()).get_identifier());
@@ -2618,15 +2618,15 @@ void java_bytecode_convert_methodt::convert_getstatic(
26182618
{
26192619
if(needed_lazy_methods)
26202620
{
2621-
if(arg0.type().id() == ID_symbol)
2621+
if(arg0.type().id() == ID_symbol_type)
26222622
{
26232623
needed_lazy_methods->add_needed_class(
26242624
to_symbol_type(arg0.type()).get_identifier());
26252625
}
26262626
else if(arg0.type().id() == ID_pointer)
26272627
{
26282628
const auto &pointer_type = to_pointer_type(arg0.type());
2629-
if(pointer_type.subtype().id() == ID_symbol)
2629+
if(pointer_type.subtype().id() == ID_symbol_type)
26302630
{
26312631
needed_lazy_methods->add_needed_class(
26322632
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
@@ -1168,7 +1168,7 @@ void java_object_factoryt::gen_nondet_init(
11681168
if(is_sub)
11691169
{
11701170
const typet &symbol = override_ ? override_type : expr.type();
1171-
PRECONDITION(symbol.id() == ID_symbol);
1171+
PRECONDITION(symbol.id() == ID_symbol_type);
11721172
generic_parameter_specialization_map_keys.insert_pairs_for_symbol(
11731173
to_symbol_type(symbol), struct_type);
11741174
}
@@ -1272,7 +1272,7 @@ void java_object_factoryt::gen_nondet_array_init(
12721272
update_in_placet update_in_place)
12731273
{
12741274
PRECONDITION(expr.type().id()==ID_pointer);
1275-
PRECONDITION(expr.type().subtype().id()==ID_symbol);
1275+
PRECONDITION(expr.type().subtype().id() == ID_symbol_type);
12761276
PRECONDITION(update_in_place!=update_in_placet::MAY_UPDATE_IN_PLACE);
12771277

12781278
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
@@ -892,7 +892,7 @@ void java_string_library_preprocesst::code_assign_java_string_to_string_expr(
892892
PRECONDITION(implements_java_char_sequence_pointer(rhs.type()));
893893

894894
typet deref_type;
895-
if(rhs.type().subtype().id()==ID_symbol)
895+
if(rhs.type().subtype().id() == ID_symbol_type)
896896
deref_type=symbol_table.lookup_ref(
897897
to_symbol_type(rhs.type().subtype()).get_identifier()).type;
898898
else

jbmc/src/java_bytecode/java_types.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,8 @@ bool equal_java_types(const typet &type1, const typet &type2)
744744
bool arrays_with_same_element_type = true;
745745
if(
746746
type1.id() == ID_pointer && type2.id() == ID_pointer &&
747-
type1.subtype().id() == ID_symbol && type2.subtype().id() == ID_symbol)
747+
type1.subtype().id() == ID_symbol_type &&
748+
type2.subtype().id() == ID_symbol_type)
748749
{
749750
const symbol_typet &subtype_symbol1 = to_symbol_type(type1.subtype());
750751
const symbol_typet &subtype_symbol2 = to_symbol_type(type2.subtype());
@@ -791,7 +792,7 @@ void get_dependencies_from_generic_parameters_rec(
791792
}
792793

793794
// symbol type
794-
else if(t.id() == ID_symbol)
795+
else if(t.id() == ID_symbol_type)
795796
{
796797
const symbol_typet &symbol_type = to_symbol_type(t);
797798
const irep_idt class_name(symbol_type.get_identifier());
@@ -925,7 +926,7 @@ std::string pretty_java_type(const typet &type)
925926
return "byte";
926927
else if(is_reference(type))
927928
{
928-
if(type.subtype().id() == ID_symbol)
929+
if(type.subtype().id() == ID_symbol_type)
929930
{
930931
const auto &symbol_type = to_symbol_type(type.subtype());
931932
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
@@ -107,7 +107,7 @@ pointer_typet select_pointer_typet::specialize_generics(
107107
visited_nodes.erase(parameter_name);
108108
return returned_type;
109109
}
110-
else if(pointer_type.subtype().id() == ID_symbol)
110+
else if(pointer_type.subtype().id() == ID_symbol_type)
111111
{
112112
// if the pointer is an array, recursively specialize its element type
113113
const symbol_typet &array_subtype = to_symbol_type(pointer_type.subtype());

0 commit comments

Comments
 (0)