From 307c4837ccfd672a11c5ced21bfa6f76a6473e7a Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Mon, 9 Apr 2018 15:22:08 +0000 Subject: [PATCH] [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 --- clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp index c1ad729..f7c964c 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; -- 2.7.4