File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -120,15 +120,24 @@ reference_typet java_array_type(const char subtype)
120
120
return java_reference_type (symbol_type);
121
121
}
122
122
123
- // / Return the type of the elements of a given java array type
124
- // / \param array_type The java array type
125
- // / \return The type of the elements of the array
126
- typet java_array_element_type (const symbol_typet &array_type)
123
+ // / Return a const reference to the element type of a given java array type
124
+ // / \param array_symbol The java array type
125
+ const typet &java_array_element_type (const symbol_typet &array_symbol)
127
126
{
128
127
INVARIANT (
129
- is_java_array_tag (array_type .get_identifier ()),
128
+ is_java_array_tag (array_symbol .get_identifier ()),
130
129
" Symbol should have array tag" );
131
- return array_type.find_type (ID_C_element_type);
130
+ return array_symbol.find_type (ID_C_element_type);
131
+ }
132
+
133
+ // / Return a non-const reference to the element type of a given java array type
134
+ // / \param array_symbol The java array type
135
+ typet &java_array_element_type (symbol_typet &array_symbol)
136
+ {
137
+ INVARIANT (
138
+ is_java_array_tag (array_symbol.get_identifier ()),
139
+ " Symbol should have array tag" );
140
+ return const_cast <typet &>(array_symbol.find_type (ID_C_element_type));
132
141
}
133
142
134
143
// / See above
Original file line number Diff line number Diff line change @@ -235,7 +235,8 @@ reference_typet java_lang_object_type();
235
235
symbol_typet java_classname (const std::string &);
236
236
237
237
reference_typet java_array_type (const char subtype);
238
- typet java_array_element_type (const symbol_typet &array_type);
238
+ const typet &java_array_element_type (const symbol_typet &array_symbol);
239
+ typet &java_array_element_type (symbol_typet &array_symbol);
239
240
240
241
bool is_reference_type (char t);
241
242
You can’t perform that action at this time.
0 commit comments