GCC Middle and Back End API Reference
custom-sarif-properties/state-graphs.h
Go to the documentation of this file.
1/* Properties for capturing state graphs in SARIF property bags.
2 Copyright (C) 2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#include "json.h"
22
23#ifndef GCC_DIAGNOSTICS_SARIF_PROPERTIES_STATE_GRAPHS_H
24#define GCC_DIAGNOSTICS_SARIF_PROPERTIES_STATE_GRAPHS_H
25
26/* SARIF property names relating to GCC's CFGs. */
27
29 namespace state_graphs {
30 namespace graph {
31 extern const char *const prefix;
32 }
33 namespace node {
34
35 enum class kind_t
36 {
37 // Memory regions
40 function, // code within a particular function
45
46 /* Dynamically-allocated buffer,
47 on heap or stack (depending on parent). */
49
51
52 field, // field within a struct or union
53 padding, // padding bits in a struct or union
54 element, // element within an array
55
56 other // anything else
57 };
58
66
68
71 extern const json::string_property name;
72 extern const json::string_property type;
73 /* The value of a memory region, expressed as a json::value. */
74 extern const json::json_property value;
75 /* The value of a memory region, expressed as a string. */
77
78 /* For element nodes, the index within the array. */
79 extern const json::string_property index;
80
81 /* The range of bits or bytes within the base region. */
82 extern const json::string_property bits;
83
84 /* The size of a padding region. */
86
91 }
92 namespace edge {
93 extern const char *const prefix;
94 }
95 }
96}
97
98#endif /* ! GCC_DIAGNOSTICS_SARIF_PROPERTIES_STATE_GRAPHS_H */
Definition custom-sarif-properties/state-graphs.h:92
const char *const prefix
Definition state-graphs.cc:70
Definition custom-sarif-properties/state-graphs.h:30
Definition custom-sarif-properties/state-graphs.h:33
dynalloc_state_t
Definition custom-sarif-properties/state-graphs.h:60
@ nonnull
Definition custom-sarif-properties/state-graphs.h:62
@ freed
Definition custom-sarif-properties/state-graphs.h:64
@ unchecked
Definition custom-sarif-properties/state-graphs.h:63
@ unknown
Definition custom-sarif-properties/state-graphs.h:61
const json::string_property num_bits
const json::enum_property< enum kind_t > kind_prop
const json::string_property deallocator
const json::string_property dynamic_extents
const json::string_property function
const json::string_property expected_deallocators
const json::string_property value_str
const json::enum_property< enum dynalloc_state_t > dynalloc_state_prop
kind_t
Definition custom-sarif-properties/state-graphs.h:36
@ field
Definition custom-sarif-properties/state-graphs.h:52
@ globals
Definition custom-sarif-properties/state-graphs.h:38
@ heap_
Definition custom-sarif-properties/state-graphs.h:43
@ stack_frame
Definition custom-sarif-properties/state-graphs.h:42
@ other
Definition custom-sarif-properties/state-graphs.h:56
@ thread_local_
Definition custom-sarif-properties/state-graphs.h:44
@ dynalloc_buffer
Definition custom-sarif-properties/state-graphs.h:48
@ element
Definition custom-sarif-properties/state-graphs.h:54
@ padding
Definition custom-sarif-properties/state-graphs.h:53
@ code
Definition custom-sarif-properties/state-graphs.h:39
@ variable
Definition custom-sarif-properties/state-graphs.h:50
@ stack
Definition custom-sarif-properties/state-graphs.h:41
Definition custom-sarif-properties/state-graphs.h:29
Definition custom-sarif-properties/digraphs.h:26
property< value > json_property
Definition json.h:140
property< string > string_property
Definition json.h:137
property< enum_traits< EnumType > > enum_property
Definition json.h:154
Definition function.h:249
Definition gengtype.h:252