diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2019-01-07 15:45:19 +0000 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2019-01-07 15:45:19 +0000 |
| commit | f2001aa74394885dc178c5997b83687acb4f55e4 (patch) | |
| tree | 80666e16bbebadef8f35d1d962e09da8a7812d13 /clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | |
| parent | 25d3de8a0ac4d65f2ac9820ba62a372414780649 (diff) | |
| download | bcm5719-llvm-f2001aa74394885dc178c5997b83687acb4f55e4.tar.gz bcm5719-llvm-f2001aa74394885dc178c5997b83687acb4f55e4.zip | |
[clangd] Remove 'using namespace llvm' from .cpp files. NFC
The new guideline is to qualify with 'llvm::' explicitly both in
'.h' and '.cpp' files. This simplifies moving the code between
header and source files and is easier to keep consistent.
llvm-svn: 350531
Diffstat (limited to 'clang-tools-extra/clangd/GlobalCompilationDatabase.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp index e7cbc7bcc86..c2fff7b20f3 100644 --- a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp +++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp @@ -13,7 +13,6 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" -using namespace llvm; namespace clang { namespace clangd { @@ -32,22 +31,24 @@ GlobalCompilationDatabase::getFallbackCommand(PathRef File) const { std::vector<std::string> Argv = {getFallbackClangPath()}; // Clang treats .h files as C by default, resulting in unhelpful diagnostics. // Parsing as Objective C++ is friendly to more cases. - if (sys::path::extension(File) == ".h") + if (llvm::sys::path::extension(File) == ".h") Argv.push_back("-xobjective-c++-header"); Argv.push_back(File); - return tooling::CompileCommand(sys::path::parent_path(File), - sys::path::filename(File), std::move(Argv), + return tooling::CompileCommand(llvm::sys::path::parent_path(File), + llvm::sys::path::filename(File), + std::move(Argv), /*Output=*/""); } DirectoryBasedGlobalCompilationDatabase:: - DirectoryBasedGlobalCompilationDatabase(Optional<Path> CompileCommandsDir) + DirectoryBasedGlobalCompilationDatabase( + llvm::Optional<Path> CompileCommandsDir) : CompileCommandsDir(std::move(CompileCommandsDir)) {} DirectoryBasedGlobalCompilationDatabase:: ~DirectoryBasedGlobalCompilationDatabase() = default; -Optional<tooling::CompileCommand> +llvm::Optional<tooling::CompileCommand> DirectoryBasedGlobalCompilationDatabase::getCompileCommand( PathRef File, ProjectInfo *Project) const { if (auto CDB = getCDBForFile(File, Project)) { @@ -77,7 +78,7 @@ DirectoryBasedGlobalCompilationDatabase::getCDBInDirLocked(PathRef Dir) const { tooling::CompilationDatabase * DirectoryBasedGlobalCompilationDatabase::getCDBForFile( PathRef File, ProjectInfo *Project) const { - namespace path = sys::path; + namespace path = llvm::sys::path; assert((path::is_absolute(File, path::Style::posix) || path::is_absolute(File, path::Style::windows)) && "path must be absolute"); @@ -113,7 +114,7 @@ OverlayCDB::OverlayCDB(const GlobalCompilationDatabase *Base, }); } -Optional<tooling::CompileCommand> +llvm::Optional<tooling::CompileCommand> OverlayCDB::getCompileCommand(PathRef File, ProjectInfo *Project) const { { std::lock_guard<std::mutex> Lock(Mutex); |

