[PATCH] D42311: [SyntheticCounts] Rewrite the code using only graph traits.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 17:20:24 PST 2018


dberlin added a comment.

Is it a thing that is even different for each callgraph implementation? (If not, why is it a trait?)
Even if it is, if you look, you'll see we don't try to encode random computed Node property differences in GraphTraits. Only the things that *every* graph algorithm needs (IE it caters to anything, not everything).    Random node property differences are handled through other trait classes or filtering.  This does not, at a glance, seem like a thing that literally every algorithm that is going to use a Callgraph needs. It looks like one that some may need.  You even prove this yourself.

If you want to do something different here for CallGraphTraits, i'd like to understand what advantage it has.  At least in this patch as currently written, there is no advantage to has_function_def existing as a CallGraphTrait.
It would work just existing fine outside of CallGraphTraits, and even as a templated function  local to a single file.


Repository:
  rL LLVM

https://reviews.llvm.org/D42311





More information about the llvm-commits mailing list