@@ -467,7 +467,7 @@ class ai_baset
467
467
working_sett &working_set,
468
468
const goto_programt &callee,
469
469
const goto_functionst &goto_functions,
470
- const namespacet &ns);
470
+ const namespacet &ns) = 0 ;
471
471
472
472
// / For creating history objects
473
473
std::unique_ptr<ai_history_factory_baset> history_factory;
@@ -503,6 +503,41 @@ class ai_baset
503
503
message_handlert &message_handler;
504
504
};
505
505
506
+ // Perform function local analysis on all functions in a program.
507
+ // No interprocedural analysis other than what a domain does when
508
+ // visit()'ing an edge that skips a function call.
509
+ class ai_localt : public ai_baset
510
+ {
511
+ public:
512
+ ai_localt (
513
+ std::unique_ptr<ai_history_factory_baset> &&hf,
514
+ std::unique_ptr<ai_domain_factory_baset> &&df,
515
+ std::unique_ptr<ai_storage_baset> &&st,
516
+ message_handlert &mh)
517
+ : ai_baset(std::move(hf), std::move(df), std::move(st), mh)
518
+ {
519
+ }
520
+
521
+ // Handle every function independently
522
+ void operator ()(const goto_functionst &goto_functions, const namespacet &ns)
523
+ override ;
524
+ void operator ()(const abstract_goto_modelt &goto_model) override ;
525
+
526
+ protected:
527
+ // Implement the function that handles a single function call edge
528
+ // using a single edge that gets the domain to approximate the whole
529
+ // function call
530
+ bool visit_edge_function_call (
531
+ const irep_idt &calling_function_id,
532
+ trace_ptrt p_call,
533
+ locationt l_return,
534
+ const irep_idt &callee_function_id,
535
+ working_sett &working_set,
536
+ const goto_programt &callee,
537
+ const goto_functionst &goto_functions,
538
+ const namespacet &ns) override ;
539
+ };
540
+
506
541
// Perform interprocedural analysis by simply recursing in the interpreter
507
542
// This can lead to a call stack overflow if the domain has a large height
508
543
class ai_recursive_interproceduralt : public ai_baset
@@ -523,7 +558,8 @@ class ai_recursive_interproceduralt : public ai_baset
523
558
void operator ()(const abstract_goto_modelt &goto_model) override ;
524
559
525
560
protected:
526
- // Override the function that handles a single function call edge
561
+ // Implement the function that handles a single function call edge
562
+ // by a recursive call to fixpoint
527
563
bool visit_edge_function_call (
528
564
const irep_idt &calling_function_id,
529
565
trace_ptrt p_call,
0 commit comments