analyzer: : Refactor callstring to work with pairs of supernodes.
authorAnkur Saini <arsenic@sourceware.org>
Sun, 25 Jul 2021 09:17:53 +0000 (14:47 +0530)
committerAnkur Saini <arsenic@sourceware.org>
Thu, 29 Jul 2021 03:07:49 +0000 (08:37 +0530)
commite8de5bad250909c9599da49d07f09fb9a8cabd0f
treed48f853a61c2594bb22af5bb39a55a41f7be42b0
parent7d11da87a1e3c7e0d274788ca43519513dae4bfe
analyzer: : Refactor callstring to work with pairs of supernodes.

2021-07-25  Ankur Saini  <arsenic@sourceware.org>

gcc/analyzer/ChangeLog:
* call-string.cc (call_string::element_t::operator==): New operator.
(call_String::element_t::operator!=): New operator.
(call_string::element_t::get_caller_function): New function.
(call_string::element_t::get_callee_function): New function.
(call_string::call_string): Refactor to Initialise m_elements.
(call_string::operator=): Refactor to work with m_elements.
(call_string::operator==): Likewise.
(call_string::to_json): Likewise.
(call_string::hash): Refactor to hash e.m_caller.
(call_string::push_call): Refactor to work with m_elements.
(call_string::push_call): New overload to push call via supernodes.
(call_string::pop): Refactor to work with m_elements.
(call_string::calc_recursion_depth): Likewise.
(call_string::cmp): Likewise.
(call_string::validate): Likewise.
(call_string::operator[]): Likewise.
* call-string.h (class supernode): New forward decl.
(struct call_string::element_t): New struct.
(call_string::call_string): Refactor to initialise m_elements.
(call_string::bool empty_p): Refactor to work with m_elements.
(call_string::get_callee_node): New decl.
(call_string::get_caller_node): New decl.
(m_elements): Replaces m_return_edges.
* program-point.cc (program_point::get_function_at_depth): Refactor to
work with new call-string format.
(program_point::validate): Likewise.
(program_point::on_edge): Likewise.
gcc/analyzer/call-string.cc
gcc/analyzer/call-string.h
gcc/analyzer/program-point.cc