GCC Middle and Back End API Reference
simple_diagnostic_event Class Reference

#include <simple-diagnostic-path.h>

Inheritance diagram for simple_diagnostic_event:
Collaboration diagram for simple_diagnostic_event:

Public Types

enum  verb {
  VERB_unknown , VERB_acquire , VERB_release , VERB_enter ,
  VERB_exit , VERB_call , VERB_return , VERB_branch ,
  VERB_danger
}
 
enum  noun {
  NOUN_unknown , NOUN_taint , NOUN_sensitive , NOUN_function ,
  NOUN_lock , NOUN_memory , NOUN_resource
}
 
enum  property { PROPERTY_unknown , PROPERTY_true , PROPERTY_false }
 

Public Member Functions

 simple_diagnostic_event (location_t loc, tree fndecl, int depth, const char *desc, diagnostic_thread_id_t thread_id=0)
 
 ~simple_diagnostic_event ()
 
location_t get_location () const final override
 
int get_stack_depth () const final override
 
void print_desc (pretty_printer &pp) const final override
 
const logical_locationget_logical_location () const final override
 
meaning get_meaning () const final override
 
bool connect_to_next_event_p () const final override
 
diagnostic_thread_id_t get_thread_id () const final override
 
void connect_to_next_event ()
 
tree get_fndecl () const
 
virtual void maybe_add_sarif_properties (sarif_object &) const
 
label_text get_desc (pretty_printer &ref_pp) const
 

Private Attributes

location_t m_loc
 
tree m_fndecl
 
tree_logical_location m_logical_loc
 
int m_depth
 
char * m_desc
 
bool m_connected_to_next_event
 
diagnostic_thread_id_t m_thread_id
 

Detailed Description

Concrete classes for implementing diagnostic paths.
   Copyright (C) 2019-2025 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/>.   
Concrete subclasses of the abstract base classes
declared in diagnostic-path.h.   
A simple implementation of diagnostic_event.   

Member Enumeration Documentation

◆ noun

enum diagnostic_event::noun
inherited
Enumerator
NOUN_unknown 
NOUN_taint 
NOUN_sensitive 
NOUN_function 
NOUN_lock 
NOUN_memory 
NOUN_resource 

◆ property

Enumerator
PROPERTY_unknown 
PROPERTY_true 
PROPERTY_false 

◆ verb

enum diagnostic_event::verb
inherited
Enumerator
VERB_unknown 
VERB_acquire 
VERB_release 
VERB_enter 
VERB_exit 
VERB_call 
VERB_return 
VERB_branch 
VERB_danger 

Constructor & Destructor Documentation

◆ simple_diagnostic_event()

simple_diagnostic_event::simple_diagnostic_event ( location_t loc,
tree fndecl,
int depth,
const char * desc,
diagnostic_thread_id_t thread_id = 0 )
struct simple_diagnostic_event.   
simple_diagnostic_event's ctor.   

References false, m_connected_to_next_event, m_depth, m_desc, m_fndecl, m_loc, m_logical_loc, and m_thread_id.

◆ ~simple_diagnostic_event()

simple_diagnostic_event::~simple_diagnostic_event ( )
simple_diagnostic_event's dtor.   

References free(), and m_desc.

Member Function Documentation

◆ connect_to_next_event()

void simple_diagnostic_event::connect_to_next_event ( )
inline

◆ connect_to_next_event_p()

bool simple_diagnostic_event::connect_to_next_event_p ( ) const
inlinefinaloverridevirtual

Implements diagnostic_event.

References final(), and m_connected_to_next_event.

◆ get_desc()

label_text diagnostic_event::get_desc ( pretty_printer & ref_pp) const
inherited
Generate a label_text containing the description of this event
(for debugging/logging purposes).   

References pretty_printer::clone(), pp_formatted_text(), pp_show_color(), and print_desc().

◆ get_fndecl()

tree simple_diagnostic_event::get_fndecl ( ) const
inline

References m_fndecl.

◆ get_location()

location_t simple_diagnostic_event::get_location ( ) const
inlinefinaloverridevirtual

Implements diagnostic_event.

References final(), and m_loc.

◆ get_logical_location()

const logical_location * simple_diagnostic_event::get_logical_location ( ) const
inlinefinaloverridevirtual

Implements diagnostic_event.

References final(), m_fndecl, and m_logical_loc.

◆ get_meaning()

meaning simple_diagnostic_event::get_meaning ( ) const
inlinefinaloverridevirtual

Implements diagnostic_event.

References final().

◆ get_stack_depth()

int simple_diagnostic_event::get_stack_depth ( ) const
inlinefinaloverridevirtual

Implements diagnostic_event.

References final(), and m_depth.

◆ get_thread_id()

diagnostic_thread_id_t simple_diagnostic_event::get_thread_id ( ) const
inlinefinaloverridevirtual

Implements diagnostic_event.

References final(), and m_thread_id.

◆ maybe_add_sarif_properties()

virtual void diagnostic_event::maybe_add_sarif_properties ( sarif_object & ) const
inlinevirtualinherited

◆ print_desc()

void simple_diagnostic_event::print_desc ( pretty_printer & pp) const
finaloverridevirtual

Implements diagnostic_event.

References m_desc, and pp_string().

Field Documentation

◆ m_connected_to_next_event

bool simple_diagnostic_event::m_connected_to_next_event
private

◆ m_depth

int simple_diagnostic_event::m_depth
private

◆ m_desc

char* simple_diagnostic_event::m_desc
private

◆ m_fndecl

tree simple_diagnostic_event::m_fndecl
private

◆ m_loc

location_t simple_diagnostic_event::m_loc
private

◆ m_logical_loc

tree_logical_location simple_diagnostic_event::m_logical_loc
private

◆ m_thread_id

diagnostic_thread_id_t simple_diagnostic_event::m_thread_id
private

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