| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef GCC_DIAGNOSTIC_FORMAT_SARIF_H |
| 22 |
#define GCC_DIAGNOSTIC_FORMAT_SARIF_H |
| 23 |
|
| 24 |
#include "json.h" |
| 25 |
#include "diagnostic-format.h" |
| 26 |
#include "diagnostic-output-file.h" |
| 27 |
|
| 28 |
class logical_location; |
| 29 |
|
| 30 |
enum class sarif_version |
| 31 |
{ |
| 32 |
v2_1_0, |
| 33 |
v2_2_prerelease_2024_08_08, |
| 34 |
|
| 35 |
num_versions |
| 36 |
}; |
| 37 |
|
| 38 |
extern diagnostic_output_file |
| 39 |
diagnostic_output_format_open_sarif_file (diagnostic_context &context, |
| 40 |
line_maps *line_maps, |
| 41 |
const char *base_file_name); |
| 42 |
|
| 43 |
extern void |
| 44 |
diagnostic_output_format_init_sarif_stderr (diagnostic_context &context, |
| 45 |
const line_maps *line_maps, |
| 46 |
const char *main_input_filename_, |
| 47 |
bool formatted, |
| 48 |
enum sarif_version version); |
| 49 |
extern void |
| 50 |
diagnostic_output_format_init_sarif_file (diagnostic_context &context, |
| 51 |
line_maps *line_maps, |
| 52 |
const char *main_input_filename_, |
| 53 |
bool formatted, |
| 54 |
enum sarif_version version, |
| 55 |
const char *base_file_name); |
| 56 |
extern void |
| 57 |
diagnostic_output_format_init_sarif_stream (diagnostic_context &context, |
| 58 |
const line_maps *line_maps, |
| 59 |
const char *main_input_filename_, |
| 60 |
bool formatted, |
| 61 |
enum sarif_version version, |
| 62 |
FILE *stream); |
| 63 |
extern std::unique_ptr<diagnostic_output_format> |
| 64 |
make_sarif_sink (diagnostic_context &context, |
| 65 |
const line_maps &line_maps, |
| 66 |
const char *main_input_filename_, |
| 67 |
enum sarif_version version, |
| 68 |
diagnostic_output_file output_file); |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
class sarif_property_bag : public json::object |
| 74 |
{ |
| 75 |
}; |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
class sarif_object : public json::object |
| 84 |
{ |
| 85 |
public: |
| 86 |
sarif_property_bag &get_or_create_properties (); |
| 87 |
}; |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
class sarif_logical_location : public sarif_object |
| 93 |
{ |
| 94 |
}; |
| 95 |
|
| 96 |
extern std::unique_ptr<sarif_logical_location> |
| 97 |
make_sarif_logical_location_object (const logical_location &logical_loc); |
| 98 |
|
| 99 |
#endif |