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 @@ -436,12 +436,30 @@ void string_dependenciest::add_dependency(
436
436
const array_string_exprt &e,
437
437
const builtin_function_nodet &builtin_function_node)
438
438
{
439
+ if (e.id () == ID_if)
440
+ {
441
+ const auto if_expr = to_if_expr (e);
442
+ const auto &true_case = to_array_string_expr (if_expr.true_case ());
443
+ const auto &false_case = to_array_string_expr (if_expr.false_case ());
444
+ add_dependency (true_case, builtin_function_node);
445
+ add_dependency (false_case, builtin_function_node);
446
+ return ;
447
+ }
439
448
string_nodet &string_node = get_node (e);
440
449
string_node.dependencies .push_back (builtin_function_node);
441
450
}
442
451
443
452
void string_dependenciest::add_unknown_dependency (const array_string_exprt &e)
444
453
{
454
+ if (e.id () == ID_if)
455
+ {
456
+ const auto if_expr = to_if_expr (e);
457
+ const auto &true_case = to_array_string_expr (if_expr.true_case ());
458
+ const auto &false_case = to_array_string_expr (if_expr.false_case ());
459
+ add_unknown_dependency (true_case);
460
+ add_unknown_dependency (false_case);
461
+ return ;
462
+ }
445
463
string_nodet &string_node = get_node (e);
446
464
string_node.depends_on_unknown_builtin_function = true ;
447
465
}
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