calls.c: refactor special_function_p for use by analyzer (v2)
authorDavid Malcolm <dmalcolm@redhat.com>
Sun, 26 Jan 2020 23:40:43 +0000 (18:40 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 31 Jan 2020 14:00:57 +0000 (09:00 -0500)
commit182ce042e7325a05a87fb34d2eaf6db3666fbd7f
treed9b9ba23a26d11ec85cf122c6d369c6c1b53c4e8
parent45eb3e4944ba93b1d4e9070c703068cfa7aaace4
calls.c: refactor special_function_p for use by analyzer (v2)

This patch refactors some code in special_function_p that checks for
the function being sane to match by name, splitting it out into a new
maybe_special_function_p, and using it it two places in the analyzer.

gcc/analyzer/ChangeLog:
* analyzer.cc (is_named_call_p): Replace tests for fndecl being
extern at file scope and having a non-NULL DECL_NAME with a call
to maybe_special_function_p.
* function-set.cc (function_set::contains_decl_p): Add call to
maybe_special_function_p.

gcc/ChangeLog:
* calls.c (special_function_p): Split out the check for DECL_NAME
being non-NULL and fndecl being extern at file scope into a
new maybe_special_function_p and call it.  Drop check for fndecl
being non-NULL that was after a usage of DECL_NAME (fndecl).
* tree.h (maybe_special_function_p): New inline function.
gcc/ChangeLog
gcc/analyzer/ChangeLog
gcc/analyzer/analyzer.cc
gcc/analyzer/function-set.cc
gcc/calls.c
gcc/tree.h