[PATCH] D61104: [clang][ASTContext] Try to avoid sorting comments for code completion

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 16:42:35 PDT 2019


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

For large number of deserialized comments (~100k) the way how we try to attach them to declaration in completion comments is too expensive.

Currently we're sorting all the comments by source location (expensive) and later bisecting them for every interesting declaration to find the closest comment before and after the declaration documentation comment.

This patch tries to just iterate over unsorted comments and see if there's any of the decls we're interested in nearby.


Repository:
  rC Clang

https://reviews.llvm.org/D61104

Files:
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/RawCommentList.h
  clang/include/clang/Basic/SourceLocation.h
  clang/include/clang/Sema/CodeCompleteConsumer.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/RawCommentList.cpp
  clang/lib/Sema/SemaCodeComplete.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/tools/libclang/CIndexCodeCompletion.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61104.196551.patch
Type: text/x-patch
Size: 23987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190424/51828f92/attachment-0001.bin>


More information about the cfe-commits mailing list