GCC Middle and Back End API Reference
sarif-replay.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "version.h"
#include "intl.h"
#include "libgdiagnostics++.h"
#include "libsarifreplay.h"
Include dependency graph for sarif-replay.cc:

Data Structures

struct  options
 

Macros

#define INCLUDE_VECTOR
 

Functions

static void set_defaults (replay_options &replay_opts)
 
static void print_version ()
 
static void print_usage ()
 
static bool parse_options (int argc, char **argv, options &opts, libgdiagnostics::text_sink control_text_sink)
 
static const char * get_progname (const char *argv0)
 
int main (int argc, char **argv)
 

Variables

static const char * progname
 
static const char *const usage_msg
 

Macro Definition Documentation

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR
A program for re-emitting diagnostics saved in SARIF form.
   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/>.   

Function Documentation

◆ get_progname()

static const char * get_progname ( const char * argv0)
static

Referenced by main().

◆ main()

◆ parse_options()

◆ print_usage()

static void print_usage ( void )
static

References usage_msg.

Referenced by main(), and parse_options().

◆ print_version()

static void print_version ( void )
static

References _, and progname.

Referenced by parse_options().

◆ set_defaults()

Variable Documentation

◆ progname

const char* progname
static

Referenced by main(), and print_version().

◆ usage_msg

const char* const usage_msg
static
Initial value:
= (
"sarif-replay [OPTIONS] FILE+\n"
"\n"
" \"Replay\" results from one or more .sarif files as if they were\n"
" GCC diagnostics\n"
"\n"
"Options:\n"
"\n"
" -fdiagnostics-color={never|always|auto}\n"
" Control colorization of diagnostics. Default: auto.\n"
"\n"
" -fjson-comments\n"
" Support C and C++ style comments in .sarif JSON files\n"
"\n"
" --verbose\n"
" Print notes about each .sarif file before and after replaying it.\n"
"\n"
" --echo-file\n"
" Print the filename and file contents to stderr before replaying it.\n"
"\n"
" -v, --version\n"
" Print version and exit.\n"
"\n"
" --usage\n"
" Print this message and exit.\n"
"\n")

Referenced by print_usage().