alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D30841#702980, @fgross wrote:

> Now using `ASTContext::getParents` instead of `ChainedIfs` map.
>
> For some reason I thought of `getParents` as an expensive function to call...


Good point. It is expensive first time you call it, since it builds parents 
map. My idea was that since many checks use hasParent or hasAncestor matchers, 
the parent map will likely be built anyway, and building a (smaller) map of 
chained `if`s as an optimization won't make much difference. But I don't know 
for sure, and maybe your approach is indeed better. We can start with the 
parent-map based one and keep the possible optimization in mind, in case 
there's an evidence of performance issues.

LG. I'll submit the patch for you.


https://reviews.llvm.org/D30841



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to