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

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 16:03:23 PDT 2019


jkorous updated this revision to Diff 194604.
jkorous added a comment.

Second attempt on reducing the cache size and number of operations.

I try in this order

1. cache lookup for the specific provided declaration
2. try to find comment attached to the specific provided declaration without using cache (and cache it using the specific declaration as a key)
3. cache lookup using the canonical declaration (which would return comment from any redeclaration - see the next step)
4. try to find comment attached to any redeclaration (and cache it using the canonical declaration as a key)
5. give up, return nullptr


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60432/new/

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.194604.patch
Type: text/x-patch
Size: 6881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190410/ef558f7b/attachment-0001.bin>


More information about the cfe-commits mailing list