]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/doc/analyzer.texi
analyzer: add region::is_named_decl_p
[thirdparty/gcc.git] / gcc / doc / analyzer.texi
index 657798101c2bd761ad8ab45bb69dded6ef754ec5..62faac44d7f267ac623d9359c6c5fb8d947fb263 100644 (file)
@@ -545,3 +545,13 @@ and the exploded graph in compressed JSON form.
 One approach when tracking down where a particular bogus state is
 introduced into the @code{exploded_graph} is to add custom code to
 @code{program_state::validate}.
+
+The debug function @code{region::is_named_decl_p} can be used when debugging,
+such as for assertions and conditional breakpoints.  For example, when
+tracking down a bug in handling a decl called @code{yy_buffer_stack}, I
+temporarily added a:
+@smallexample
+  gcc_assert (!m_base_region->is_named_decl_p ("yy_buffer_stack"));
+@end smallexample
+to @code{binding_cluster::mark_as_escaped} to trap a point where
+@code{yy_buffer_stack} was mistakenly being treated as having escaped.