GCC Middle and Back End API Reference
libgdiagnostics.cc File Reference
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
struct  diagnostic_message_buffer
class  pp_element_message_buffer
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 (diagnostics::paths::event_id_t id)
static size_t round_alloc_size (size_t s)
static enum diagnostics::kind diagnostics_kind_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 *node_id, diagnostic_node *parent_node)
diagnostic_edgediagnostic_graph_add_edge (diagnostic_graph *graph, const char *edge_id, diagnostic_node *src_node, diagnostic_node *dst_node, const char *label)
diagnostic_nodediagnostic_graph_get_node_by_id (diagnostic_graph *graph, const char *node_id)
diagnostic_edgediagnostic_graph_get_edge_by_id (diagnostic_graph *graph, const char *edge_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)
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 &edgeedge, std::unique_ptr< json::object > properties)
diagnostic_message_bufferdiagnostic_message_buffer_new ()
void diagnostic_message_buffer_release (diagnostic_message_buffer *msg_buf)
void diagnostic_message_buffer_append_str (diagnostic_message_buffer *msg_buf, const char *p)
void diagnostic_message_buffer_append_text (diagnostic_message_buffer *msg_buf, const char *p, size_t len)
void diagnostic_message_buffer_append_byte (diagnostic_message_buffer *msg_buf, char ch)
void diagnostic_message_buffer_append_printf (diagnostic_message_buffer *msg_buf, const char *fmt,...)
void diagnostic_message_buffer_append_event_id (diagnostic_message_buffer *msg_buf, diagnostic_event_id event_id)
void diagnostic_message_buffer_begin_url (diagnostic_message_buffer *msg_buf, const char *url)
void diagnostic_message_buffer_end_url (diagnostic_message_buffer *msg_buf)
void diagnostic_message_buffer_begin_quote (diagnostic_message_buffer *msg_buf)
void diagnostic_message_buffer_end_quote (diagnostic_message_buffer *msg_buf)
void diagnostic_message_buffer_begin_color (diagnostic_message_buffer *msg_buf, const char *color)
void diagnostic_message_buffer_end_color (diagnostic_message_buffer *msg_buf)
void diagnostic_message_buffer_dump (const diagnostic_message_buffer *msg_buf, FILE *outf)
void diagnostic_finish_via_msg_buf (diagnostic *diag, diagnostic_message_buffer *msg_buf)
void diagnostic_add_location_with_label_via_msg_buf (diagnostic *diag, const diagnostic_physical_location *loc, diagnostic_message_buffer *msg_buf)
diagnostic_event_id diagnostic_execution_path_add_event_via_msg_buf (diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, diagnostic_message_buffer *msg_buf)
void diagnostic_graph_set_description_via_msg_buf (diagnostic_graph *graph, diagnostic_message_buffer *desc)
diagnostic_edgediagnostic_graph_add_edge_via_msg_buf (diagnostic_graph *graph, const char *edge_id, diagnostic_node *src_node, diagnostic_node *dst_node, diagnostic_message_buffer *label)
void diagnostic_node_set_label_via_msg_buf (diagnostic_node *node, diagnostic_message_buffer *label)
diagnostic_event_id private_diagnostic_execution_path_add_event_3 (diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, diagnostic_graph *state_graph, diagnostic_message_buffer *msg_buf)
void diagnostic_manager_set_debug_physical_locations (diagnostic_manager *mgr, int value)
void private_diagnostic_set_nesting_level (diagnostic *diag, int nesting_level)

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 *ptr_arg = (PTR_ARG); \
if (!ptr_arg) { \
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_location_with_label_via_msg_buf(), diagnostic_add_rule(), diagnostic_begin(), diagnostic_execution_path_add_event(), diagnostic_execution_path_add_event_va(), diagnostic_execution_path_add_event_via_msg_buf(), diagnostic_file_set_buffered_content(), diagnostic_finish(), diagnostic_finish_va(), diagnostic_finish_via_msg_buf(), diagnostic_graph_add_edge(), diagnostic_graph_add_edge_via_msg_buf(), diagnostic_graph_add_node(), diagnostic_graph_get_edge_by_id(), diagnostic_graph_get_node_by_id(), diagnostic_graph_set_description(), diagnostic_graph_set_description_via_msg_buf(), 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_debug_physical_locations(), 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_message_buffer_append_byte(), diagnostic_message_buffer_append_event_id(), diagnostic_message_buffer_append_printf(), diagnostic_message_buffer_append_str(), diagnostic_message_buffer_append_text(), diagnostic_message_buffer_begin_color(), diagnostic_message_buffer_begin_quote(), diagnostic_message_buffer_begin_url(), diagnostic_message_buffer_dump(), diagnostic_message_buffer_end_color(), diagnostic_message_buffer_end_quote(), diagnostic_message_buffer_end_url(), diagnostic_message_buffer_release(), diagnostic_node_set_label(), diagnostic_node_set_label_via_msg_buf(), 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_3(), private_diagnostic_set_nesting_level(), and sarif_replay_path().

◆ INCLUDE_MAP

#define INCLUDE_MAP
C++ implementation of a pure C API for emitting diagnostics.
   Copyright (C) 2023-2026 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.   
Create and borrow a pointer to an execution path for DIAG.
The path is automatically cleaned up when DIAG is finished.   

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()

void diagnostic_add_location_with_label ( diagnostic * diag,
const diagnostic_physical_location * loc,
const char * text )

◆ diagnostic_add_location_with_label_via_msg_buf()

void diagnostic_add_location_with_label_via_msg_buf ( diagnostic * diag,
const diagnostic_physical_location * loc,
diagnostic_message_buffer * msg_buf )
Public entrypoint.   
As diagnostic_add_location_with_label but takes ownership of MSG_BUF.
Added in LIBGDIAGNOSTICS_ABI_4.   

References diagnostic::add_location_with_label(), diagnostic_manager::assert_valid_diagnostic_physical_location(), FAIL_IF_NULL, and diagnostic::get_manager().

Referenced by libgdiagnostics::diagnostic::add_location_with_label(), and diagnostic_message_buffer_append_printf().

◆ diagnostic_add_rule()

void diagnostic_add_rule ( diagnostic * diag,
const char * title,
const char * url )
Public entrypoint.   
Associate this diagnostic with a particular rule that has been violated
(such as in a coding standard, or within a specification).
The rule must have at least one of a title and a URL, but these
can be NULL.
A diagnostic can be associated with zero or more rules.   

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.   
Step-by-step creation of a diagnostic.   

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_add_event_via_msg_buf()

diagnostic_event_id diagnostic_execution_path_add_event_via_msg_buf ( diagnostic_execution_path * path,
const diagnostic_physical_location * physical_loc,
const diagnostic_logical_location * logical_loc,
unsigned stack_depth,
diagnostic_message_buffer * msg_buf )
Public entrypoint.   
As diagnostic_execution_path_add_event but takes ownership of MSG_BUF.
Added in LIBGDIAGNOSTICS_ABI_4.   

References as_diagnostic_event_id(), FAIL_IF_NULL, and path.

Referenced by libgdiagnostics::execution_path::add_event_via_msg_buf(), and diagnostic_message_buffer_append_printf().

◆ diagnostic_execution_path_release()

void diagnostic_execution_path_release ( diagnostic_execution_path * path)
Public entrypoint.   
Release ownership of PATH, which must not have been taken
by a diagnostic.   

References path.

Referenced by diagnostic_set_location_with_label(), and libgdiagnostics::execution_path::~execution_path().

◆ diagnostic_file_set_buffered_content()

void diagnostic_file_set_buffered_content ( diagnostic_file * file,
const char * buf,
size_t sz )
Public entrypoint.   
Populate the source-quoting cache for FILE, specifying the
given buffer as the content of the file (rather than
attempting to read the content from the filesystem).   

References FAIL_IF_NULL, and diagnostic_file::set_buffered_content().

Referenced by libgdiagnostics::file::set_buffered_content().

◆ 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_finish_via_msg_buf()

void diagnostic_finish_via_msg_buf ( diagnostic * diag,
diagnostic_message_buffer * msg_buf )
Public entrypoint.   
As diagnostic_finish, but takes ownership of MSG_BUF.
Added in LIBGDIAGNOSTICS_ABI_4.   

References diagnostic_manager::emit_msg_buf(), FAIL_IF_NULL, diagnostic_manager::get_client_version_info(), diagnostic::get_manager(), progname, and tool_name.

Referenced by diagnostic_message_buffer_append_printf(), and libgdiagnostics::diagnostic::finish_via_msg_buf().

◆ diagnostic_graph_add_edge()

diagnostic_edge * diagnostic_graph_add_edge ( diagnostic_graph * graph,
const char * edge_id,
diagnostic_node * src_node,
diagnostic_node * dst_node,
const char * label )
Public entrypoint.   
Create and add a new edge within GRAPH.

If non-null, then EDGE_ID must be unique within edges in GRAPH;
if EDGE_ID is null then a unique id of the form "edge0", "edge1", etc
will be used automatically.

The new edge is owned by GRAPH.
Added in LIBGDIAGNOSTICS_ABI_3.   

References FAIL_IF_NULL.

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

◆ diagnostic_graph_add_edge_via_msg_buf()

diagnostic_edge * diagnostic_graph_add_edge_via_msg_buf ( diagnostic_graph * graph,
const char * edge_id,
diagnostic_node * src_node,
diagnostic_node * dst_node,
diagnostic_message_buffer * label )
Public entrypoint.   
Create and add a new edge within GRAPH.

If non-null, then EDGE_ID must be unique within edges in GRAPH;
if EDGE_ID is null then a unique id of the form "edge0", "edge1", etc
will be used automatically.

Takes ownership of LABEL, if non-null.

The new edge is owned by GRAPH.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, and pretty_print_token_buffer::to_string().

Referenced by libgdiagnostics::graph::add_edge(), and diagnostic_message_buffer_append_printf().

◆ diagnostic_graph_add_node()

diagnostic_node * diagnostic_graph_add_node ( diagnostic_graph * graph,
const char * node_id,
diagnostic_node * parent_node )
Public entrypoint.   
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 * edge_id )
Public entrypoint.   
Get the edge in GRAPH with the given id, or null.
Added in LIBGDIAGNOSTICS_ABI_3.   

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 * node_id )
Public entrypoint.   
Get the node in GRAPH with the given id, or null.
Added in LIBGDIAGNOSTICS_ABI_3.   

