From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2209) id 0C0AA3831E73; Fri, 9 Dec 2022 02:20:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C0AA3831E73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670552452; bh=mbLQVgRI5wcez3pzQDiPbVcMkDJn/svhQ5/or70brBU=; h=From:To:Subject:Date:From; b=ZVNsNTpMqY3bkDk1QOvAJMRrABOMI50/+1QmqK3uxV6/QlL0q7OoJy84eKqkxRYkD qrKauuWJ5JtRBVLdSK70MJjdWUAhENPZpdktBsgUql4mgISF3Yq4F8NQM41PSqLYL/ uSCWLXyPUGzENgbc2Qw5Rw7JOnWoQcBEevUMT6DM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: David Malcolm To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4579] analyzer: rename region-model-impl-calls.cc to kf.cc X-Act-Checkin: gcc X-Git-Author: David Malcolm X-Git-Refname: refs/heads/master X-Git-Oldrev: 7dc0ecafe60b224b3343667f55eaaa501f390925 X-Git-Newrev: 63a42ffc0833553fbcb84b50cf0fd2d867b8a92f Message-Id: <20221209022052.0C0AA3831E73@sourceware.org> Date: Fri, 9 Dec 2022 02:20:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:63a42ffc0833553fbcb84b50cf0fd2d867b8a92f commit r13-4579-g63a42ffc0833553fbcb84b50cf0fd2d867b8a92f Author: David Malcolm Date: Thu Dec 8 21:19:24 2022 -0500 analyzer: rename region-model-impl-calls.cc to kf.cc gcc/ChangeLog: * Makefile.in (ANALYZER_OBJS): Update for renaming of analyzer/region-model-impl-calls.cc to analyzer/kf.cc. gcc/analyzer/ChangeLog: * analyzer.h (class known_function): Expand comment. * region-model-impl-calls.cc: Rename to... * kf.cc: ...this. * known-function-manager.h (class known_function_manager): Add leading comment. Signed-off-by: David Malcolm Diff: --- gcc/Makefile.in | 2 +- gcc/analyzer/analyzer.h | 3 ++- gcc/analyzer/{region-model-impl-calls.cc => kf.cc} | 0 gcc/analyzer/known-function-manager.h | 12 ++++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7bcc5e501de..995d77f96c4 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1269,6 +1269,7 @@ ANALYZER_OBJS = \ analyzer/feasible-graph.o \ analyzer/function-set.o \ analyzer/infinite-recursion.o \ + analyzer/kf.o \ analyzer/kf-analyzer.o \ analyzer/kf-lang-cp.o \ analyzer/known-function-manager.o \ @@ -1278,7 +1279,6 @@ ANALYZER_OBJS = \ analyzer/region.o \ analyzer/region-model.o \ analyzer/region-model-asm.o \ - analyzer/region-model-impl-calls.o \ analyzer/region-model-manager.o \ analyzer/region-model-reachability.o \ analyzer/sm.o \ diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h index 418d4210755..19e5b9011fe 100644 --- a/gcc/analyzer/analyzer.h +++ b/gcc/analyzer/analyzer.h @@ -229,7 +229,8 @@ extern location_t get_stmt_location (const gimple *stmt, function *fun); extern bool compat_types_p (tree src_type, tree dst_type); /* Abstract base class for simulating the behavior of known functions, - supplied by the core of the analyzer, or by plugins. */ + supplied by the core of the analyzer, or by plugins. + The former are typically implemented in the various kf*.cc */ class known_function { diff --git a/gcc/analyzer/region-model-impl-calls.cc b/gcc/analyzer/kf.cc similarity index 100% rename from gcc/analyzer/region-model-impl-calls.cc rename to gcc/analyzer/kf.cc diff --git a/gcc/analyzer/known-function-manager.h b/gcc/analyzer/known-function-manager.h index 188cb8e034a..7bacafe8e24 100644 --- a/gcc/analyzer/known-function-manager.h +++ b/gcc/analyzer/known-function-manager.h @@ -25,6 +25,18 @@ along with GCC; see the file COPYING3. If not see namespace ana { +/* Instances of known_function are registered with the known_function_manager + when the analyzer starts. + + The known_function_manager has responsibility for determining which + known_function instance (if any) is relevant at a call site, by checking + name or id, and by calling known_function::matches_call_types_p to ensure + that the known_function's preconditions hold (typically assumptions about + types e.g. that "has 3 args, and that arg 0 is of pointer type"). + + The known_function subclasses themselves have responsibility for + determining the outcome(s) of the call. */ + class known_function_manager : public log_user { public: