diff options
| author | Sam McCall <sam.mccall@gmail.com> | 2018-04-09 15:22:08 +0000 |
|---|---|---|
| committer | Sam McCall <sam.mccall@gmail.com> | 2018-04-09 15:22:08 +0000 |
| commit | 307c4837ccfd672a11c5ced21bfa6f76a6473e7a (patch) | |
| tree | c7155a05af1227972da5fc38a274fb4ad12127e6 | |
| parent | 4220f89107c49e7db2247e575263ccd752cdf442 (diff) | |
| download | bcm5719-llvm-307c4837ccfd672a11c5ced21bfa6f76a6473e7a.tar.gz bcm5719-llvm-307c4837ccfd672a11c5ced21bfa6f76a6473e7a.zip | |
[clang] Use compile-command interpolation to provide commands for header files.
Summary: This uses the inferring wrapper introduced in D45006.
Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D45007
llvm-svn: 329582
| -rw-r--r-- | clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp index c1ad7291d01..f7c964cb4ae 100644 --- a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp +++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp @@ -86,6 +86,8 @@ DirectoryBasedGlobalCompilationDatabase::getCDBInDirLocked(PathRef Dir) const { return CachedIt->second.get(); std::string Error = ""; auto CDB = tooling::CompilationDatabase::loadFromDirectory(Dir, Error); + if (CDB) + CDB = tooling::inferMissingCompileCommands(std::move(CDB)); auto Result = CDB.get(); CompilationDatabases.insert(std::make_pair(Dir, std::move(CDB))); return Result; |

