diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-01-07 13:36:00 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2022-01-07 19:04:01 -0500 |
commit | 4409152a4acaec5b58a93996088d0df9aaa779b8 (patch) | |
tree | 53dd517ebdc4f47e9ef3dce3bfa1f55a30818042 /gcc/doc | |
parent | c1b7d28a5987e74232b7f054849f8bd8ccc7e7de (diff) | |
download | gcc-4409152a4acaec5b58a93996088d0df9aaa779b8.zip gcc-4409152a4acaec5b58a93996088d0df9aaa779b8.tar.gz gcc-4409152a4acaec5b58a93996088d0df9aaa779b8.tar.bz2 |
analyzer: implement __analyzer_dump_escaped
PR analyzer/103546 seems to involve an issue in how the analyzer
tracks which decls have escaped, so this patch adds a way to directly
test this from DejaGnu.
gcc/analyzer/ChangeLog:
* region-model-impl-calls.cc (cmp_decls): New.
(cmp_decls_ptr_ptr): New.
(region_model::impl_call_analyzer_dump_escaped): New.
* region-model.cc (region_model::on_stmt_pre): Handle
__analyzer_dump_escaped.
* region-model.h (region_model::impl_call_analyzer_dump_escaped):
New decl.
* store.h (binding_cluster::get_base_region): New accessor.
gcc/ChangeLog:
* doc/analyzer.texi
(Special Functions for Debugging the Analyzer): Document
__analyzer_dump_escaped.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/analyzer-decls.h (__analyzer_dump_escaped): New
decl.
* gcc.dg/analyzer/escaping-1.c: New test.
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/analyzer.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/doc/analyzer.texi b/gcc/doc/analyzer.texi index 62faac4..06eb98f 100644 --- a/gcc/doc/analyzer.texi +++ b/gcc/doc/analyzer.texi @@ -487,6 +487,14 @@ will emit a warning describing the capacity of the base region of the region pointed to by the 1st argument. @smallexample +extern void __analyzer_dump_escaped (void); +@end smallexample + +will emit a warning giving the number of decls that have escaped on this +analysis path, followed by a comma-separated list of their names, +in alphabetical order. + +@smallexample __analyzer_dump_path (); @end smallexample |