[clang-tools-extra] r329582 - [clang] Use compile-command interpolation to provide commands for header files.

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 9 08:22:08 PDT 2018


Author: sammccall
Date: Mon Apr  9 08:22:08 2018
New Revision: 329582

URL: http://llvm.org/viewvc/llvm-project?rev=329582&view=rev
Log:
[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

Modified:
    clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp

Modified: clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp?rev=329582&r1=329581&r2=329582&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp (original)
+++ clang-tools-extra/trunk/clangd/GlobalCompilationDatabase.cpp Mon Apr  9 08:22:08 2018
@@ -86,6 +86,8 @@ DirectoryBasedGlobalCompilationDatabase:
     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;




More information about the cfe-commits mailing list