public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: law@redhat.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 41/49] analyzer: new files: program-point.{cc|h}
Date: Wed, 11 Dec 2019 19:58:00 -0000	[thread overview]
Message-ID: <857c07b1bc70eafd8047f4fed112285140d5ce0a.camel@redhat.com> (raw)
In-Reply-To: <4819b62cd469bf9e4071c1e6f4bd58848918bcd5.camel@redhat.com>

On Wed, 2019-12-11 at 12:54 -0700, Jeff Law wrote:
> On Fri, 2019-11-15 at 20:23 -0500, David Malcolm wrote:
> > This patch introduces function_point and program_point, classes
> > for tracking locations within the program (the latter adding
> > a call_string for tracking interprocedural location).
> > 
> > gcc/ChangeLog:
> > 	* analyzer/program-point.cc: New file.
> > 	* analyzer/program-point.h: New file.
> > ---
> > 
> > 
> > diff --git a/gcc/analyzer/program-point.h b/gcc/analyzer/program-
> > point.h
> > new file mode 100644
> > index 0000000..ad7b9cd
> > --- /dev/null
> > +++ b/gcc/analyzer/program-point.h
> > @@ -0,0 +1,316 @@
> > +/* Classes for representing locations within the program.
> > +   Copyright (C) 2019 Free Software Foundation, Inc.
> > +   Contributed by David Malcolm <dmalcolm@redhat.com>.
> > +
> > +This file is part of GCC.
> > +
> > +GCC is free software; you can redistribute it and/or modify it
> > +under the terms of the GNU General Public License as published by
> > +the Free Software Foundation; either version 3, or (at your
> > option)
> > +any later version.
> > +
> > +GCC is distributed in the hope that it will be useful, but
> > +WITHOUT ANY WARRANTY; without even the implied warranty of
> > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > +General Public License for more details.
> > +
> > +You should have received a copy of the GNU General Public License
> > +along with GCC; see the file COPYING3.  If not see
> > +<http://www.gnu.org/licenses/>;;.  */
> > +
> > +#ifndef GCC_ANALYZER_PROGRAM_POINT_H
> > +#define GCC_ANALYZER_PROGRAM_POINT_H
> > +
> > +#include "analyzer/call-string.h"
> > +#include "analyzer/supergraph.h"
> > +
> > +class exploded_graph;
> > +
> > +/* An enum for distinguishing the various kinds of
> > program_point.  */
> > +
> > +enum point_kind {
> > +  /* A "fake" node which has edges to all entrypoints.  */
> > +  PK_ORIGIN,
> > +
> > +  PK_BEFORE_SUPERNODE,
> > +  PK_BEFORE_STMT,
> > +  PK_AFTER_SUPERNODE,
> > +
> > +  /* Special values used for hash_map:  */
> > +  PK_EMPTY,
> > +  PK_DELETED,
> > +
> > +  NUM_POINT_KINDS
> > +};
> Isn't this the cause of the hash_map stuff we're discussing with
> Martin?  (PK_EMPTY is a non-zero value)?

Well spotted - the one in sm_state_map in program-state.cc was the one
that I ran into, as it broke a selftest (turning it into an infinite
loop).  But I guess these could be reordered to put PK_EMPTY at the
top, if we're going to require or specialize for that.

> Regardless, I don't see anything there to object to.  We have to nail
> down the hash_map issues though.

Indeed


Dave

  reply	other threads:[~2019-12-11 19:58 UTC|newest]

