llvm-project/clang-tools-extra/clangd
Sam McCall 6003951c66 [clangd] Collect definitions when indexing.
Within a TU:
 - as now, collect a declaration from the first occurrence of a symbol
   (taking clang's canonical declaration)
 - when we first see a definition occurrence, copy the symbol and add it
Across TUs/sources:
 - mergeSymbol in Merge.h is responsible for combining matching Symbols.
   This covers dynamic/static merges and cross-TU merges in the static index.
 - it prefers declarations from Symbols that have a definition.
 - GlobalSymbolBuilderMain is modified to use mergeSymbol as a reduce step.
Random cleanups (can be pulled out):
 - SymbolFromYAML -> SymbolsFromYAML, new singular SymbolFromYAML added
 - avoid uninit'd SymbolLocations. Add an idiomatic way to check "absent".
 - CanonicalDeclaration (as well as Definition) are mapped as optional in YAML.
 - added operator<< for Symbol & SymbolLocation, for debugging

Reviewers: ioeric, hokein

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

Differential Revision: https://reviews.llvm.org/D42942

llvm-svn: 324735
2018-02-09 14:42:01 +00:00
..
clients/clangd-vscode [clangd] Use new URI with scheme support in place of the existing LSP URI 2018-01-29 15:37:46 +00:00
fuzzer [clangd-fuzzer] Update ClangdLSPServer constructor call. 2017-12-20 22:29:23 +00:00
global-symbol-builder [clangd] Collect definitions when indexing. 2018-02-09 14:42:01 +00:00
index [clangd] Collect definitions when indexing. 2018-02-09 14:42:01 +00:00
tool [clangd] Collect definitions when indexing. 2018-02-09 14:42:01 +00:00
CMakeLists.txt Resubmit "[clangd] The new threading implementation" 2018-02-08 07:37:35 +00:00
ClangdLSPServer.cpp [clangd] Support simpler JSON-RPC stream parsing for lit tests. 2018-02-06 10:47:30 +00:00
ClangdLSPServer.h [clangd] Support simpler JSON-RPC stream parsing for lit tests. 2018-02-06 10:47:30 +00:00
ClangdServer.cpp Resubmit "[clangd] The new threading implementation" 2018-02-08 07:37:35 +00:00
ClangdServer.h [clangd] Remove threading-related code from ClangdUnit.h 2018-02-09 10:17:23 +00:00
ClangdUnit.cpp [clangd] Fix crash when CompilerInvocation can't be created. 2018-02-09 13:51:57 +00:00
ClangdUnit.h [clangd] Remove threading-related code from ClangdUnit.h 2018-02-09 10:17:23 +00:00
CodeComplete.cpp [clangd] Fix crash when CompilerInvocation can't be created. 2018-02-09 13:51:57 +00:00
CodeComplete.h [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
CodeCompletionStrings.cpp [clangd] Pull CodeCompletionString handling logic into its own file and add unit test. 2017-12-20 17:24:31 +00:00
CodeCompletionStrings.h [clangd] Pull CodeCompletionString handling logic into its own file and add unit test. 2017-12-20 17:24:31 +00:00
CompileArgsCache.cpp [clangd] Fixed the file comment of new file. NFC 2018-01-25 14:30:46 +00:00
CompileArgsCache.h [clangd] Added forgotten files 2018-01-25 14:29:29 +00:00
Compiler.cpp [clangd] Always use preamble (even stale) for code completion 2018-01-18 15:17:00 +00:00
Compiler.h [clangd] Always use preamble (even stale) for code completion 2018-01-18 15:17:00 +00:00
Context.cpp [clangd] Don't try pthread, just use thread_local. Reverts r323949. 2018-02-06 14:25:02 +00:00
Context.h [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
DraftStore.cpp Fixing compilation failures on buildbots. 2017-05-16 10:06:20 +00:00
DraftStore.h [clangd] Serialize onDiagnosticsReady callbacks for the same file. 2017-09-20 12:58:55 +00:00
Function.h [clangd] Replace homegrown make_scope_exit with one from ADT 2018-01-25 17:01:39 +00:00
FuzzyMatch.cpp [clangd] Fix memcpy(?, null, 0) UB by switching to std::copy 2018-01-19 15:03:49 +00:00
FuzzyMatch.h [clangd] Merge index-provided completions with those from Sema. 2018-01-19 14:34:02 +00:00
GlobalCompilationDatabase.cpp [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
GlobalCompilationDatabase.h [clangd] Simplify GlobalCompilationDatabase, cache missing GCDs 2017-12-22 09:47:34 +00:00
JSONExpr.cpp [clangd] Put all #includes in one block in clangd source files. NFC 2017-12-14 21:22:03 +00:00
JSONExpr.h [clangd] Put all #includes in one block in clangd source files. NFC 2017-12-14 21:22:03 +00:00
JSONRPCDispatcher.cpp [clangd] Remove unused variable. NFC 2018-02-06 15:27:43 +00:00
JSONRPCDispatcher.h [clangd] Support simpler JSON-RPC stream parsing for lit tests. 2018-02-06 10:47:30 +00:00
Logger.cpp [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
Logger.h [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
Path.h Restored r303067 and fixed failing test. 2017-05-16 09:38:59 +00:00
Protocol.cpp [clangd] Add a test URI scheme for lit tests to unbreak platform-specific URI failures. 2018-01-31 16:26:27 +00:00
Protocol.h [clangd] Use new URI with scheme support in place of the existing LSP URI 2018-01-29 15:37:46 +00:00
ProtocolHandlers.cpp [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
ProtocolHandlers.h [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
SourceCode.cpp [clangd] Expose offset <-> LSP position functions, and fix bugs 2017-12-19 12:23:48 +00:00
SourceCode.h [clangd] Expose offset <-> LSP position functions, and fix bugs 2017-12-19 12:23:48 +00:00
TUScheduler.cpp [clangd] Remove threading-related code from ClangdUnit.h 2018-02-09 10:17:23 +00:00
TUScheduler.h Resubmit "[clangd] The new threading implementation" 2018-02-08 07:37:35 +00:00
Threading.cpp Resubmit "[clangd] The new threading implementation" 2018-02-08 07:37:35 +00:00
Threading.h Resubmit "[clangd] The new threading implementation" 2018-02-08 07:37:35 +00:00
Trace.cpp [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
Trace.h [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
URI.cpp [clangd] Do not precent-encode numbers in URI. 2018-02-07 12:12:06 +00:00
URI.h [clangd] Use new URI with scheme support in place of the existing LSP URI 2018-01-29 15:37:46 +00:00
XRefs.cpp [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00
XRefs.h [clangd] Pass Context implicitly using TLS. 2018-01-31 13:40:48 +00:00