[PATCH] D41506: [clangd] Use Builder for symbol slabs, and use sorted-vector for storage

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 03:23:13 PST 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/index/Index.cpp:39
+                             [](const Symbol &S, const SymbolID &I) {
+                               return S.ID == I;
+                             });
----------------
Should this be `S.ID < I`?


================
Comment at: clangd/index/Index.cpp:41
+                             });
+  if (It != Symbols.end() || It->ID == ID)
+    return It;
----------------
`&& It->ID == ID`?


================
Comment at: clangd/index/Index.cpp:72
+  } else
+    own(Symbols[R.first->second] = S, Strings, Arena);
+}
----------------
NIT: Maybe put assignment into a separate statement?
It's not too hard to see what's going on in the current code, but this line certainly gave me a pause.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41506





More information about the cfe-commits mailing list