Another piece of index-while-building functionality.
RFC: http://lists.llvm.org/pipermail/cfe-dev/2019-February/061432.html
Originally part of review https://reviews.llvm.org/D39050
This implementation is covered by lit tests using it through c-index-test in upcoming patch. It's just split off to make the patch smaller and easier to review.
Could you add some explanation about the information that is being hashed? What is the underlying principle behind choosing to hash some aspect of the AST node (or to skip it). For example, I see you're hashing names, but not, say source locations. Or that QualTypes are first translated into canonical types.
What are the completeness constraints for this hasher? What happens if we don't hash something that we should have?
"Caching all produced hashes" seems like an implementation comment. Especially since the implementation chooses not to cache some of the hashes.