From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EF55A383868A for ; Fri, 9 Dec 2022 02:29:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF55A383868A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670552978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZS6Pz8JW/okKGj07vj00oim0pjNDOeoFtYSa3WEchLE=; b=DBkb0YBdeL7Xr0NMVI99J1ktEme88P3nofGc7io6sJtS3aeBn/CqPy3b7WTUFmHURKsAeg 8Xc5qzgvkFnRzdl0bf/7Lv/08x9i5jhpsBSOaSxp5jucwiy40Vc5mNl/pygZ6GwPEh7pHG rqlKNkSXNAB8afTudcJc9ZS9RZ3mAuY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-450-01DdG8j8MeqsHKJIO4X4Ug-1; Thu, 08 Dec 2022 21:29:36 -0500 X-MC-Unique: 01DdG8j8MeqsHKJIO4X4Ug-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D1CC803B38 for ; Fri, 9 Dec 2022 02:29:36 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.2.17.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 663531401C3A; Fri, 9 Dec 2022 02:29:36 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [committed] analyzer: rename region-model-impl-calls.cc to kf.cc Date: Thu, 8 Dec 2022 21:29:33 -0500 Message-Id: <20221209022933.32326-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-4579-g63a42ffc083355. 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 --- 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(-) rename gcc/analyzer/{region-model-impl-calls.cc => kf.cc} (100%) 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: -- 2.26.3