[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
This commit is contained in:
Sam McCall 2018-04-09 15:22:08 +00:00
parent 4220f89107
commit 307c4837cc
1 changed files with 2 additions and 0 deletions

View File

@ -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;