[PATCH] D44305: [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 14 02:48:41 PDT 2018


ioeric added inline comments.


================
Comment at: clangd/index/Merge.cpp:69
+      else
+        B.insert(mergeSymbol(*Sym, S, &Scratch));
+    });
----------------
sammccall wrote:
> This could also just be callback(mergeSymbol(...)), if we keep track of the IDs we've emitted.
> This way the slab would only have symbols from the dynamic index.
> 
> This could be just:
>  - before the static lookup, make a copy `RemainingIDs = Req.IDs`
>  - in the static callback, remove the id from RemainingIDs
>  - after the static lookup, loop through RemainingIDs, look up symbol in dynamic slab, emit
> 
> This avoids:
>  - copying the static index results (which tend to be more numerous)
>  - build() on the slab builder, which isn't cheap
Good idea. Thanks!


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44305





More information about the cfe-commits mailing list