[PATCH] D59481: [clangd] Count number of references while merging RefSlabs inside FileIndex

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 02:14:01 PDT 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:101
     FileToRefs.erase(Path);
-  else
-    FileToRefs[Path] = std::move(Refs);
+  else {
+    RefSlabAndCountReferences Item;
----------------
NIT: maybe simplify to the following?
```
if (!Refs) {
  FileToRefs.erase(Path);
  return;
}
...
```

up to you.


================
Comment at: clang-tools-extra/clangd/index/FileIndex.h:63
   /// If either is nullptr, corresponding data for \p Path will be removed.
+  /// If CountReferences is true, Refs will be used for counting References
+  /// during merging.
----------------
NIT: use `\p Refs`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59481





More information about the cfe-commits mailing list