[PATCH] D45007: [clang] Use compile-command interpolation to provide commands for header files.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 28 16:17:31 PDT 2018


sammccall created this revision.
Herald added subscribers: cfe-commits, ioeric, jkorous-apple, ilya-biryukov, klimek.

This uses the inferring wrapper introduced in https://reviews.llvm.org/D45006.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45007

Files:
  clangd/GlobalCompilationDatabase.cpp


Index: clangd/GlobalCompilationDatabase.cpp
===================================================================
--- clangd/GlobalCompilationDatabase.cpp
+++ clangd/GlobalCompilationDatabase.cpp
@@ -86,6 +86,8 @@
     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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45007.140159.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180328/778e0a7e/attachment.bin>


More information about the cfe-commits mailing list