| 1 |
#ifndef ANALYZER_DECLS_H |
| 2 |
#define ANALYZER_DECLS_H |
| 3 |
|
| 4 |
#ifndef NULL |
| 5 |
#ifdef __cplusplus |
| 6 |
#if __cplusplus >= 201103L |
| 7 |
#define NULL nullptr |
| 8 |
#else |
| 9 |
#define NULL 0 |
| 10 |
#endif |
| 11 |
#else |
| 12 |
#define NULL ((void *)0) |
| 13 |
#endif |
| 14 |
#endif |
| 15 |
|
| 16 |
/* Function decls with special meaning to the analyzer. |
| 17 |
None of these are actually implemented. */ |
| 18 |
|
| 19 |
/* Trigger a breakpoint in the analyzer when reached. */ |
| 20 |
extern void __analyzer_break (void); |
| 21 |
|
| 22 |
/* Emit a warning describing the 2nd argument (which can be of any |
| 23 |
type), at the given verbosity level. This is for use when |
| 24 |
debugging, and may be of use in DejaGnu tests. */ |
| 25 |
extern void __analyzer_describe (int verbosity, ...); |
| 26 |
|
| 27 |
/* Dump copious information about the analyzer’s state when reached. */ |
| 28 |
extern void __analyzer_dump (void); |
| 29 |
|
| 30 |
/* Emit a warning describing the size of the base region of (*ptr). */ |
| 31 |
extern void __analyzer_dump_capacity (const void *ptr); |
| 32 |
|
| 33 |
/* Dump information about what decls have escaped at this point on the path. */ |
| 34 |
extern void __analyzer_dump_escaped (void); |
| 35 |
|
| 36 |
/* Dump information after analysis on all of the exploded nodes at this |
| 37 |
program point. |
| 38 |
|
| 39 |
__analyzer_dump_exploded_nodes (0); |
| 40 |
will dump just the number of nodes, and their IDs. |
| 41 |
|
| 42 |
__analyzer_dump_exploded_nodes (1); |
| 43 |
will also dump all of the states within those nodes. */ |
| 44 |
extern void __analyzer_dump_exploded_nodes (int); |
| 45 |
|
| 46 |
/* Emit a warning describing what is known about the value of NAME. */ |
| 47 |
extern void __analyzer_dump_named_constant (const char *name); |
| 48 |
|
| 49 |
/* Emit a placeholder "note" diagnostic with a path to this call site, |
| 50 |
if the analyzer finds a feasible path to it. */ |
| 51 |
extern void __analyzer_dump_path (void); |
| 52 |
|
| 53 |
/* Dump the region_model's state to stderr. */ |
| 54 |
extern void __analyzer_dump_region_model (void); |
| 55 |
|
| 56 |
/* Emit a warning describing the state of the 2nd argument |
| 57 |
(which can be of any type) with respect to NAME. |
| 58 |
This is for use when debugging, and may be of use in DejaGnu tests. */ |
| 59 |
extern void __analyzer_dump_state (const char *name, ...); |
| 60 |
|
| 61 |
/* Emit a warning with text "TRUE", FALSE" or "UNKNOWN" based on the |
| 62 |
truthfulness of the argument. */ |
| 63 |
extern void __analyzer_eval (int); |
| 64 |
|
| 65 |
/* Obtain an "unknown" void *. */ |
| 66 |
extern void *__analyzer_get_unknown_ptr (void); |
| 67 |
|
| 68 |
/* Complain if PTR doesn't point to a null-terminated string. |
| 69 |
TODO: eventually get the strlen of the buffer (without the |
| 70 |
optimizer touching it). */ |
| 71 |
extern __SIZE_TYPE__ __analyzer_get_strlen (const char *ptr); |
| 72 |
|
| 73 |
#endif /* #ifndef ANALYZER_DECLS_H. */ |