GCC Middle and Back End API Reference
libgdiagnostics.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "intl.h"
#include "diagnostic.h"
#include "diagnostic-color.h"
#include "diagnostic-url.h"
#include "diagnostic-metadata.h"
#include "diagnostic-path.h"
#include "diagnostic-client-data-hooks.h"
#include "diagnostic-format-sarif.h"
#include "diagnostic-format-text.h"
#include "diagnostic-output-spec.h"
#include "diagnostic-digraphs.h"
#include "diagnostic-state-graphs.h"
#include "logical-location.h"
#include "edit-context.h"
#include "libgdiagnostics.h"
#include "libgdiagnostics-private.h"
Include dependency graph for libgdiagnostics.cc:

Data Structures

class  owned_nullable_string
class  content_buffer
struct  diagnostic_file
struct  diagnostic_physical_location
struct  diagnostic_logical_location
class  sink
struct  diagnostic_text_sink
class  sarif_sink
class  impl_logical_location_manager
class  impl_diagnostic_client_data_hooks
class  impl_client_version_info
struct  diagnostic_manager
class  impl_rich_location
class  impl_range_label
class  impl_rule
struct  diagnostic_graph
struct  diagnostic_node
struct  diagnostic_edge
class  libgdiagnostics_path_event
class  libgdiagnostics_path_thread
struct  diagnostic_execution_path
class  prebuilt_digraphs
struct  diagnostic

Macros

#define INCLUDE_MAP
#define INCLUDE_STRING
#define INCLUDE_VECTOR
#define CASE(KIND, MSGID)
#define FAIL_IF_NULL(PTR_ARG)

Functions

