GCC Middle and Back End API Reference
lazy_diagnostic_context_path Class Reference

#include <diagnostic-context-rich-location.h>

Inheritance diagram for lazy_diagnostic_context_path:
Collaboration diagram for lazy_diagnostic_context_path:

Public Member Functions

 lazy_diagnostic_context_path (const tree_logical_location_manager &logical_loc_mgr, location_t location, gimple *stmt)
std::unique_ptr< diagnostics::paths::pathmake_inner_path () const final override
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::manager & get_logical_location_manager () const

Data Fields

const tree_logical_location_managerm_logical_loc_mgr
location_t m_location
gimplem_stmt

Private Member Functions

void lazily_generate_path () const
bool get_first_event_in_a_function (unsigned *out_idx) const

Private Attributes

std::unique_ptr< pathm_inner_path

Detailed Description

A rich_location subclass that lazily populates a diagnostic_path
   with diagnostic context events, but only if the path is actually to be
   used.
   Copyright (C) 2025 Free Software Foundation, Inc.
   Contributed by Qing Zhao<qing.zhao@oracle.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/>.   

Constructor & Destructor Documentation

◆ lazy_diagnostic_context_path()

lazy_diagnostic_context_path::lazy_diagnostic_context_path ( const tree_logical_location_manager & logical_loc_mgr,
location_t location,
gimple * stmt )
inline

Member Function Documentation

◆ generated_p()

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

References generated_p(), and m_inner_path.

Referenced by generated_p().

◆ get_event()

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

◆ 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
finaloverridevirtualinherited

◆ 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
privateinherited

◆ make_inner_path()

std::unique_ptr< diagnostics::paths::path > lazy_diagnostic_context_path::make_inner_path ( ) const
finaloverridevirtual

◆ multithreaded_p()

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

◆ num_events()

unsigned lazy_path::num_events ( ) const
finaloverridevirtualinherited
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
finaloverridevirtualinherited

◆ same_function_p()

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

Field Documentation

◆ m_inner_path

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

◆ m_location

location_t lazy_diagnostic_context_path::m_location

◆ m_logical_loc_mgr

const tree_logical_location_manager& lazy_diagnostic_context_path::m_logical_loc_mgr

◆ m_stmt

gimple* lazy_diagnostic_context_path::m_stmt

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