From 86606d2ab731a4b8dbbe1e5318a1920210abd65d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 18 Jun 2021 11:18:10 -0400 Subject: analyzer: refactor custom_event, introducing precanned_custom_event class I have followup work where a custom event's description would be better handled via a vfunc rather that a precanned string, hence this refactoring to make it easy to add custom_event subclasses. gcc/analyzer/ChangeLog: * checker-path.cc (class custom_event): Make abstract to allow for custom vfuncs, splitting existing implementation into... (class precanned_custom_event): New subclass. (custom_event::get_desc): Move to... (precanned_custom_event::get_desc): ...subclass. * checker-path.h (class custom_event): Make abstract to allow for custom vfuncs, splitting existing implementation into... (class precanned_custom_event): New subclass. * diagnostic-manager.cc (diagnostic_manager::add_events_for_eedge): Use precanned_custom_event. * engine.cc (stale_jmp_buf::maybe_add_custom_events_for_superedge): Likewise. * sm-signal.cc (signal_delivery_edge_info_t::add_events_to_path): Likewise. Signed-off-by: David Malcolm --- gcc/analyzer/sm-signal.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/analyzer/sm-signal.cc') diff --git a/gcc/analyzer/sm-signal.cc b/gcc/analyzer/sm-signal.cc index d7e7e7c..42be809 100644 --- a/gcc/analyzer/sm-signal.cc +++ b/gcc/analyzer/sm-signal.cc @@ -238,9 +238,10 @@ public: FINAL OVERRIDE { emission_path->add_event - (new custom_event (UNKNOWN_LOCATION, NULL_TREE, 0, - "later on," - " when the signal is delivered to the process")); + (new precanned_custom_event + (UNKNOWN_LOCATION, NULL_TREE, 0, + "later on," + " when the signal is delivered to the process")); } }; -- cgit v1.1