diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2017-12-13 12:51:22 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2017-12-13 12:51:22 +0000 |
commit | d4035d3dada4a9d8f791966b2c075af94376b1a7 (patch) | |
tree | b72741afd4b4049989b6869437a36ec59f457038 /clangd/GlobalCompilationDatabase.cpp | |
parent | 518d3b528894007e746413079241cfba4ae5c07a (diff) |
[clangd] Implemented logging using Context
Reviewers: sammccall, ioeric, hokein
Reviewed By: sammccall
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D40486
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clangd/GlobalCompilationDatabase.cpp')
-rw-r--r-- | clangd/GlobalCompilationDatabase.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/clangd/GlobalCompilationDatabase.cpp b/clangd/GlobalCompilationDatabase.cpp index 8767b2d9..2d3757dd 100644 --- a/clangd/GlobalCompilationDatabase.cpp +++ b/clangd/GlobalCompilationDatabase.cpp @@ -26,8 +26,8 @@ GlobalCompilationDatabase::getFallbackCommand(PathRef File) const { DirectoryBasedGlobalCompilationDatabase:: DirectoryBasedGlobalCompilationDatabase( - clangd::Logger &Logger, llvm::Optional<Path> CompileCommandsDir) - : Logger(Logger), CompileCommandsDir(std::move(CompileCommandsDir)) {} + llvm::Optional<Path> CompileCommandsDir) + : CompileCommandsDir(std::move(CompileCommandsDir)) {} llvm::Optional<tooling::CompileCommand> DirectoryBasedGlobalCompilationDatabase::getCompileCommand(PathRef File) const { @@ -103,9 +103,12 @@ DirectoryBasedGlobalCompilationDatabase::getCompilationDatabase( if (CompileCommandsDir.hasValue()) { tooling::CompilationDatabase *ReturnValue = tryLoadDatabaseFromPath(CompileCommandsDir.getValue()); - if (ReturnValue == nullptr) - Logger.log("Failed to find compilation database for " + Twine(File) + - "in overriden directory " + CompileCommandsDir.getValue()); + if (ReturnValue == nullptr) { + // FIXME(ibiryukov): pass a proper Context here. + log(Context::empty(), "Failed to find compilation database for " + + Twine(File) + "in overriden directory " + + CompileCommandsDir.getValue()); + } return ReturnValue; } @@ -118,7 +121,9 @@ DirectoryBasedGlobalCompilationDatabase::getCompilationDatabase( return CDB; } - Logger.log("Failed to find compilation database for " + Twine(File)); + // FIXME(ibiryukov): pass a proper Context here. + log(Context::empty(), + "Failed to find compilation database for " + Twine(File)); return nullptr; } |