GCC Middle and Back End API Reference
|
#include <lazy-diagnostic-path.h>
Public Member Functions | |
virtual | ~lazy_diagnostic_path () |
unsigned | num_events () const final override |
const diagnostic_event & | get_event (int idx) const final override |
unsigned | num_threads () const final override |
const diagnostic_thread & | get_thread (diagnostic_thread_id_t) const final override |
bool | same_function_p (int event_idx_a, int event_idx_b) const final override |
bool | generated_p () const |
bool | interprocedural_p () const |
bool | multithreaded_p () const |
Private Member Functions | |
void | lazily_generate_path () const |
virtual std::unique_ptr< diagnostic_path > | make_inner_path () const =0 |
bool | get_first_event_in_a_function (unsigned *out_idx) const |
Private Attributes | |
std::unique_ptr< diagnostic_path > | m_inner_path |
Helper class for deferring path creation until a diagnostic is emitted. Copyright (C) 2024 Free Software Foundation, Inc. Contributed by David Malcolm <dmalcolm@redhat.com> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
An implementation of diagnostic_path which has a trivial ctor and lazily creates another diagnostic_path the first time the path is queried, deferring to this inner path for all queries. Use this to avoid expensive path creation logic when creating rich_location instances, so that expense can be deferred until the path is actually used by a diagnostic, and thus avoided for warnings that are disabled.
|
inlinevirtual |
|
inline |
References m_inner_path.
|
finaloverridevirtual |
Implements diagnostic_path.
References lazily_generate_path(), and m_inner_path.
|
privateinherited |
class diagnostic_path.
Subroutine of diagnostic_path::interprocedural_p. Look for the first event in this path that is within a function i.e. has a non-null logical location for which function_p is true. If found, write its index to *OUT_IDX and return true. Otherwise return false.
References i.
|
finaloverridevirtual |
Implements diagnostic_path.
References lazily_generate_path(), and m_inner_path.
|
inherited |
Return true if the events in this path involve more than one function, or false if it is purely intraprocedural.
References diagnostic_event::get_stack_depth(), and i.
|
private |
References gcc_assert, m_inner_path, and make_inner_path().
Referenced by get_event(), get_thread(), num_events(), num_threads(), and same_function_p().
|
privatepure virtual |
Referenced by lazily_generate_path().
|
inherited |
|
finaloverridevirtual |
class lazy_diagnostic_path : public diagnostic_path.
Implementation of diagnostic_path vfuncs in terms of a lazily-generated path.
Implements diagnostic_path.
References lazily_generate_path(), and m_inner_path.
|
finaloverridevirtual |
Implements diagnostic_path.
References lazily_generate_path(), and m_inner_path.
|
finaloverridevirtual |
Implements diagnostic_path.
References lazily_generate_path(), and m_inner_path.
|
mutableprivate |
Referenced by generated_p(), get_event(), get_thread(), lazily_generate_path(), num_events(), num_threads(), and same_function_p().