File tree 4 files changed +20
-5
lines changed
4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ void java_bytecode_convert_classt::convert(
393
393
new_symbol.base_name = base_name;
394
394
new_symbol.pretty_name =c.name ;
395
395
new_symbol.name =qualified_classname;
396
- class_type.set (ID_name, new_symbol.name );
396
+ class_type.set_name ( new_symbol.name );
397
397
new_symbol.type =class_type;
398
398
new_symbol.mode =ID_java;
399
399
new_symbol.is_type =true ;
@@ -716,15 +716,15 @@ void java_bytecode_convert_classt::add_array_types(symbol_tablet &symbol_table)
716
716
if (symbol_table.has_symbol (symbol_type_identifier))
717
717
return ;
718
718
719
- class_typet class_type;
719
+ java_class_typet class_type;
720
720
// we have the base class, java.lang.Object, length and data
721
721
// of appropriate type
722
722
class_type.set_tag (symbol_type_identifier);
723
723
// Note that non-array types don't have "java::" at the beginning of their
724
724
// tag, and their name is "java::" + their tag. Since arrays do have
725
725
// "java::" at the beginning of their tag we set the name to be the same as
726
726
// the tag.
727
- class_type.set (ID_name, symbol_type_identifier);
727
+ class_type.set_name ( symbol_type_identifier);
728
728
729
729
class_type.components ().reserve (3 );
730
730
class_typet::componentt base_class_component (
Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ void java_string_library_preprocesst::add_string_type(
222
222
{
223
223
java_class_typet string_type;
224
224
string_type.set_tag (class_name);
225
+ string_type.set_name (" java::" + id2string (class_name));
225
226
string_type.components ().resize (3 );
226
227
string_type.components ()[0 ].set_name (" @java.lang.Object" );
227
228
string_type.components ()[0 ].set_pretty_name (" @java.lang.Object" );
Original file line number Diff line number Diff line change @@ -158,6 +158,20 @@ class java_class_typet:public class_typet
158
158
return type_checked_cast<annotated_typet>(
159
159
static_cast <typet &>(*this )).get_annotations ();
160
160
}
161
+
162
+ // / Get the name of the struct, which can be used to look up its symbol
163
+ // / in the symbol table.
164
+ const irep_idt &get_name () const
165
+ {
166
+ return get (ID_name);
167
+ }
168
+
169
+ // / Set the name of the struct, which can be used to look up its symbol
170
+ // / in the symbol table.
171
+ void set_name (const irep_idt &name)
172
+ {
173
+ set (ID_name, name);
174
+ }
161
175
};
162
176
163
177
inline const java_class_typet &to_java_class_type (const typet &type)
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ void generate_class_stub(
67
67
message_handlert &message_handler,
68
68
const struct_union_typet::componentst &componentst)
69
69
{
70
- class_typet class_type;
70
+ java_class_typet class_type;
71
71
72
72
class_type.set_tag (class_name);
73
73
class_type.set (ID_base_name, class_name);
@@ -79,7 +79,7 @@ void generate_class_stub(
79
79
new_symbol.base_name =class_name;
80
80
new_symbol.pretty_name =class_name;
81
81
new_symbol.name =" java::" +id2string (class_name);
82
- class_type.set (ID_name, new_symbol.name );
82
+ class_type.set_name ( new_symbol.name );
83
83
new_symbol.type =class_type;
84
84
new_symbol.mode =ID_java;
85
85
new_symbol.is_type =true ;
You can’t perform that action at this time.
0 commit comments