[IncludeCleaner] Handle more C++ constructs
Summary:
This brings IncludeCleaner's reference discovery from AST to the parity
with current implementation in clangd. Some highlights:
- Handling of MemberExprs, only the member declaration is marked as
referenced and not the container, unlike clangd.
- Constructor calls, only the constructor and not the container, unlike
clangd.
- All the possible candidates for unresolved overloads, same as clangd.
- All the shadow decls for using-decls, same as clangd.
- Declarations for definitions of enums with an underlying type and
functions, same as clangd.
- Using typelocs, using templatenames and typedefs only reference the
found decl, same as clangd.
- Template specializations only reference the primary template, not the
explicit specializations, to be fixed.
- Expr types aren't marked as used, unlike clangd.
Going forward, we can consider having signals to indicate type of a
reference (e.g. `implicit` signal for type of an expr) so that the
applications can perform a filtering based on their needs.
At the moment the biggest discrepancy is around type of exprs, i.e. not
marking containers for member/constructor accesses. I believe this is
the right model since the declaration of the member and the container
should be available in a single file (modulo macros).
Reviewers: sammccall
Subscribers:
Differential Revision: https://reviews.llvm.org/D132110