static location_t as_location_t (const diagnostic_physical_location *loc)
static diagnostic_event_id as_diagnostic_event_id (diagnostic_event_id_t id)
static size_t round_alloc_size (size_t s)
static diagnostic_t diagnostic_t_from_diagnostic_level (enum diagnostic_level level)
diagnostic_managerdiagnostic_manager_new (void)
void diagnostic_manager_release (diagnostic_manager *diag_mgr)
void diagnostic_manager_set_tool_name (diagnostic_manager *diag_mgr, const char *value)
void diagnostic_manager_set_full_name (diagnostic_manager *diag_mgr, const char *value)
void diagnostic_manager_set_version_string (diagnostic_manager *diag_mgr, const char *value)
void diagnostic_manager_set_version_url (diagnostic_manager *diag_mgr, const char *value)
diagnostic_text_sinkdiagnostic_manager_add_text_sink (diagnostic_manager *diag_mgr, FILE *dst_stream, enum diagnostic_colorize colorize)
void diagnostic_text_sink_set_source_printing_enabled (diagnostic_text_sink *text_sink, int value)
void diagnostic_text_sink_set_colorize (diagnostic_text_sink *text_sink, enum diagnostic_colorize colorize)
void diagnostic_text_sink_set_labelled_source_colorization_enabled (diagnostic_text_sink *text_sink, int value)
void diagnostic_manager_add_sarif_sink (diagnostic_manager *diag_mgr, FILE *dst_stream, const diagnostic_file *main_input_file, enum diagnostic_sarif_version version)
void diagnostic_manager_write_patch (diagnostic_manager *diag_mgr, FILE *dst_stream)
diagnostic_filediagnostic_manager_new_file (diagnostic_manager *diag_mgr, const char *name, const char *sarif_source_language)
void diagnostic_file_set_buffered_content (diagnostic_file *file, const char *buf, size_t sz)
void diagnostic_manager_debug_dump_file (diagnostic_manager *, const diagnostic_file *file, FILE *out)
const diagnostic_physical_locationdiagnostic_manager_new_location_from_file_and_line (diagnostic_manager *diag_mgr, const diagnostic_file *file, diagnostic_line_num_t linenum)
const diagnostic_physical_locationdiagnostic_manager_new_location_from_file_line_column (diagnostic_manager *diag_mgr, const diagnostic_file *file, diagnostic_line_num_t line_num, diagnostic_column_num_t column_num)
const diagnostic_physical_locationdiagnostic_manager_new_location_from_range (diagnostic_manager *diag_mgr, const diagnostic_physical_location *loc_caret, const diagnostic_physical_location *loc_start, const diagnostic_physical_location *loc_end)
void diagnostic_manager_debug_dump_location (const diagnostic_manager *diag_mgr, const diagnostic_physical_location *loc, FILE *out)
const diagnostic_logical_locationdiagnostic_manager_new_logical_location (diagnostic_manager *diag_mgr, enum diagnostic_logical_location_kind_t kind, const diagnostic_logical_location *parent, const char *short_name, const char *fully_qualified_name, const char *decorated_name)
void diagnostic_manager_debug_dump_logical_location (const diagnostic_manager *diag_mgr, const diagnostic_logical_location *loc, FILE *out)
void diagnostic_manager_begin_group (diagnostic_manager *diag_mgr)
void diagnostic_manager_end_group (diagnostic_manager *diag_mgr)
diagnosticdiagnostic_begin (diagnostic_manager *diag_mgr, enum diagnostic_level level)
void diagnostic_set_cwe (diagnostic *diag, unsigned cwe_id)
void diagnostic_add_rule (diagnostic *diag, const char *title, const char *url)
void diagnostic_set_location (diagnostic *diag, const diagnostic_physical_location *loc)
void diagnostic_add_location (diagnostic *diag, const diagnostic_physical_location *loc)
void diagnostic_add_location_with_label (diagnostic *diag, const diagnostic_physical_location *loc, const char *text)
void diagnostic_set_logical_location (diagnostic *diag, const diagnostic_logical_location *logical_loc)
void diagnostic_add_fix_it_hint_insert_before (diagnostic *diag, const diagnostic_physical_location *loc, const char *addition)
void diagnostic_add_fix_it_hint_insert_after (diagnostic *diag, const diagnostic_physical_location *loc, const char *addition)
void diagnostic_add_fix_it_hint_replace (diagnostic *diag, const diagnostic_physical_location *loc, const char *replacement)
void diagnostic_add_fix_it_hint_delete (diagnostic *diag, const diagnostic_physical_location *loc)
diagnostic_execution_pathdiagnostic_add_execution_path (diagnostic *diag)
diagnostic_execution_pathdiagnostic_manager_new_execution_path (diagnostic_manager *manager)
void diagnostic_take_execution_path (diagnostic *diag, diagnostic_execution_path *path)
void diagnostic_execution_path_release (diagnostic_execution_path *path)
diagnostic_event_id diagnostic_execution_path_add_event (diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, const char *gmsgid,...)
diagnostic_event_id diagnostic_execution_path_add_event_va (diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, const char *gmsgid, va_list *args)
void diagnostic_finish (diagnostic *diag, const char *gmsgid,...)
void diagnostic_finish_va (diagnostic *diag, const char *gmsgid, va_list *args)
diagnostic_filediagnostic_physical_location_get_file (const diagnostic_physical_location *physical_loc)
enum diagnostic_logical_location_kind_t diagnostic_logical_location_get_kind (const diagnostic_logical_location *loc)
const diagnostic_logical_locationdiagnostic_logical_location_get_parent (const diagnostic_logical_location *loc)
const char * diagnostic_logical_location_get_short_name (const diagnostic_logical_location *loc)
const char * diagnostic_logical_location_get_fully_qualified_name (const diagnostic_logical_location *loc)
const char * diagnostic_logical_location_get_decorated_name (const diagnostic_logical_location *loc)
int diagnostic_manager_add_sink_from_spec (diagnostic_manager *affected_mgr, const char *option_name, const char *spec, diagnostic_manager *control_mgr)
void diagnostic_manager_set_analysis_target (diagnostic_manager *mgr, const diagnostic_file *file)
diagnostic_graphdiagnostic_manager_new_graph (diagnostic_manager *manager)
void diagnostic_manager_take_global_graph (diagnostic_manager *manager, diagnostic_graph *graph)
void diagnostic_take_graph (diagnostic *diag, diagnostic_graph *graph)
void diagnostic_graph_release (diagnostic_graph *graph)
void diagnostic_graph_set_description (diagnostic_graph *graph, const char *desc)
diagnostic_nodediagnostic_graph_add_node (diagnostic_graph *graph, const char *id, diagnostic_node *parent_node)
diagnostic_edgediagnostic_graph_add_edge (diagnostic_graph *graph, const char *id, diagnostic_node *src_node, diagnostic_node *dst_node, const char *label)
diagnostic_nodediagnostic_graph_get_node_by_id (diagnostic_graph *graph, const char *id)
diagnostic_edgediagnostic_graph_get_edge_by_id (diagnostic_graph *graph, const char *id)
void diagnostic_node_set_location (diagnostic_node *node, const diagnostic_physical_location *loc)
void diagnostic_node_set_label (diagnostic_node *node, const char *label)
void diagnostic_node_set_logical_location (diagnostic_node *node, const diagnostic_logical_location *logical_loc)
diagnostic_event_id private_diagnostic_execution_path_add_event_2 (diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, diagnostic_graph *state_graph, const char *gmsgid,...)
void private_diagnostic_graph_set_property_bag (diagnostic_graph &graph, std::unique_ptr< json::object > properties)
void private_diagnostic_node_set_property_bag (diagnostic_node &node, std::unique_ptr< json::object > properties)
void private_diagnostic_edge_set_property_bag (diagnostic_edge &edge, std::unique_ptr< json::object > properties)

Macro Definition Documentation

◆ CASE

#define CASE ( KIND,
MSGID )
Value:
case KIND: \
if (const char *name \
= diag_logical_loc->m_fully_qualified_name.get_str ()) \
{ \
pp_printf (pp, (MSGID), name); \
pp_character (pp, ':'); \
pp_newline (pp); \
} \
break;

Referenced by diagnostic_text_sink::text_starter().

◆ FAIL_IF_NULL

#define FAIL_IF_NULL ( PTR_ARG)
Value:
do { \
volatile const void *p = (PTR_ARG); \
if (!p) { \
fprintf (stderr, "%s: %s must be non-NULL\n", \
__func__, #PTR_ARG); \
abort (); \
} \
} while (0)
Error-checking at the API boundary.

Referenced by diagnostic_add_execution_path(), diagnostic_add_fix_it_hint_delete(), diagnostic_add_fix_it_hint_insert_after(), diagnostic_add_fix_it_hint_insert_before(), diagnostic_add_fix_it_hint_replace(), diagnostic_add_location(), diagnostic_add_location_with_label(), diagnostic_add_rule(), diagnostic_begin(), diagnostic_execution_path_add_event(), diagnostic_execution_path_add_event_va(), diagnostic_file_set_buffered_content(), diagnostic_finish(), diagnostic_finish_va(), diagnostic_graph_add_edge(), diagnostic_graph_add_node(), diagnostic_graph_get_edge_by_id(), diagnostic_graph_get_node_by_id(), diagnostic_graph_set_description(), diagnostic_logical_location_get_decorated_name(), diagnostic_logical_location_get_fully_qualified_name(), diagnostic_logical_location_get_kind(), diagnostic_logical_location_get_parent(), diagnostic_logical_location_get_short_name(), diagnostic_manager_add_sarif_sink(), diagnostic_manager_add_sink_from_spec(), diagnostic_manager_add_text_sink(), diagnostic_manager_begin_group(), diagnostic_manager_debug_dump_file(), diagnostic_manager_debug_dump_location(), diagnostic_manager_debug_dump_logical_location(), diagnostic_manager_end_group(), diagnostic_manager_new_execution_path(), diagnostic_manager_new_file(), diagnostic_manager_new_graph(), diagnostic_manager_new_location_from_file_and_line(), diagnostic_manager_new_location_from_file_line_column(), diagnostic_manager_new_location_from_range(), diagnostic_manager_new_logical_location(), diagnostic_manager_set_analysis_target(), diagnostic_manager_set_full_name(), diagnostic_manager_set_tool_name(), diagnostic_manager_set_version_string(), diagnostic_manager_set_version_url(), diagnostic_manager_take_global_graph(), diagnostic_manager_write_patch(), diagnostic_node_set_label(), diagnostic_node_set_location(), diagnostic_node_set_logical_location(), diagnostic_set_cwe(), diagnostic_set_location(), diagnostic_set_logical_location(), diagnostic_take_execution_path(), diagnostic_take_graph(), diagnostic_text_sink_set_colorize(), diagnostic_text_sink_set_labelled_source_colorization_enabled(), diagnostic_text_sink_set_source_printing_enabled(), private_diagnostic_execution_path_add_event_2(), and sarif_replay_path().

◆ INCLUDE_MAP

#define INCLUDE_MAP
C++ implementation of a pure C API for emitting diagnostics. Copyright (C) 2023-2025 Free Software Foundation, Inc. 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/>.

◆ INCLUDE_STRING

#define INCLUDE_STRING

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR

Function Documentation

◆ as_diagnostic_event_id()

◆ as_location_t()

◆ diagnostic_add_execution_path()

diagnostic_execution_path * diagnostic_add_execution_path ( diagnostic * diag)
Public entrypoint.

References diagnostic::add_execution_path(), and FAIL_IF_NULL.

Referenced by diagnostic_set_location_with_label().

◆ diagnostic_add_fix_it_hint_delete()

◆ diagnostic_add_fix_it_hint_insert_after()

◆ diagnostic_add_fix_it_hint_insert_before()

◆ diagnostic_add_fix_it_hint_replace()

◆ diagnostic_add_location()

◆ diagnostic_add_location_with_label()

◆ diagnostic_add_rule()

void diagnostic_add_rule ( diagnostic * diag,
const char * title,
const char * url )
Public entrypoint.

References diagnostic::add_rule(), and FAIL_IF_NULL.

Referenced by libgdiagnostics::diagnostic::add_rule().

◆ diagnostic_begin()

diagnostic * diagnostic_begin ( diagnostic_manager * diag_mgr,
enum diagnostic_level level )
Public entrypoint.

References FAIL_IF_NULL.

Referenced by libgdiagnostics::manager::begin_diagnostic().

◆ diagnostic_execution_path_add_event()

diagnostic_event_id diagnostic_execution_path_add_event ( diagnostic_execution_path * path,
const diagnostic_physical_location * physical_loc,
const diagnostic_logical_location * logical_loc,
unsigned stack_depth,
const char * gmsgid,
... )
Public entrypoint.

References as_diagnostic_event_id(), FAIL_IF_NULL, and path.

Referenced by diagnostic_execution_path_add_event().

◆ diagnostic_execution_path_add_event_va()

diagnostic_event_id diagnostic_execution_path_add_event_va ( diagnostic_execution_path * path,
const diagnostic_physical_location * physical_loc,
const diagnostic_logical_location * logical_loc,
unsigned stack_depth,
const char * gmsgid,
va_list * args )

◆ diagnostic_execution_path_release()

void diagnostic_execution_path_release ( diagnostic_execution_path * path)

◆ diagnostic_file_set_buffered_content()

void diagnostic_file_set_buffered_content ( diagnostic_file * file,
const char * buf,
size_t sz )

◆ diagnostic_finish()

void diagnostic_finish ( diagnostic * diag,
const char * gmsgid,
... )
Public entrypoint.

References diagnostic_finish_va(), and FAIL_IF_NULL.

Referenced by diagnostic_manager_debug_dump_location().

◆ diagnostic_finish_va()

◆ diagnostic_graph_add_edge()

diagnostic_edge * diagnostic_graph_add_edge ( diagnostic_graph * graph,
const char * id,
diagnostic_node * src_node,
diagnostic_node * dst_node,
const char * label )
Public entrypoint.

References FAIL_IF_NULL.

Referenced by libgdiagnostics::graph::add_edge().

◆ diagnostic_graph_add_node()

diagnostic_node * diagnostic_graph_add_node ( diagnostic_graph * graph,
const char * node_id,
diagnostic_node * parent_node )
Create and add a new node within GRAPH. NODE_ID must be unique within nodes in GRAPH. The new node is owned by GRAPH. PARENT_NODE can be NULL (for a top-level node in the graph), or non-null for a child node. Added in LIBGDIAGNOSTICS_ABI_3.

References FAIL_IF_NULL.

◆ diagnostic_graph_get_edge_by_id()

diagnostic_edge * diagnostic_graph_get_edge_by_id ( diagnostic_graph * graph,
const char * id )
Public entrypoint.

References FAIL_IF_NULL.

Referenced by libgdiagnostics::graph::get_edge_by_id().

◆ diagnostic_graph_get_node_by_id()

diagnostic_node * diagnostic_graph_get_node_by_id ( diagnostic_graph * graph,
const char * id )
Public entrypoint.

References FAIL_IF_NULL.

Referenced by libgdiagnostics::graph::get_node_by_id().

◆ diagnostic_graph_release()

void diagnostic_graph_release ( diagnostic_graph * graph)
Public entrypoint.

Referenced by libgdiagnostics::graph::~graph().

◆ diagnostic_graph_set_description()

void diagnostic_graph_set_description ( diagnostic_graph * graph,
const char * desc )
Public entrypoint.

References FAIL_IF_NULL.

Referenced by libgdiagnostics::graph::set_description().

◆ diagnostic_logical_location_get_decorated_name()

const char * diagnostic_logical_location_get_decorated_name ( const diagnostic_logical_location * loc)

◆ diagnostic_logical_location_get_fully_qualified_name()

◆ diagnostic_logical_location_get_kind()

enum diagnostic_logical_location_kind_t diagnostic_logical_location_get_kind ( const diagnostic_logical_location * loc)
Public entrypoints for accessing logical location data.

References FAIL_IF_NULL, and diagnostic_logical_location::m_kind.

Referenced by libgdiagnostics::logical_location::get_kind().

◆ diagnostic_logical_location_get_parent()

const diagnostic_logical_location * diagnostic_logical_location_get_parent ( const diagnostic_logical_location * loc)

◆ diagnostic_logical_location_get_short_name()

const char * diagnostic_logical_location_get_short_name ( const diagnostic_logical_location * loc)

◆ diagnostic_manager_add_sarif_sink()

◆ diagnostic_manager_add_sink_from_spec()

int diagnostic_manager_add_sink_from_spec ( diagnostic_manager * affected_mgr,
const char * option_name,
const char * spec,
diagnostic_manager * control_mgr )

◆ diagnostic_manager_add_text_sink()

diagnostic_text_sink * diagnostic_manager_add_text_sink ( diagnostic_manager * diag_mgr,
FILE * dst_stream,
enum diagnostic_colorize colorize )

◆ diagnostic_manager_begin_group()

void diagnostic_manager_begin_group ( diagnostic_manager * diag_mgr)
Public entrypoint.

References diagnostic_manager::begin_group(), and FAIL_IF_NULL.

Referenced by libgdiagnostics::group::group().

◆ diagnostic_manager_debug_dump_file()

void diagnostic_manager_debug_dump_file ( diagnostic_manager * diag_mgr,
const diagnostic_file * file,
FILE * out )
Write a representation of FILE to OUT, for debugging.

References FAIL_IF_NULL, diagnostic_file::get_content(), diagnostic_file::get_name(), and diagnostic_file::get_sarif_source_language().

◆ diagnostic_manager_debug_dump_location()

◆ diagnostic_manager_debug_dump_logical_location()

◆ diagnostic_manager_end_group()

void diagnostic_manager_end_group ( diagnostic_manager * diag_mgr)
extern
Public entrypoint.

References diagnostic_manager::end_group(), and FAIL_IF_NULL.

Referenced by libgdiagnostics::group::~group().

◆ diagnostic_manager_new()

diagnostic_manager * diagnostic_manager_new ( void )
Public entrypoints.
Public entrypoint for clients to acquire a diagnostic_manager.

Referenced by libgdiagnostics::manager::manager().

◆ diagnostic_manager_new_execution_path()

◆ diagnostic_manager_new_file()

diagnostic_file * diagnostic_manager_new_file ( diagnostic_manager * diag_mgr,
const char * name,
const char * sarif_source_language )
Public entrypoint.

References FAIL_IF_NULL, and diagnostic_manager::new_file().

Referenced by libgdiagnostics::manager::new_file().

◆ diagnostic_manager_new_graph()

diagnostic_graph * diagnostic_manager_new_graph ( diagnostic_manager * manager)
Public entrypoint.

References FAIL_IF_NULL.

◆ diagnostic_manager_new_location_from_file_and_line()

const diagnostic_physical_location * diagnostic_manager_new_location_from_file_and_line ( diagnostic_manager * diag_mgr,
const diagnostic_file * file,
diagnostic_line_num_t linenum )

◆ diagnostic_manager_new_location_from_file_line_column()

const diagnostic_physical_location * diagnostic_manager_new_location_from_file_line_column ( diagnostic_manager * diag_mgr,
const diagnostic_file * file,
diagnostic_line_num_t line_num,
diagnostic_column_num_t column_num )

◆ diagnostic_manager_new_location_from_range()

const diagnostic_physical_location * diagnostic_manager_new_location_from_range ( diagnostic_manager * diag_mgr,
const diagnostic_physical_location * loc_caret,
const diagnostic_physical_location * loc_start,
const diagnostic_physical_location * loc_end )

◆ diagnostic_manager_new_logical_location()

const diagnostic_logical_location * diagnostic_manager_new_logical_location ( diagnostic_manager * diag_mgr,
enum diagnostic_logical_location_kind_t kind,
const diagnostic_logical_location * parent,
const char * short_name,
const char * fully_qualified_name,
const char * decorated_name )

◆ diagnostic_manager_release()

void diagnostic_manager_release ( diagnostic_manager * diag_mgr)
Public entrypoint for clients to release a diagnostic_manager.

Referenced by libgdiagnostics::manager::~manager().

◆ diagnostic_manager_set_analysis_target()

void diagnostic_manager_set_analysis_target ( diagnostic_manager * mgr,
const diagnostic_file * file )

◆ diagnostic_manager_set_full_name()

void diagnostic_manager_set_full_name ( diagnostic_manager * diag_mgr,
const char * value )

◆ diagnostic_manager_set_tool_name()

void diagnostic_manager_set_tool_name ( diagnostic_manager * diag_mgr,
const char * value )

◆ diagnostic_manager_set_version_string()

void diagnostic_manager_set_version_string ( diagnostic_manager * diag_mgr,
const char * value )

◆ diagnostic_manager_set_version_url()

void diagnostic_manager_set_version_url ( diagnostic_manager * diag_mgr,
const char * value )

◆ diagnostic_manager_take_global_graph()

void diagnostic_manager_take_global_graph ( diagnostic_manager * manager,
diagnostic_graph * graph )

◆ diagnostic_manager_write_patch()

void diagnostic_manager_write_patch ( diagnostic_manager * diag_mgr,
FILE * dst_stream )

◆ diagnostic_node_set_label()

void diagnostic_node_set_label ( diagnostic_node * node,
const char * label )

◆ diagnostic_node_set_location()

◆ diagnostic_node_set_logical_location()

void diagnostic_node_set_logical_location ( diagnostic_node * node,
const diagnostic_logical_location * logical_loc )
Set the logical location of NODE. Added in LIBGDIAGNOSTICS_ABI_3.

References FAIL_IF_NULL, impl_logical_location_manager::key_from_ptr(), and diagnostics::digraphs::node::set_logical_loc().

Referenced by libgdiagnostics::node::set_logical_location().

◆ diagnostic_physical_location_get_file()

diagnostic_file * diagnostic_physical_location_get_file ( const diagnostic_physical_location * physical_loc)

◆ diagnostic_set_cwe()

void diagnostic_set_cwe ( diagnostic * diag,
unsigned cwe_id )
Public entrypoint.

References FAIL_IF_NULL, and diagnostic::set_cwe().

Referenced by libgdiagnostics::diagnostic::set_cwe().

◆ diagnostic_set_location()

◆ diagnostic_set_logical_location()

void diagnostic_set_logical_location ( diagnostic * diag,
const diagnostic_logical_location * logical_loc )

◆ diagnostic_t_from_diagnostic_level()

◆ diagnostic_take_execution_path()

void diagnostic_take_execution_path ( diagnostic * diag,
diagnostic_execution_path * path )
extern

◆ diagnostic_take_graph()

void diagnostic_take_graph ( diagnostic * diag,
diagnostic_graph * graph )
Add this graph to DIAG, transferring ownership to it. Added in LIBGDIAGNOSTICS_ABI_3.

References FAIL_IF_NULL, and diagnostic::take_graph().

Referenced by libgdiagnostics::diagnostic::take_graph().

◆ diagnostic_text_sink_set_colorize()

void diagnostic_text_sink_set_colorize ( diagnostic_text_sink * text_sink,
enum diagnostic_colorize colorize )

◆ diagnostic_text_sink_set_labelled_source_colorization_enabled()

void diagnostic_text_sink_set_labelled_source_colorization_enabled ( diagnostic_text_sink * text_sink,
int value )

◆ diagnostic_text_sink_set_source_printing_enabled()

void diagnostic_text_sink_set_source_printing_enabled ( diagnostic_text_sink * text_sink,
int value )

◆ private_diagnostic_edge_set_property_bag()

void private_diagnostic_edge_set_property_bag ( diagnostic_edge & edge,
std::unique_ptr< json::object > properties )
Private entrypoint.

Referenced by private_diagnostic_execution_path_add_event_2().

◆ private_diagnostic_execution_path_add_event_2()

diagnostic_event_id private_diagnostic_execution_path_add_event_2 ( diagnostic_execution_path * path,
const diagnostic_physical_location * physical_loc,
const diagnostic_logical_location * logical_loc,
unsigned stack_depth,
diagnostic_graph * state_graph,
const char * gmsgid,
... )
Private entrypoint.

References as_diagnostic_event_id(), FAIL_IF_NULL, and path.

◆ private_diagnostic_graph_set_property_bag()

void private_diagnostic_graph_set_property_bag ( diagnostic_graph & graph,
std::unique_ptr< json::object > properties )
Private entrypoint.

Referenced by private_diagnostic_execution_path_add_event_2().

◆ private_diagnostic_node_set_property_bag()

void private_diagnostic_node_set_property_bag ( diagnostic_node & node,
std::unique_ptr< json::object > properties )

◆ round_alloc_size()

size_t round_alloc_size ( size_t s)
static
Helper for the linemap code.

Referenced by diagnostic_manager::diagnostic_manager().