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

2019-04-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added inline comments. Comment at: clang/include/clang/AST/ASTContext.h:728 - class RawCommentAndCacheFlags { + class CommentAndOrigin { public: `RawCommentAndOrigin`? Comment at: clang/include/clang/AST/ASTContext.h:751 -

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

2019-04-10 Thread Jan Korous via Phabricator via cfe-commits
jkorous updated this revision to Diff 194609. jkorous added a comment. rename RawCommentAndCacheFlags -> CommentAndOrigin CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60432/new/ https://reviews.llvm.org/D60432 Files: clang/include/clang/AST/ASTContext.h

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

2019-04-10 Thread Jan Korous via Phabricator via cfe-commits
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

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

2019-04-10 Thread Jan Korous via Phabricator via cfe-commits
jkorous marked an inline comment as done. jkorous added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:372 D = adjustDeclToTemplate(D); + const Decl* CanonicalDecl = D->getCanonicalDecl(); gribozavr wrote: > jkorous wrote: > > arphaman wrote: >

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

2019-04-10 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added inline comments. Comment at: clang/include/clang/AST/ASTContext.h:756 /// lazily. mutable llvm::DenseMap RedeclComments; The name of this variable (and `RawCommentAndCacheFlags`) don't make sense after the change.

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

2019-04-09 Thread Jan Korous via Phabricator via cfe-commits
jkorous marked an inline comment as done. jkorous added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:372 D = adjustDeclToTemplate(D); + const Decl* CanonicalDecl = D->getCanonicalDecl(); arphaman wrote: > Why are we now checking for the

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

2019-04-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:372 D = adjustDeclToTemplate(D); + const Decl* CanonicalDecl = D->getCanonicalDecl(); Why are we now checking for the canonical declaration instead of `D` as before? Repository:

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

2019-04-08 Thread Jan Korous via Phabricator via cfe-commits
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