Skip to content

Commit ae4fe25

Browse files
author
Daniel Kroening
committed
type symbols now use ID_symbol_type
1 parent 1700b60 commit ae4fe25

Some content is hidden

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

59 files changed

+128
-122
lines changed

jbmc/src/java_bytecode/ci_lazy_methods.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ void ci_lazy_methodst::gather_field_types(
628628
{
629629
// If class_type is not a symbol this may be a reference array,
630630
// but we can't tell what type.
631-
if(class_type.id() == ID_symbol)
631+
if(class_type.id() == ID_symbol_type)
632632
{
633633
const typet &element_type =
634634
java_array_element_type(to_symbol_type(class_type));
@@ -644,11 +644,11 @@ void ci_lazy_methodst::gather_field_types(
644644
{
645645
for(const auto &field : underlying_type.components())
646646
{
647-
if(field.type().id() == ID_struct || field.type().id() == ID_symbol)
647+
if(field.type().id() == ID_struct || field.type().id() == ID_symbol_type)
648648
gather_field_types(field.type(), ns, needed_lazy_methods);
649649
else if(field.type().id() == ID_pointer)
650650
{
651-
if(field.type().subtype().id() == ID_symbol)
651+
if(field.type().subtype().id() == ID_symbol_type)
652652
{
653653
initialize_all_instantiated_classes_from_pointer(
654654
to_pointer_type(field.type()), ns, needed_lazy_methods);

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

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

16121612
dereference_exprt array(pointer, pointer.type().subtype());
1613-
assert(pointer.type().subtype().id()==ID_symbol);
1613+
assert(pointer.type().subtype().id()==ID_symbol_type);
16141614
array.set(ID_java_member_access, true);
16151615

16161616
const member_exprt length(array, "length", java_int_type());
@@ -2553,7 +2553,7 @@ codet java_bytecode_convert_methodt::convert_putstatic(
25532553
const exprt::operandst &op,
25542554
const symbol_exprt &symbol_expr)
25552555
{
2556-
if(needed_lazy_methods && arg0.type().id() == ID_symbol)
2556+
if(needed_lazy_methods && arg0.type().id() == ID_symbol_type)
25572557
{
25582558
needed_lazy_methods->add_needed_class(
25592559
to_symbol_type(arg0.type()).get_identifier());
@@ -2603,15 +2603,15 @@ void java_bytecode_convert_methodt::convert_getstatic(
26032603
{
26042604
if(needed_lazy_methods)
26052605
{
2606-
if(arg0.type().id() == ID_symbol)
2606+
if(arg0.type().id() == ID_symbol_type)
26072607
{
26082608
needed_lazy_methods->add_needed_class(
26092609
to_symbol_type(arg0.type()).get_identifier());
26102610
}
26112611
else if(arg0.type().id() == ID_pointer)
26122612
{
26132613
const auto &pointer_type = to_pointer_type(arg0.type());
2614-
if(pointer_type.subtype().id() == ID_symbol)
2614+
if(pointer_type.subtype().id() == ID_symbol_type)
26152615
{
26162616
needed_lazy_methods->add_needed_class(
26172617
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_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
@@ -1201,7 +1201,7 @@ void java_object_factoryt::gen_nondet_init(
12011201
if(is_sub)
12021202
{
12031203
const typet &symbol = override_ ? override_type : expr.type();
1204-
PRECONDITION(symbol.id() == ID_symbol);
1204+
PRECONDITION(symbol.id() == ID_symbol_type);
12051205
generic_parameter_specialization_map_keys.insert_pairs_for_symbol(
12061206
to_symbol_type(symbol), struct_type);
12071207
}
@@ -1305,7 +1305,7 @@ void java_object_factoryt::gen_nondet_array_init(
13051305
update_in_placet update_in_place)
13061306
{
13071307
PRECONDITION(expr.type().id()==ID_pointer);
1308-
PRECONDITION(expr.type().subtype().id()==ID_symbol);
1308+
PRECONDITION(expr.type().subtype().id()==ID_symbol_type);
13091309
PRECONDITION(update_in_place!=update_in_placet::MAY_UPDATE_IN_PLACE);
13101310

13111311
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()));
@@ -393,11 +393,11 @@ java_string_library_preprocesst::process_equals_function_operands(
393393
/// \return type of the "data" component
394394
static typet get_data_type(const typet &type, const symbol_tablet &symbol_table)
395395
{
396-
PRECONDITION(type.id()==ID_struct || type.id()==ID_symbol);
397-
if(type.id()==ID_symbol)
396+
PRECONDITION(type.id()==ID_struct || type.id()==ID_symbol_type);
397+
if(type.id()==ID_symbol_type)
398398
{
399399
symbolt sym=*symbol_table.lookup(to_symbol_type(type).get_identifier());
400-
CHECK_RETURN(sym.type.id()!=ID_symbol);
400+
CHECK_RETURN(sym.type.id()!=ID_symbol_type);
401401
return get_data_type(sym.type, symbol_table);
402402
}
403403
// else type id is ID_struct
@@ -412,11 +412,11 @@ static typet get_data_type(const typet &type, const symbol_tablet &symbol_table)
412412
static typet
413413
get_length_type(const typet &type, const symbol_tablet &symbol_table)
414414
{
415-
PRECONDITION(type.id()==ID_struct || type.id()==ID_symbol);
416-
if(type.id()==ID_symbol)
415+
PRECONDITION(type.id()==ID_struct || type.id()==ID_symbol_type);
416+
if(type.id()==ID_symbol_type)
417417
{
418418
symbolt sym=*symbol_table.lookup(to_symbol_type(type).get_identifier());
419-
CHECK_RETURN(sym.type.id()!=ID_symbol);
419+
CHECK_RETURN(sym.type.id()!=ID_symbol_type);
420420
return get_length_type(sym.type, symbol_table);
421421
}
422422
// else type id is ID_struct
@@ -891,7 +891,7 @@ void java_string_library_preprocesst::code_assign_java_string_to_string_expr(
891891
PRECONDITION(implements_java_char_sequence_pointer(rhs.type()));
892892

893893
typet deref_type;
894-
if(rhs.type().subtype().id()==ID_symbol)
894+
if(rhs.type().subtype().id()==ID_symbol_type)
895895
deref_type=symbol_table.lookup_ref(
896896
to_symbol_type(rhs.type().subtype()).get_identifier()).type;
897897
else

jbmc/src/java_bytecode/java_types.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ bool equal_java_types(const typet &type1, const typet &type2)
735735
bool arrays_with_same_element_type = true;
736736
if(
737737
type1.id() == ID_pointer && type2.id() == ID_pointer &&
738-
type1.subtype().id() == ID_symbol && type2.subtype().id() == ID_symbol)
738+
type1.subtype().id() == ID_symbol_type && type2.subtype().id() == ID_symbol_type)
739739
{
740740
const symbol_typet &subtype_symbol1 = to_symbol_type(type1.subtype());
741741
const symbol_typet &subtype_symbol2 = to_symbol_type(type2.subtype());
@@ -782,7 +782,7 @@ void get_dependencies_from_generic_parameters_rec(
782782
}
783783

784784
// symbol type
785-
else if(t.id() == ID_symbol)
785+
else if(t.id() == ID_symbol_type)
786786
{
787787
const symbol_typet &symbol_type = to_symbol_type(t);
788788
const irep_idt class_name(symbol_type.get_identifier());
@@ -916,7 +916,7 @@ std::string pretty_java_type(const typet &type)
916916
return "byte";
917917
else if(is_reference(type))
918918
{
919-
if(type.subtype().id() == ID_symbol)
919+
if(type.subtype().id() == ID_symbol_type)
920920
{
921921
const auto &symbol_type = to_symbol_type(type.subtype());
922922
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
@@ -80,7 +80,7 @@ std::size_t remove_instanceoft::lower_instanceof(
8080

8181
// Find all types we know about that satisfy the given requirement:
8282
INVARIANT(
83-
target_type.id()==ID_symbol,
83+
target_type.id()==ID_symbol_type,
8484
"instanceof second operand should have a simple type");
8585
const irep_idt &target_name=
8686
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());

src/analyses/invariant_propagation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ bool invariant_propagationt::check_type(const typet &type) const
189189
return false;
190190
else if(type.id()==ID_array)
191191
return false;
192-
else if(type.id()==ID_symbol)
192+
else if(type.id()==ID_symbol_type)
193193
return check_type(ns.follow(type));
194194
else if(type.id()==ID_unsignedbv ||
195195
type.id()==ID_signedbv)

0 commit comments

Comments
 (0)