Summary: Fixes https://github.com/clangd/clangd/issues/268
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73628
auto R = CompilationDatabases.try_emplace(Key);
if (R.second) { // Cache miss, try to load CDB.
CachedCDB &Entry = R.first->second;
- std::string Error = "";
+ std::string Error;
Entry.CDB = tooling::CompilationDatabase::loadFromDirectory(Dir, Error);
Entry.Path = std::string(Dir);
+ if (Entry.CDB)
+ log("Loaded compilation database from {0}", Dir);
}
return R.first->second;
}