Thread overview: 160+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16  1:21 [PATCH 00/49] RFC: Add a static analysis framework to GCC David Malcolm
2019-11-16  1:17 ` [PATCH 01/49] analyzer: user-facing documentation David Malcolm
2019-12-06 19:57   ` Eric Gallager
2019-12-07  1:41     ` David Malcolm
2019-12-09  5:36   ` Sandra Loosemore
2019-11-16  1:17 ` [PATCH 09/49] gimple const-correctness fixes David Malcolm
2019-12-04 17:06   ` Martin Sebor
2019-12-06 10:52   ` Richard Biener
2019-12-06 17:47     ` David Malcolm
2019-12-09  8:27       ` Richard Biener
2019-12-07 14:28   ` Jeff Law
2019-12-09  8:18     ` Richard Biener
2019-11-16  1:17 ` [PATCH 11/49] Add diagnostic_metadata and CWE support David Malcolm
2019-12-04 17:36   ` Martin Sebor
2019-12-13  3:00     ` David Malcolm
2019-12-13 16:44       ` Martin Sebor
2019-12-13 17:32         ` David Malcolm
2019-11-16  1:17 ` [PATCH 14/49] hash-map-tests.c: add a selftest involving int_hash David Malcolm
2019-12-07 14:38   ` Jeff Law
2019-11-16  1:17 ` [PATCH 02/49] analyzer: internal documentation David Malcolm
2019-11-16  1:17 ` [PATCH 08/49] Introduce pretty_printer::clone vfunc David Malcolm
2019-12-07 14:36   ` Jeff Law
2019-11-16  1:18 ` [PATCH 35/49] analyzer: new file: sm-file.cc David Malcolm
2019-12-07 15:15   ` Jeff Law
2019-11-16  1:18 ` [PATCH 07/49] Replace label_text ctor with "borrow" and "take" David Malcolm
2019-12-07 14:34   ` Jeff Law
2019-11-16  1:18 ` [PATCH 27/49] analyzer: new files: supergraph.{cc|h} David Malcolm
2019-11-16  1:18 ` [PATCH 36/49] analyzer: new file: sm-pattern-test.cc David Malcolm
2019-12-07 15:16   ` Jeff Law
2019-11-16  1:18 ` [PATCH 16/49] Add support for in-tree plugins David Malcolm
2019-12-06 22:41   ` Eric Gallager
2019-12-07 14:39   ` Jeff Law
2019-12-08 14:32     ` David Malcolm
2019-11-16  1:18 ` [PATCH 33/49] analyzer: new files: sm.{cc|h} David Malcolm
2019-12-11 19:24   ` Jeff Law
2020-01-10  2:28     ` David Malcolm
2019-11-16  1:18 ` [PATCH 05/49] vec.h: add auto_delete_vec David Malcolm
2019-12-04 16:29   ` Martin Sebor
2019-12-18 16:00     ` David Malcolm
2020-01-08 21:52       ` Jeff Law
2019-11-16  1:18 ` [PATCH 28/49] analyzer: new files: analyzer.{cc|h} David Malcolm
2019-12-07  3:38   ` Eric Gallager
2019-12-09 23:22     ` David Malcolm
2019-12-10 19:59       ` Eric Gallager
2019-12-07 15:02   ` Jeff Law
2019-12-11 19:49     ` David Malcolm
2019-12-20  1:21       ` [PATCH 0/4] analyzer: add class function_set and use in various places David Malcolm
2019-12-20  1:22         ` [PATCH 2/4] analyzer: introduce a set of known async-signal-unsafe functions David Malcolm
2019-12-20  1:22         ` [PATCH 1/4] analyzer: add function-set.cc/h David Malcolm
2019-12-20  1:22         ` [PATCH 3/4] analyzer: add known stdio functions to sm-file.cc (PR analyzer/58237) David Malcolm
2019-12-20  6:34         ` [PATCH 4/4] analyzer: add -Wanalyzer-use-of-closed-file David Malcolm
2019-12-10 17:17   ` [PATCH 28/49] analyzer: new files: analyzer.{cc|h} Martin Sebor
2019-11-16  1:18 ` [PATCH 17/49] Support for adding selftests via a plugin David Malcolm
2019-12-07 14:41   ` Jeff Law
2019-12-09 23:18     ` David Malcolm
2019-11-16  1:18 ` [PATCH 29/49] analyzer: new files: tristate.{cc|h} David Malcolm
2019-12-07 15:03   ` Jeff Law
2019-12-09 23:16     ` David Malcolm
2019-12-10  0:59   ` Martin Sebor
2019-11-16  1:18 ` [PATCH 19/49] analyzer: new files: analyzer-selftests.{cc|h} David Malcolm
2019-12-07 14:48   ` Jeff Law
2019-11-16  1:18 ` [PATCH 12/49] Add diagnostic paths David Malcolm
2019-12-07 14:45   ` Jeff Law
2019-12-19  2:49     ` David Malcolm
2019-11-16  1:18 ` [PATCH 30/49] analyzer: new files: constraint-manager.{cc|h} David Malcolm
2019-11-16  1:18 ` [PATCH 21/49] analyzer: command-line options David Malcolm
2019-12-04 18:35   ` Martin Sebor
2019-12-06 18:14     ` Eric Gallager
2019-11-16  1:18 ` [PATCH 24/49] analyzer: new file: analyzer-pass.cc David Malcolm
2019-12-07 14:51   ` Jeff Law
2019-12-08 14:38     ` David Malcolm
2019-11-16  1:18 ` [PATCH 22/49] analyzer: params.def: new parameters David Malcolm
2019-12-07 14:49   ` Jeff Law
2019-12-08  5:42     ` Eric Gallager
2019-12-08 14:34       ` David Malcolm
2019-11-16  1:18 ` [PATCH 32/49] analyzer: new files: pending-diagnostic.{cc|h} David Malcolm
2019-12-07 15:05   ` Jeff Law
2019-12-08 14:43     ` David Malcolm
2019-12-08 22:25       ` Jeff Law
2019-11-16  1:18 ` [PATCH 06/49] timevar.h: add auto_client_timevar class David Malcolm
2019-12-04 16:39   ` Martin Sebor
2019-12-04 17:28     ` Tom Tromey
2019-12-04 21:15       ` David Malcolm
2019-12-07 14:29   ` Jeff Law
2019-12-08 14:30     ` David Malcolm
2019-11-16  1:18 ` [PATCH 23/49] analyzer: logging support David Malcolm
2019-12-04 18:56   ` Martin Sebor
2019-11-16  1:18 ` [PATCH 03/49] diagnostic_show_locus: move initial newline to callers David Malcolm
2019-12-07 14:30   ` Jeff Law
2019-12-10  1:51     ` David Malcolm
2019-11-16  1:18 ` [PATCH 26/49] analyzer: new files: digraph.{cc|h} and shortest-paths.h David Malcolm
2019-12-07 14:58   ` Jeff Law
2019-12-09 23:15     ` David Malcolm
2019-12-10  0:45   ` Martin Sebor
2019-11-16  1:18 ` [PATCH 18/49] Add in-tree plugin: "analyzer" David Malcolm
2019-11-16  1:20 ` [PATCH 39/49] analyzer: new files: analysis-plan.{cc|h} David Malcolm
2019-12-07 15:24   ` Jeff Law
2019-11-16  1:20 ` [PATCH 34/49] analyzer: new file: sm-malloc.cc David Malcolm
2019-12-07 15:11   ` Jeff Law
2019-11-16  1:20 ` [PATCH 04/49] sbitmap.h: add operator const sbitmap & to auto_sbitmap David Malcolm
2019-12-04 16:54   ` Martin Sebor
2019-11-16  1:21 ` [PATCH 42/49] analyzer: new files: program-state.{cc|h} David Malcolm
2019-11-16  1:21 ` [PATCH 25/49] analyzer: new files: graphviz.{cc|h} David Malcolm
2019-12-07 14:54   ` Jeff Law
2019-12-09 23:13     ` David Malcolm
2019-11-16  1:21 ` [PATCH 45/49] analyzer: new files: engine.{cc|h} David Malcolm
2019-11-16  1:21 ` [PATCH 13/49] function-tests.c: expose selftest::make_fndecl for use elsewhere David Malcolm
2019-12-07 14:37   ` Jeff Law
2019-11-16  1:21 ` [PATCH 15/49] Add ordered_hash_map David Malcolm
2019-12-04 17:59   ` Martin Sebor
2020-01-08 23:47     ` David Malcolm
2020-01-09 11:56       ` Jonathan Wakely
2020-01-10  2:58         ` [PATCH] Add ordered_hash_map (v6) David Malcolm
2019-11-16  1:21 ` [PATCH 48/49] gdbinit.in: add break-on-saved-diagnostic David Malcolm
2019-11-16  1:21 ` [PATCH 38/49] analyzer: new file: sm-taint.cc David Malcolm
2019-12-07 15:22   ` Jeff Law
2019-11-16  1:21 ` [PATCH 37/49] analyzer: new file: sm-sensitive.cc David Malcolm
2019-12-07 15:18   ` Jeff Law
2019-11-16  1:21 ` [PATCH 46/49] analyzer: new files: checker-path.{cc|h} David Malcolm
2019-12-11 20:50   ` Jeff Law
2019-11-16  1:21 ` [PATCH 10/49] Add -fdiagnostics-nn-line-numbers David Malcolm
2019-12-04 17:18   ` Martin Sebor
2019-12-04 17:24   ` Martin Sebor
2019-11-16  1:21 ` [PATCH 49/49] analyzer: test suite David Malcolm
2019-11-16  1:21 ` [PATCH 31/49] analyzer: new files: region-model.{cc|h} David Malcolm
2019-11-16  1:21 ` [PATCH 41/49] analyzer: new files: program-point.{cc|h} David Malcolm
2019-12-11 19:54   ` Jeff Law
2019-12-11 19:58     ` David Malcolm [this message]
2019-11-16  1:21 ` [PATCH 44/49] analyzer: new files: state-purge.{cc|h} David Malcolm
2019-12-11 20:11   ` Jeff Law
2019-11-16  1:21 ` [PATCH 43/49] analyzer: new file: exploded-graph.h David Malcolm
2019-12-11 20:04   ` Jeff Law
2019-12-12 15:29     ` David Malcolm
2019-12-12 18:22       ` David Malcolm
2020-01-10  2:41     ` David Malcolm
2019-11-16  1:21 ` [PATCH 40/49] analyzer: new files: call-string.{cc|h} David Malcolm
2019-12-11 19:28   ` Jeff Law
2019-11-16  1:21 ` [PATCH 47/49] analyzer: new files: diagnostic-manager.{cc|h} David Malcolm
2019-12-11 20:42   ` Jeff Law
2019-12-11 21:11     ` David Malcolm
2019-11-16  1:23 ` [PATCH 20/49] analyzer: new builtins David Malcolm
2019-12-04 18:11   ` Martin Sebor
2019-12-19 15:16     ` David Malcolm
2019-11-16 21:47 ` [PATCH 00/49] RFC: Add a static analysis framework to GCC Thomas Schwinge
2019-11-19 22:05   ` David Malcolm
2019-11-20 10:26     ` Richard Biener
2019-12-02  3:03       ` Eric Gallager
2019-12-03 16:52       ` David Malcolm
2019-12-03 17:17         ` Jakub Jelinek
2019-12-16 14:33           ` David Malcolm
2019-12-04 12:41         ` Richard Biener
2019-12-06 22:25         ` Jeff Law
2019-12-08 14:28           ` [PATCH 0/2] v3 of analyzer patch kit (unsquashed) David Malcolm
2019-12-08 14:28             ` [PATCH 2/2] Rework as a non-plugin David Malcolm
2019-12-08 14:28             ` [PATCH 1/2] Fixup for rebase: c-format.c: get_pointer_to_named_type -> get_named_type David Malcolm
2019-12-02  3:20   ` [PATCH 00/49] RFC: Add a static analysis framework to GCC Eric Gallager
2019-12-04 19:55 ` Martin Sebor
2019-12-06 22:31   ` Jeff Law
2019-12-09  8:10     ` Richard Biener
2019-12-11 20:11       ` David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=857c07b1bc70eafd8047f4fed112285140d5ce0a.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).