[PATCH 41/49] analyzer: new files: program-point.{cc|h}

Jeff Law law@redhat.com
Wed Dec 11 19:54:00 GMT 2019


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)?

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

jeff



More information about the Gcc-patches mailing list