References FAIL_IF_NULL.

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

◆ diagnostic_graph_release()

void diagnostic_graph_release ( diagnostic_graph * graph)
Public entrypoint.   
Release this graph.  Added in LIBGDIAGNOSTICS_ABI_3.   

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

◆ diagnostic_graph_set_description()

void diagnostic_graph_set_description ( diagnostic_graph * graph,
const char * description )
Public entrypoint.   
Set the description of GRAPH for use
in the value of the SARIF "description" property
(SARIF v2.1.0 section 3.39.2).
Added in LIBGDIAGNOSTICS_ABI_3.   

References FAIL_IF_NULL.

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

◆ diagnostic_graph_set_description_via_msg_buf()

void diagnostic_graph_set_description_via_msg_buf ( diagnostic_graph * graph,
diagnostic_message_buffer * desc )
Public entrypoint.   
Set the description of GRAPH for use
in the value of the SARIF "description" property
(SARIF v2.1.0 section 3.39.2).

Takes ownership of DESC, if non-null.

Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, and pretty_print_token_buffer::to_string().

Referenced by diagnostic_message_buffer_append_printf(), and 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()

void diagnostic_manager_add_sarif_sink ( diagnostic_manager * diag_mgr,
FILE * dst_stream,
const diagnostic_file * main_input_file,
enum diagnostic_sarif_version version )
Public entrypoint.   
Add a new output sink to DIAG_MGR, which writes SARIF of the given
version to DST_STREAM.

The output is not written until DIAG_MGR is released.

DST_STREAM is borrowed, and must outlive DIAG_MGR.

For the result to be a valid SARIF file according to the schema,
DIAG_MGR must have had diagnostic_manager_set_tool_name called on it.   

References abort, diagnostic_manager::add_sink(), DIAGNOSTIC_SARIF_VERSION_2_1_0, DIAGNOSTIC_SARIF_VERSION_2_2_PRERELEASE, FAIL_IF_NULL, diagnostics::sarif_generation_options::m_version, diagnostics::v2_1_0, and diagnostics::v2_2_prerelease_2024_08_08.

Referenced by libgdiagnostics::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 )
Public entrypoint.   
Destinations for diagnostics.   
Add a new output sink to DIAG_MGR, which writes GCC-style diagnostics
to DST_STREAM.
Return a borrowed pointer to the sink, which is cleaned up when DIAG_MGR
is released.
DST_STREAM is borrowed, and must outlive DIAG_MGR.
The output for each diagnostic is written and flushed as each
diagnostic is finished.   

References diagnostic_manager::add_sink(), and FAIL_IF_NULL.

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

◆ diagnostic_manager_begin_group()

void diagnostic_manager_begin_group ( diagnostic_manager * diag_mgr)
Public entrypoint.   
Diagnostic groups.   
Begin a diagnostic group.  All diagnostics emitted within
DIAG_MGR after the first one will be treated as notes about
the initial diagnostic.   

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 )

◆ diagnostic_manager_debug_dump_location()

void diagnostic_manager_debug_dump_location ( const diagnostic_manager * diag_mgr,
const diagnostic_physical_location * loc,
FILE * out )

◆ diagnostic_manager_debug_dump_logical_location()

◆ diagnostic_manager_end_group()

void diagnostic_manager_end_group ( diagnostic_manager * diag_mgr)
extern
Public entrypoint.   
Finish a diagnostic group.   

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.   
Create a new diagnostic_manager.
The client needs to call diagnostic_release_manager on it at some
point.
Note that no output sinks are created by default.   

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

◆ diagnostic_manager_new_execution_path()

diagnostic_execution_path * diagnostic_manager_new_execution_path ( diagnostic_manager * manager)
Public entrypoint.   
Create a new execution path.
This is owned by the called and must have either
diagnostic_take_execution_path or diagnostic_execution_path_release
called on it.   

References FAIL_IF_NULL, and diagnostic_manager::new_execution_path().

Referenced by diagnostic_set_location_with_label(), and libgdiagnostics::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.   
Location management.   
Create a new diagnostic_file * for file NAME.

Repeated calls with matching NAMEs will return the
same object.

If SARIF_SOURCE_LANGUAGE is non-NULL, it specifies a "sourceLanguage"
value for the file when use when writing SARIF.
See SARIF v2.1.0 Appendix J for suggested values for various
programmming languages.   

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.   
Create a new graph.
This is owned by the caller and must have one of
diagnostic_manager_take_global_graph, diagnostic_take_graph,
or diagnostic_graph_release called on it.
Added in LIBGDIAGNOSTICS_ABI_3.   

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 line_num )
Public entrypoint.   
Attempt to create a diagnostic_location representing
FILENAME:LINE_NUM, with no column information
(thus "the whole line").   

References FAIL_IF_NULL, and diagnostic_manager::new_location_from_file_and_line().

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

◆ 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 )
Public entrypoint.   
Attempt to create a diagnostic_physical_location representing
FILENAME:LINE_NUM:COLUMN_NUM.   

References FAIL_IF_NULL, and diagnostic_manager::new_location_from_file_line_column().

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

◆ 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 )
Public entrypoint.   
Attempt to create a diagnostic_physical_location representing a
range within a source file, with a highlighted "caret" location.

All must be within the same file, but they can be on different lines.

For example, consider the location of the binary expression below:

  ...|__________1111111112222222
  ...|12345678901234567890123456
  ...|
  521|int sum (int foo, int bar)
  522|{
  523|   return foo + bar;
  ...|          ~~~~^~~~~
  524|}

The location's caret is at the "+", line 523 column 15, but starts
earlier, at the "f" of "foo" at column 11.  The finish is at the "r"
of "bar" at column 19.   

References FAIL_IF_NULL, and diagnostic_manager::new_location_from_range().

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

◆ 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 )
Public entrypoint.   
A bundle of state describing a logical location in the user's source,
such as "in function 'foo'".

SHORT_NAME can be NULL, or else a string suitable for use by
the SARIF logicalLocation "name" property (SARIF v2.1.0 section 3.33.4).

FULLY_QUALIFIED_NAME can be NULL or else a string  suitable for use by
the SARIF logicalLocation "fullyQualifiedName" property
(SARIF v2.1.0 section 3.33.5).

DECORATED_NAME can be NULL or else a string  suitable for use by
the SARIF logicalLocation "decoratedName" property
(SARIF v2.1.0 section 3.33.6).   

References FAIL_IF_NULL, and diagnostic_manager::new_logical_location().

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

◆ diagnostic_manager_release()

void diagnostic_manager_release ( diagnostic_manager * diag_mgr)
Public entrypoint for clients to release a diagnostic_manager.   
Release a diagnostic_manager.
This will flush output to all of the output sinks, and clean up.  

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_debug_physical_locations()

void diagnostic_manager_set_debug_physical_locations ( diagnostic_manager * mgr,
int value )

◆ diagnostic_manager_set_full_name()

void diagnostic_manager_set_full_name ( diagnostic_manager * diag_mgr,
const char * value )
Public entrypoint.   
Set a string suitable for use as the value of the SARIF "fullName" property
(SARIF v2.1.0 section 3.19.9).   

References FAIL_IF_NULL, and diagnostic_manager::get_client_version_info().

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

◆ diagnostic_manager_set_tool_name()

void diagnostic_manager_set_tool_name ( diagnostic_manager * diag_mgr,
const char * value )
Public entrypoint.   
Optional metadata about the manager.   
Set a string suitable for use as the value of the SARIF "name" property
(SARIF v2.1.0 section 3.19.8).   

References FAIL_IF_NULL, and diagnostic_manager::get_client_version_info().

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

◆ diagnostic_manager_set_version_string()

void diagnostic_manager_set_version_string ( diagnostic_manager * diag_mgr,
const char * value )
Public entrypoint.   
Set a string suitable for use as the value of the SARIF "version" property
(SARIF v2.1.0 section 3.19.13).   

References FAIL_IF_NULL, and diagnostic_manager::get_client_version_info().

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

◆ diagnostic_manager_set_version_url()

void diagnostic_manager_set_version_url ( diagnostic_manager * diag_mgr,
const char * value )
Public entrypoint.   
Set a string suitable for use as the value of the SARIF "informationUri"
property (SARIF v2.1.0 section 3.19.17).   

References FAIL_IF_NULL, and diagnostic_manager::get_client_version_info().

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

◆ diagnostic_manager_take_global_graph()

void diagnostic_manager_take_global_graph ( diagnostic_manager * manager,
diagnostic_graph * graph )
Public entrypoint.   
Report this graph "globally", taking ownership of it.
Added in LIBGDIAGNOSTICS_ABI_3.   

References FAIL_IF_NULL, and diagnostic_manager::take_global_graph().

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

◆ diagnostic_manager_write_patch()

void diagnostic_manager_write_patch ( diagnostic_manager * diag_mgr,
FILE * dst_stream )
Public entrypoint.   
Write a patch to DST_STREAM consisting of all fix-it hints
on all diagnostics that have been finished on DIAG_MGR.   

References FAIL_IF_NULL, and diagnostic_manager::write_patch().

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

◆ diagnostic_message_buffer_append_byte()

void diagnostic_message_buffer_append_byte ( diagnostic_message_buffer * msg_buf,
char ch )
Public entrypoint.   
Append a byte to to the buffer.  This should be either
ASCII, or part of UTF-8 encoded text.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back_byte().

Referenced by libgdiagnostics::message_buffer::operator+=().

◆ diagnostic_message_buffer_append_event_id()

void diagnostic_message_buffer_append_event_id ( diagnostic_message_buffer * msg_buf,
diagnostic_event_id event_id )
Public entrypoint.   
Append a diagnostic_event_id to the buffer in the form "(1)".
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_append_printf()

void diagnostic_message_buffer_append_printf ( diagnostic_message_buffer * msg_buf,
const char * fmt,
... )

◆ diagnostic_message_buffer_append_str()

void diagnostic_message_buffer_append_str ( diagnostic_message_buffer * msg_buf,
const char * p )
Append a UTF-8 encoded null-terminated string to the buffer.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back_text().

Referenced by libgdiagnostics::message_buffer::operator+=().

◆ diagnostic_message_buffer_append_text()

void diagnostic_message_buffer_append_text ( diagnostic_message_buffer * msg_buf,
const char * p,
size_t len )
Public entrypoint.   
Append a UTF-8 encoded run of bytes to the buffer.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back_text().

◆ diagnostic_message_buffer_begin_color()

void diagnostic_message_buffer_begin_color ( diagnostic_message_buffer * msg_buf,
const char * color )
Public entrypoint.   
Begin a run of text to be printed with color.
Added in LIBGDIAGNOSTICS_ABI_4.   

References color(), FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_begin_quote()

void diagnostic_message_buffer_begin_quote ( diagnostic_message_buffer * msg_buf)
Public entrypoint.   
Begin a run of text to be printed in quotes.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_begin_url()

void diagnostic_message_buffer_begin_url ( diagnostic_message_buffer * msg_buf,
const char * url )
Public entrypoint.   
Begin a run of text associated with the given URL.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by libgdiagnostics::message_buffer::begin_url(), and diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_dump()

void diagnostic_message_buffer_dump ( const diagnostic_message_buffer * msg_buf,
FILE * outf )
Public entrypoint.   
Write a debugging representation of MSG_BUG to OUTF.
Added in LIBGDIAGNOSTICS_ABI_4.   

References pp_token_list::dump(), FAIL_IF_NULL, and pretty_print_token_buffer::m_tokens.

Referenced by diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_end_color()

void diagnostic_message_buffer_end_color ( diagnostic_message_buffer * msg_buf)
Public entrypoint.   
End a run of text started with diagnostic_message_buffer_begin_color.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_end_quote()

void diagnostic_message_buffer_end_quote ( diagnostic_message_buffer * msg_buf)
Public entrypoint.   
End a run of text started with diagnostic_message_buffer_begin_quote.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by diagnostic_message_buffer_append_printf().

◆ diagnostic_message_buffer_end_url()

void diagnostic_message_buffer_end_url ( diagnostic_message_buffer * msg_buf)
Public entrypoint.   
End a run of text started with diagnostic_message_buffer_begin_url.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, pretty_print_token_buffer::m_tokens, and pp_token_list::push_back().

Referenced by diagnostic_message_buffer_append_printf(), and libgdiagnostics::message_buffer::end_url().

◆ diagnostic_message_buffer_new()

diagnostic_message_buffer * diagnostic_message_buffer_new ( void )
Public entrypoint.   
Create a new diagnostic_message_buffer.
Added in LIBGDIAGNOSTICS_ABI_4.   

◆ diagnostic_message_buffer_release()

void diagnostic_message_buffer_release ( diagnostic_message_buffer * msg_buf)
Public entrypoint.   
Release a diagnostic_message_buffer that hasn't been used.
Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL.

Referenced by libgdiagnostics::message_buffer::operator=(), and libgdiagnostics::message_buffer::~message_buffer().

◆ diagnostic_node_set_label()

void diagnostic_node_set_label ( diagnostic_node * node,
const char * label )
Public entrypoint.   
Set the label of NODE for use
in the value of the SARIF "label" property
(SARIF v2.1.0 section 3.40.3).
Added in LIBGDIAGNOSTICS_ABI_3.   

References FAIL_IF_NULL.

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

◆ diagnostic_node_set_label_via_msg_buf()

void diagnostic_node_set_label_via_msg_buf ( diagnostic_node * node,
diagnostic_message_buffer * label )
Public entrypoint.   
Set the label of NODE for use
in the value of the SARIF "label" property
(SARIF v2.1.0 section 3.40.3).

Takes ownership of LABEL, if non-null.

Added in LIBGDIAGNOSTICS_ABI_4.   

References FAIL_IF_NULL, and pretty_print_token_buffer::to_string().

Referenced by diagnostic_message_buffer_append_printf(), and libgdiagnostics::node::set_label().

◆ diagnostic_node_set_location()

void diagnostic_node_set_location ( diagnostic_node * node,
const diagnostic_physical_location * loc )
Public entrypoint.   
Set the physical location of NODE.
Added in LIBGDIAGNOSTICS_ABI_3.   

References FAIL_IF_NULL, diagnostic_physical_location::m_inner, and UNKNOWN_LOCATION.

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

◆ diagnostic_node_set_logical_location()

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

References FAIL_IF_NULL, and impl_logical_location_manager::key_from_ptr().

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)
Public entrypoint.   
Get the diagnostic_file associated with PHYSICAL_LOC.   

References diagnostic_physical_location::get_file().

Referenced by diagnostic_finish_va(), and libgdiagnostics::physical_location::get_file().

◆ diagnostic_set_cwe()

void diagnostic_set_cwe ( diagnostic * diag,
unsigned cwe_id )
Public entrypoint.   
Associate this diagnostic with the given ID within
the Common Weakness Enumeration.   

References FAIL_IF_NULL, and diagnostic::set_cwe().

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

◆ diagnostic_set_location()

void diagnostic_set_location ( diagnostic * diag,
const diagnostic_physical_location * loc )

◆ diagnostic_set_logical_location()

void diagnostic_set_logical_location ( diagnostic * diag,
const diagnostic_logical_location * logical_loc )
Public entrypoint.   
Set the logical location of DIAG.   

References FAIL_IF_NULL, and diagnostic::set_logical_location().

Referenced by diagnostic_set_location_with_label(), and libgdiagnostics::diagnostic::set_logical_location().

◆ diagnostic_take_execution_path()

void diagnostic_take_execution_path ( diagnostic * diag,
diagnostic_execution_path * path )
extern
Public entrypoint.   
Set DIAG to use PATH as its execution path, taking ownership of PATH.   

References FAIL_IF_NULL, path, and diagnostic::take_execution_path().

Referenced by diagnostic_set_location_with_label(), and libgdiagnostics::diagnostic::take_execution_path().

◆ 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 )
Public entrypoint.   
Update colorization of text sink.   

References FAIL_IF_NULL, and diagnostic_text_sink::set_colorize().

Referenced by libgdiagnostics::text_sink::set_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 )
Public entrypoint.   
Enable/disable colorization of the characters of source text
that are underlined.
This should be true for clients that generate range information
(so that the ranges of code are colorized),
and false for clients that merely specify points within the
source code (to avoid e.g. colorizing just the first character in
a token, which would look strange).
Default: enabled.   

References diagnostics::source_printing_options::colorize_source_p, FAIL_IF_NULL, and diagnostic_text_sink::get_source_printing_options().

Referenced by libgdiagnostics::text_sink::set_labelled_source_colorization_enabled().

◆ diagnostic_text_sink_set_source_printing_enabled()

void diagnostic_text_sink_set_source_printing_enabled ( diagnostic_text_sink * text_sink,
int value )
Public entrypoint.   
Functions to manipulate text sinks.   
Enable/disable printing of source text in the text sink.
Default: enabled.   

References diagnostics::source_printing_options::enabled, FAIL_IF_NULL, and diagnostic_text_sink::get_source_printing_options().

Referenced by libgdiagnostics::text_sink::set_source_printing_enabled().

◆ diagnostics_kind_from_diagnostic_level()

◆ private_diagnostic_edge_set_property_bag()

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

◆ private_diagnostic_execution_path_add_event_3()

diagnostic_event_id private_diagnostic_execution_path_add_event_3 ( diagnostic_execution_path * path,
const diagnostic_physical_location * physical_loc,
const diagnostic_logical_location * logical_loc,
unsigned stack_depth,
diagnostic_graph * state_graph,
diagnostic_message_buffer * msg_buf )
Private entrypoint.   
Entrypoint added in LIBGDIAGNOSTICS_ABI_4.   

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.   
Private entrypoints, for use only by sarif-replay.
These are subject to removal without notice.   
Entrypoints added in LIBGDIAGNOSTICS_ABI_3.   

◆ private_diagnostic_node_set_property_bag()

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

◆ private_diagnostic_set_nesting_level()

void private_diagnostic_set_nesting_level ( diagnostic * diag,
int nesting_level )
Private entrypoint.   
Entrypoint added in LIBGDIAGNOSTICS_ABI_5.   

References FAIL_IF_NULL, and diagnostic::set_nesting_level().

◆ round_alloc_size()

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

Referenced by diagnostic_manager::diagnostic_manager().