[PATCH] D51605: [clangd] SymbolOccurrences -> Refs and cleanup
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 3 15:49:31 PDT 2018
sammccall created this revision.
sammccall added a reviewer: ioeric.
Herald added subscribers: cfe-commits, kadircet, arphaman, mgrang, jkorous, MaskRay, ilya-biryukov.
A few things that I noticed while merging the SwapIndex patch:
- SymbolOccurrences and particularly SymbolOccurrenceSlab are unwieldy names, and these names appear *a lot*. Ref, RefSlab, etc seem clear enough and read/format much better.
- The asymmetry between SymbolSlab and RefSlab (build() vs freeze()) is confusing and irritating, and doesn't even save much code. Avoiding RefSlab::Builder was my idea, but it was a bad one; add it.
- DenseMap<SymbolID, ArrayRef<Ref>> seems like a reasonable compromise for constructing MemIndex - and means many less wasted allocations than the current DenseMap<SymbolID, vector<Ref*>> for FileIndex, and none for slabs.
- A few naming/consistency fixes: e.g. Slabs,Refs -> Symbols,Refs.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D51605
Files:
clangd/ClangdServer.cpp
clangd/index/FileIndex.cpp
clangd/index/FileIndex.h
clangd/index/Index.cpp
clangd/index/Index.h
clangd/index/MemIndex.cpp
clangd/index/MemIndex.h
clangd/index/Merge.cpp
clangd/index/Merge.h
clangd/index/SymbolCollector.cpp
clangd/index/SymbolCollector.h
clangd/index/dex/DexIndex.cpp
clangd/index/dex/DexIndex.h
clangd/tool/ClangdMain.cpp
unittests/clangd/CodeCompleteTests.cpp
unittests/clangd/FileIndexTests.cpp
unittests/clangd/IndexTests.cpp
unittests/clangd/SymbolCollectorTests.cpp
unittests/clangd/TestTU.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51605.163750.patch
Type: text/x-patch
Size: 57727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180903/b0a12392/attachment-0001.bin>
More information about the cfe-commits
mailing list