File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -434,12 +434,30 @@ void string_dependenciest::add_dependency(
434
434
const array_string_exprt &e,
435
435
const builtin_function_nodet &builtin_function_node)
436
436
{
437
+ if (e.id () == ID_if)
438
+ {
439
+ const auto if_expr = to_if_expr (e);
440
+ const auto &true_case = to_array_string_expr (if_expr.true_case ());
441
+ const auto &false_case = to_array_string_expr (if_expr.false_case ());
442
+ add_dependency (true_case, builtin_function_node);
443
+ add_dependency (false_case, builtin_function_node);
444
+ return ;
445
+ }
437
446
string_nodet &string_node = get_node (e);
438
447
string_node.dependencies .push_back (builtin_function_node);
439
448
}
440
449
441
450
void string_dependenciest::add_unknown_dependency (const array_string_exprt &e)
442
451
{
452
+ if (e.id () == ID_if)
453
+ {
454
+ const auto if_expr = to_if_expr (e);
455
+ const auto &true_case = to_array_string_expr (if_expr.true_case ());
456
+ const auto &false_case = to_array_string_expr (if_expr.false_case ());
457
+ add_unknown_dependency (true_case);
458
+ add_unknown_dependency (false_case);
459
+ return ;
460
+ }
443
461
string_nodet &string_node = get_node (e);
444
462
string_node.depends_on_unknown_builtin_function = true ;
445
463
}
Original file line number Diff line number Diff line change @@ -343,7 +343,9 @@ class string_dependenciest
343
343
const string_builtin_functiont &
344
344
get_builtin_function (const builtin_function_nodet &node) const ;
345
345
346
- // / Add edge from node for `e` to node for `builtin_function`
346
+ // / Add edge from node for `e` to node for `builtin_function` if `e` is a
347
+ // / simple array expression. If it is an `if_exprt` we add the sub-expressions
348
+ // / that are not `if_exprt`s instead.
347
349
void add_dependency (
348
350
const array_string_exprt &e,
349
351
const builtin_function_nodet &builtin_function);
You can’t perform that action at this time.
0 commit comments