GCC Middle and Back End API Reference
logical_location_manager Class Referenceabstract

#include <logical-location.h>

Inheritance diagram for logical_location_manager:

Data Structures

class  key

Public Member Functions

virtual ~logical_location_manager ()
virtual const char * get_short_name (key k) const =0
virtual const char * get_name_with_scope (key k) const =0
virtual const char * get_internal_name (key k) const =0
virtual enum logical_location_kind get_kind (key k) const =0
virtual label_text get_name_for_path_output (key k) const =0
virtual key get_parent (key k) const =0
bool function_p (key k) const

Detailed Description

We want to efficiently support passing around logical locations in the
diagnostics subsystem, such as:
- "within function 'foo'", or
- "within method 'bar'"

However we want to do this *without* requiring knowledge of trees (or of
libgdiagnostics internals), and without requiring heap allocation of an
interface class when emitting a diagnostic.

To do this, we split the implementation into logical_location, which is
a wrapper around a (const void *), and logical_location_manager which
is provided by the client and has vfunc hooks for interpreting
logical_location instances.

Every logical_location is associated with a logical_location_manager and
only has meaning in relation to that manager.

A "nullptr" within a logical_location means "no logical location".

See tree-logical-location.h for concrete subclasses relating to trees,
where the pointer is a const_tree.

See selftest-logical-location.h for a concrete subclass for selftests.   
Abstract base class for giving meaning to logical_location values.
Typically there will just be one client-provided instance, of a
client-specific subclass.   

Constructor & Destructor Documentation

◆ ~logical_location_manager()

virtual logical_location_manager::~logical_location_manager ( )
inlinevirtual

Member Function Documentation

◆ function_p()

bool logical_location_manager::function_p ( key k) const
class logical_location_manager.   
Return true iff this is a function or method.   

References function, gcc_unreachable, get_kind(), member, module_, namespace_, parameter, return_type, type, unknown, and variable.

◆ get_internal_name()

virtual const char * logical_location_manager::get_internal_name ( key k) const
pure virtual

◆ get_kind()

virtual enum logical_location_kind logical_location_manager::get_kind ( key k) const
pure virtual

◆ get_name_for_path_output()

virtual label_text logical_location_manager::get_name_for_path_output ( key k) const
pure virtual

◆ get_name_with_scope()

virtual const char * logical_location_manager::get_name_with_scope ( key k) const
pure virtual

◆ get_parent()

virtual key logical_location_manager::get_parent ( key k) const
pure virtual

◆ get_short_name()

virtual const char * logical_location_manager::get_short_name ( key k) const
pure virtual

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