[PATCH] D60432: [clang][ASTContext] Simplify caching for declaration-related comments

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 8 17:45:12 PDT 2019


jkorous created this revision.
jkorous added reviewers: gribozavr, arphaman, dexonsmith.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

- 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`.


Repository:
  rC Clang

https://reviews.llvm.org/D60432

Files:
  clang/include/clang/AST/ASTContext.h
  clang/lib/AST/ASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60432.194229.patch
Type: text/x-patch
Size: 5524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190409/aa1ac79d/attachment.bin>


More information about the cfe-commits mailing list