- I assume we can cache comments for canonical declarations only, not for every redeclaration.
- Caching that we didn't find comments seems to be unnecessary since we try to search for comment again again next time if we find this data in cache.
- We might implement proper cache invalidation in the future and get back to using this information.
- Origin of comment (directly from declaration / from some redeclaration) seems to not be used anywhere.
I plan to do some performance testing before committing but like to have some feedback first.
BTW there's another cache for comments in the ASTContext - ParsedComments. We could try to experiment with different caching approaches to see how it affects performance - maybe caching mapping from canonical declarations to raw comments and separately caching mapping from raw comments to full comments.
RawCommentAndOrigin?