[PATCH] D63389: [IDF] Generalize IDFCalculator to be used with Clang's CFG

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 08:26:30 PDT 2019


kuhar added a comment.

@Szelethus

> That wasn't going to happen, since the `GraphDiff` object has to be used in the `getChildren` function.  I made `llvm::IDFCalculator::getChildren` virtual, is this okay?
> 
> I also have a local branch on which I used `std::function` (had to be used in order to pass a lambda with a non-empty capture list) and kept everything non-virtual, but I read somewhere that std::function is heavy-weight. Which solution is better, if any?

I'd expect the `getChildren` to be potentially performance-sensitive and am worried about switching it into a virtual call or another indirection through std::function. Do you have some evidence that this does not affect performance?

Why not have the generic base that used typical way of getting children with `children` (for clang) and a specialization for BasicBlock using GraphDiff?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63389/new/

https://reviews.llvm.org/D63389





More information about the llvm-commits mailing list