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 | 3bdd3dd087b85026ab0094641a3b0e20935909ed (patch) | |
tree | 927dbfe5191a3e3f8dfc761fe40b01887f571d15 /clang-tools-extra/clangd/Threading.cpp | |
parent | 2719a805361b26c38774b81355f70aea9e75b8a2 (diff) |
[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.
Diffstat (limited to 'clang-tools-extra/clangd/Threading.cpp')
-rw-r--r-- | clang-tools-extra/clangd/Threading.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang-tools-extra/clangd/Threading.cpp b/clang-tools-extra/clangd/Threading.cpp index abfe0f497ca..139fcc2f878 100644 --- a/clang-tools-extra/clangd/Threading.cpp +++ b/clang-tools-extra/clangd/Threading.cpp @@ -9,7 +9,6 @@ #include <pthread.h> #endif -using namespace llvm; namespace clang { namespace clangd { @@ -64,14 +63,14 @@ bool AsyncTaskRunner::wait(Deadline D) const { [&] { return InFlightTasks == 0; }); } -void AsyncTaskRunner::runAsync(const Twine &Name, - unique_function<void()> Action) { +void AsyncTaskRunner::runAsync(const llvm::Twine &Name, + llvm::unique_function<void()> Action) { { std::lock_guard<std::mutex> Lock(Mutex); ++InFlightTasks; } - auto CleanupTask = make_scope_exit([this]() { + auto CleanupTask = llvm::make_scope_exit([this]() { std::lock_guard<std::mutex> Lock(Mutex); int NewTasksCnt = --InFlightTasks; if (NewTasksCnt == 0) { @@ -83,7 +82,7 @@ void AsyncTaskRunner::runAsync(const Twine &Name, std::thread( [](std::string Name, decltype(Action) Action, decltype(CleanupTask)) { - set_thread_name(Name); + llvm::set_thread_name(Name); Action(); // Make sure function stored by Action is destroyed before CleanupTask // is run. @@ -93,7 +92,7 @@ void AsyncTaskRunner::runAsync(const Twine &Name, .detach(); } -Deadline timeoutSeconds(Optional<double> Seconds) { +Deadline timeoutSeconds(llvm::Optional<double> Seconds) { using namespace std::chrono; if (!Seconds) return Deadline::infinity(); |