[PATCH] D40450: [clangd] Refactoring of GlobalCompilationDatabase

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 24 15:46:09 PST 2017


sammccall created this revision.

The interface used is now tooling::CompilationDatabase.
The various behaviors of the existing CDB implementation is decomposed into
several classes responsible for one aspect each.

- The fallback commands are now a FixedCompilationDatabase. For now, this is done by both ClangdLSPServer and ClangdServer (preserving behavior) but I'd like to eliminate the latter, as embedders of ClangdServer are in a better position to know what fallback is appropriate.
- the fallback now uses '.' as the directory, rather than the file's parent.
- The compilation database file scan caches missing as well as present files.
- -fsyntax-only is now applied to all commands, not just the fallback. We also string output flags.
- The final command line used for each file is now logged.
- The -resource-dir flag is managed by ClangdServer rather than being done deeper in the stack. All flag manipulation is done by CDBs set up by ClangdLSPServer and ClangdServer.


https://reviews.llvm.org/D40450

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdLSPServer.h
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/ClangdUnit.cpp
  clangd/ClangdUnitStore.cpp
  clangd/ClangdUnitStore.h
  clangd/GlobalCompilationDatabase.cpp
  clangd/GlobalCompilationDatabase.h
  unittests/clangd/ClangdTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40450.124244.patch
Type: text/x-patch
Size: 24092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171124/5094204a/attachment-0001.bin>


More information about the cfe-commits mailing list