GCC Middle and Back End API Reference
diagnostics::paths::lazy_path Class Referenceabstract

#include <lazy-paths.h>

Inheritance diagram for diagnostics::paths::lazy_path:
Collaboration diagram for diagnostics::paths::lazy_path:

Public Member Functions

virtual ~lazy_path ()
unsigned num_events () const final override
const eventget_event (int idx) const final override
unsigned num_threads () const final override
const threadget_thread (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
const logical_locations::managerget_logical_location_manager () const

Protected Member Functions

 lazy_path (const logical_locations::manager &logical_loc_mgr)

Private Member Functions

void lazily_generate_path () const
virtual std::unique_ptr< pathmake_inner_path () const =0
bool get_first_event_in_a_function (unsigned *out_idx) const

Private Attributes

std::unique_ptr< pathm_inner_path
const logical_locations::managerm_logical_loc_mgr

Detailed Description

An implementation of diagnostics::paths::path which has a trivial ctor
and lazily creates another 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.   

Constructor & Destructor Documentation

◆ ~lazy_path()

virtual diagnostics::paths::lazy_path::~lazy_path ( )
inlinevirtual

◆ lazy_path()

diagnostics::paths::lazy_path::lazy_path ( const logical_locations::manager & logical_loc_mgr)
inlineprotected

Member Function Documentation

◆ generated_p()

bool diagnostics::paths::lazy_path::generated_p ( ) const
inline

References generated_p(), and m_inner_path.

Referenced by generated_p().

◆ get_event()

const event & lazy_path::get_event ( int idx) const
finaloverridevirtual

◆ get_first_event_in_a_function()

bool path::get_first_event_in_a_function ( unsigned * out_idx) const
privateinherited
class diagnostics::paths::path.   
Subroutine of 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 get_event(), diagnostics::paths::event::get_logical_location(), i, m_logical_loc_mgr, and num_events().

Referenced by interprocedural_p().

◆ get_logical_location_manager()

const logical_locations::manager & diagnostics::paths::path::get_logical_location_manager ( ) const
inlineinherited

◆ get_thread()

const thread & lazy_path::get_thread ( thread_id_t idx) const
finaloverridevirtual

◆ interprocedural_p()

bool path::interprocedural_p ( ) const
inherited
Return true if the events in this path involve more than one
function, or false if it is purely intraprocedural.   

References get_event(), get_first_event_in_a_function(), diagnostics::paths::event::get_stack_depth(), i, num_events(), and same_function_p().

◆ lazily_generate_path()

void lazy_path::lazily_generate_path ( ) const
private

◆ make_inner_path()

virtual std::unique_ptr< path > diagnostics::paths::lazy_path::make_inner_path ( ) const
privatepure virtual

Implemented in lazy_diagnostic_context_path.

Referenced by lazily_generate_path().

◆ multithreaded_p()

bool diagnostics::paths::path::multithreaded_p ( ) const
inherited

◆ num_events()

unsigned lazy_path::num_events ( ) const
finaloverridevirtual
class lazy_path : public path.   
Implementation of path vfuncs in terms of a lazily-generated
path.   

Implements diagnostics::paths::path.

References lazily_generate_path(), and m_inner_path.

◆ num_threads()

unsigned lazy_path::num_threads ( ) const
finaloverridevirtual

◆ same_function_p()

bool lazy_path::same_function_p ( int event_idx_a,
int event_idx_b ) const
finaloverridevirtual

Field Documentation

◆ m_inner_path

std::unique_ptr<path> diagnostics::paths::lazy_path::m_inner_path
mutableprivate

◆ m_logical_loc_mgr

const logical_locations::manager& diagnostics::paths::path::m_logical_loc_mgr
privateinherited

The documentation for this class was generated from the following files: