GCC Middle and Back End API Reference
libsarifreplay.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "make-unique.h"
#include "libgdiagnostics++.h"
#include "json-parsing.h"
#include "intl.h"
#include "sarif-spec-urls.def"
#include "libsarifreplay.h"
#include "label-text.h"
Include dependency graph for libsarifreplay.cc:

Macros

#define INCLUDE_VECTOR
 
#define INCLUDE_MAP
 
#define INCLUDE_STRING
 
#define SECTION_SIGN_UTF8   "\xC2\xA7"
 
#define PROP_sarifLog_version    property_spec_ref ("sarifLog", "version", "3.13.2")
 
#define PROP_sarifLog_runs    property_spec_ref ("sarifLog", "runs", "3.13.4")
 
#define PROP_result_ruleId    property_spec_ref ("result", "ruleId", "3.27.5")
 
#define PROP_result_message    property_spec_ref ("result", "message", "3.27.11")
 
#define PROP_message_text    property_spec_ref ("message", "text", "3.11.8")
 
#define PROP_message_id    property_spec_ref ("message", "id", "3.11.10")
 
#define FAIL_IF_NULL(PTR_ARG)
 

Functions

int sarif_replay_path (const char *sarif_file, diagnostic_manager *output_manager, diagnostic_manager *control_manager, const replay_options *options)
 

Macro Definition Documentation

◆ FAIL_IF_NULL

#define FAIL_IF_NULL ( PTR_ARG)
Value:
do { \
GCC_DIAGNOSTIC_PUSH_IGNORED(-Wnonnull-compare) \
if (!(PTR_ARG)) { \
fprintf (stderr, "%s: %s must be non-NULL\n", \
__func__, #PTR_ARG); \
abort (); \
} \
} while (0)
#define GCC_DIAGNOSTIC_POP
Definition system.h:1227
Error-checking at the API boundary.   

◆ INCLUDE_MAP

#define INCLUDE_MAP

◆ INCLUDE_STRING

#define INCLUDE_STRING

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR
A library for re-emitting diagnostics saved in SARIF form
   via libgdiagnostics.
   Copyright (C) 2022-2024 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/>.   

◆ PROP_message_id

#define PROP_message_id    property_spec_ref ("message", "id", "3.11.10")

◆ PROP_message_text

#define PROP_message_text    property_spec_ref ("message", "text", "3.11.8")

◆ PROP_result_message

#define PROP_result_message    property_spec_ref ("result", "message", "3.27.11")

◆ PROP_result_ruleId

#define PROP_result_ruleId    property_spec_ref ("result", "ruleId", "3.27.5")
Process a result object (SARIF v2.1.0 section 3.27).
  Known limitations:
  - doesn't yet handle "ruleIndex" property (§3.27.6)
  - doesn't yet handle "taxa" property (§3.27.8)
  - handling of "level" property (§3.27.10) doesn't yet support the
    full logic for when "level" is absent.
  - doesn't yet handle "relatedLocations" property (§3.27.22)
  - doesn't yet handle "fixes" property (§3.27.30)
  - doesn't yet support multithreaded flows (§3.36.3)

◆ PROP_sarifLog_runs

#define PROP_sarifLog_runs    property_spec_ref ("sarifLog", "runs", "3.13.4")

◆ PROP_sarifLog_version

#define PROP_sarifLog_version    property_spec_ref ("sarifLog", "version", "3.13.2")

◆ SECTION_SIGN_UTF8

#define SECTION_SIGN_UTF8   "\xC2\xA7"

Function Documentation

◆ sarif_replay_path()

int sarif_replay_path ( const char * sarif_file,
diagnostic_manager * output_manager,
diagnostic_manager * control_manager,
const replay_options * options )
Public entrypoint.   

References FAIL_IF_NULL, and r.

Referenced by main().