@@ -158,14 +158,14 @@ static simplify_exprt::resultt<> simplify_string_endswith(
158
158
const namespacet &ns)
159
159
{
160
160
const refined_string_exprt &s1 = to_string_expr (expr.arguments ().at (0 ));
161
- const auto s1_data_opt = try_get_string_data_array (s1, ns);
161
+ const auto s1_data_opt = try_get_string_data_array (s1. content () , ns);
162
162
163
163
if (!s1_data_opt)
164
164
return simplify_exprt::unchanged (expr);
165
165
166
166
const array_exprt &s1_data = s1_data_opt->get ();
167
167
const refined_string_exprt &s2 = to_string_expr (expr.arguments ().at (1 ));
168
- const auto s2_data_opt = try_get_string_data_array (s2, ns);
168
+ const auto s2_data_opt = try_get_string_data_array (s2. content () , ns);
169
169
170
170
if (!s2_data_opt)
171
171
return simplify_exprt::unchanged (expr);
@@ -214,13 +214,13 @@ static simplify_exprt::resultt<> simplify_string_compare_to(
214
214
const namespacet &ns)
215
215
{
216
216
const refined_string_exprt &s1 = to_string_expr (expr.arguments ().at (0 ));
217
- const auto s1_data_opt = try_get_string_data_array (s1, ns);
217
+ const auto s1_data_opt = try_get_string_data_array (s1. content () , ns);
218
218
219
219
if (!s1_data_opt)
220
220
return simplify_exprt::unchanged (expr);
221
221
222
222
const refined_string_exprt &s2 = to_string_expr (expr.arguments ().at (1 ));
223
- const auto s2_data_opt = try_get_string_data_array (s2, ns);
223
+ const auto s2_data_opt = try_get_string_data_array (s2. content () , ns);
224
224
225
225
if (!s2_data_opt)
226
226
return simplify_exprt::unchanged (expr);
@@ -285,7 +285,7 @@ static simplify_exprt::resultt<> simplify_string_index_of(
285
285
286
286
const refined_string_exprt &s1 = to_string_expr (expr.arguments ().at (0 ));
287
287
288
- const auto s1_data_opt = try_get_string_data_array (s1, ns);
288
+ const auto s1_data_opt = try_get_string_data_array (s1. content () , ns);
289
289
290
290
if (!s1_data_opt)
291
291
{
@@ -310,7 +310,7 @@ static simplify_exprt::resultt<> simplify_string_index_of(
310
310
const refined_string_exprt &s2 =
311
311
to_string_expr (expr.arguments ().at (1 ));
312
312
313
- const auto s2_data_opt = try_get_string_data_array (s2, ns);
313
+ const auto s2_data_opt = try_get_string_data_array (s2. content () , ns);
314
314
315
315
if (!s2_data_opt)
316
316
{
@@ -379,7 +379,7 @@ static simplify_exprt::resultt<> simplify_string_char_at(
379
379
380
380
const refined_string_exprt &s = to_string_expr (expr.arguments ().at (0 ));
381
381
382
- const auto char_seq_opt = try_get_string_data_array (s, ns);
382
+ const auto char_seq_opt = try_get_string_data_array (s. content () , ns);
383
383
384
384
if (!char_seq_opt)
385
385
{
@@ -420,7 +420,8 @@ static simplify_exprt::resultt<> simplify_string_startswith(
420
420
auto &first_argument = to_string_expr (expr.arguments ().at (0 ));
421
421
auto &second_argument = to_string_expr (expr.arguments ().at (1 ));
422
422
423
- const auto first_value_opt = try_get_string_data_array (first_argument, ns);
423
+ const auto first_value_opt =
424
+ try_get_string_data_array (first_argument.content (), ns);
424
425
425
426
if (!first_value_opt)
426
427
{
@@ -429,7 +430,8 @@ static simplify_exprt::resultt<> simplify_string_startswith(
429
430
430
431
const array_exprt &first_value = first_value_opt->get ();
431
432
432
- const auto second_value_opt = try_get_string_data_array (second_argument, ns);
433
+ const auto second_value_opt =
434
+ try_get_string_data_array (second_argument.content (), ns);
433
435
434
436
if (!second_value_opt)
435
437
{
@@ -1666,21 +1668,21 @@ optionalt<std::string> simplify_exprt::expr2bits(
1666
1668
}
1667
1669
1668
1670
optionalt<std::reference_wrapper<const array_exprt>>
1669
- try_get_string_data_array (const refined_string_exprt &s , const namespacet &ns)
1671
+ try_get_string_data_array (const exprt &content , const namespacet &ns)
1670
1672
{
1671
- if (s. content () .id () != ID_address_of)
1673
+ if (content.id () != ID_address_of)
1672
1674
{
1673
1675
return {};
1674
1676
}
1675
1677
1676
- const auto &content = to_address_of_expr (s. content () );
1678
+ const auto &array_pointer = to_address_of_expr (content);
1677
1679
1678
- if (content .object ().id () != ID_index)
1680
+ if (array_pointer .object ().id () != ID_index)
1679
1681
{
1680
1682
return {};
1681
1683
}
1682
1684
1683
- const auto &array_start = to_index_expr (content .object ());
1685
+ const auto &array_start = to_index_expr (array_pointer .object ());
1684
1686
1685
1687
if (array_start.array ().id () != ID_symbol ||
1686
1688
array_start.array ().type ().id () != ID_array)
0 commit comments