Currently nodes_iterator may dereference to a NodeType* or a NodeType&. Make them all dereference to NodeType*, which is NodeRef later. Corresponding LLVM change: D23704
Details
Diff Detail
Event Timeline
Consider renaming and/or generalizing the handlers.
Also, in a follow-up or preliminary commit, could you remove all the DerefFun stuff. Move the definition of CGdereference (if they remain) above the typedef of nodes_iterator and use decltype(&CGdereference), and you can drop the "DerefFun(...)" around the CGdereference). That way the change only needs to change the deref function and everything else falls out.
(you could also change the calls to map_iterator to just directly call nodes_iterator(...) since you have the specific type, there's no need to call the deduction-powered generic function)
(idle rambling: This is why I really want the ability to decltype stateless lambdas:
typedef mapped_iterator<..., decltype([](PairTy P) { return P.second; })> nodes_iterator
)
include/clang/Analysis/CallGraph.h | ||
---|---|---|
219 | I don't have enough context - but presumably this name should be changed now that the function doesn't actually dereference? (perhaps this is just get<1, PairTy::first_type, PairTy::second_type> - but could be useful to have a generic utility, something like 'firster' and 'seconder' - I thought there might already be, but couldn't find one. Could generalize it like get<> but just allow the actual tuple/pair type to be passed, rather than having to decompose it) |
include/clang/Analysis/CallGraph.h | ||
---|---|---|
219 | I'll add a GetNthFunctor or something to STLExtras.h in the next patch, so that we don't need to create a specific one. |
I don't have enough context - but presumably this name should be changed now that the function doesn't actually dereference? (perhaps this is just get<1, PairTy::first_type, PairTy::second_type> - but could be useful to have a generic utility, something like 'firster' and 'seconder' - I thought there might already be, but couldn't find one. Could generalize it like get<> but just allow the actual tuple/pair type to be passed, rather than having to decompose it)