On Fri, 2020-01-10 at 12:40 -0500, David Malcolm wrote: > > > On Fri, 2020-01-10 at 10:24 -0700, Jeff Law wrote: > > I don't see any EH handling mechansisms. I realize we haven't > > focused > > on C++ and thus EH hasn't been the top of our minds, but are we going > > to have to handle that at some point? > > Fair point. The scope of the analyzer is C only right now, though I > think the only place I've documented that is in the internal docs, > where the Limitations section has "Only for C so far". But I want to > support C++ in future releases. I'd probably have to review the low level EH implementation internals. Worst case it's just more edges where it's not immediately obvious when/why/how those edges get traversed.
> > > > diff --git a/gcc/analyzer/supergraph.h b/gcc/analyzer/supergraph.h > > > new file mode 100644 > > > index 000000000000..81ea3ac08198 > > > --- /dev/null > > > +++ b/gcc/analyzer/supergraph.h > > > @@ -0,0 +1,564 @@ > > > +/* "Supergraph" classes that combine CFGs and callgraph into one > > > digraph. > > > + Copyright (C) 2019-2020 Free Software Foundation, Inc. > > > + Contributed by David Malcolm <dmalc...@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_SUPERGRAPH_H > > > +#define GCC_ANALYZER_SUPERGRAPH_H > > > + > > > +#include "ordered-hash-map.h" > > > +#include "options.h" > > > +#include "cgraph.h" > > > +#include "function.h" > > > +#include "cfg.h" > > > +#include "basic-block.h" > > > +#include "gimple.h" > > > +#include "gimple-iterator.h" > > > +#include "digraph.h" > > Ugh. Policy is to avoid doing this kind of thing. Instead the > > includes are supposed to be in the .cc files. > > <rant> > FWIW, I've never understood the benefit of this policy; it feels like a > violation of the DRY principle, and I always find myself wondering > things like "what do I need to include before I can include gimple.h?". > </rant> > > But time is short; I'll copy and paste the includes. It was to help us untangle the headers, which was effectively done a few cycles ago. What needs to happen now is a re-introduction of *sane* inclusions. But that keeps getting pushed out. Jeff