Skip to content

Commit 599ae2c

Browse files
author
Daniel Kroening
committed
type symbols now use ID_symbol_type
1 parent 6e554d9 commit 599ae2c

Some content is hidden

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

61 files changed

+157
-162
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
@@ -1631,7 +1631,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
16311631
const typecast_exprt pointer(op[0], java_array_type(statement[0]));
16321632

16331633
dereference_exprt array(pointer, pointer.type().subtype());
1634-
assert(pointer.type().subtype().id()==ID_symbol);
1634+
assert(pointer.type().subtype().id() == ID_symbol_type);
16351635
array.set(ID_java_member_access, true);
16361636

16371637
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_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
@@ -735,7 +735,8 @@ 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 &&
739+
type2.subtype().id() == ID_symbol_type)
739740
{
740741
const symbol_typet &subtype_symbol1 = to_symbol_type(type1.subtype());
741742
const symbol_typet &subtype_symbol2 = to_symbol_type(type2.subtype());
@@ -782,7 +783,7 @@ void get_dependencies_from_generic_parameters_rec(
782783
}
783784

784785
// symbol type
785-
else if(t.id() == ID_symbol)
786+
else if(t.id() == ID_symbol_type)
786787
{
787788
const symbol_typet &symbol_type = to_symbol_type(t);
788789
const irep_idt class_name(symbol_type.get_identifier());
@@ -916,7 +917,7 @@ std::string pretty_java_type(const typet &type)
916917
return "byte";
917918
else if(is_reference(type))
918919
{
919-
if(type.subtype().id() == ID_symbol)
920+
if(type.subtype().id() == ID_symbol_type)
920921
{
921922
const auto &symbol_type = to_symbol_type(type.subtype());
922923
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());

jbmc/unit/java-testing-utils/require_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ require_type::require_complete_java_non_generic_class(const typet &class_type)
425425
const symbol_typet &
426426
require_type::require_symbol(const typet &type, const irep_idt &identifier)
427427
{
428-
REQUIRE(type.id() == ID_symbol);
428+
REQUIRE(type.id() == ID_symbol_type);
429429
const symbol_typet &result = to_symbol_type(type);
430430
if(identifier != "")
431431
{

0 commit comments

Comments
 (0)