[clang-tools-extra] 6c72a97 - [clangd] Qualify calls to std::move to silence -Wunqualified-std-cast-call. NFC.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 26 04:36:32 PST 2022


Author: Benjamin Kramer
Date: 2022-02-26T13:36:14+01:00
New Revision: 6c72a97c0e2d9dd884d67315629be1c219da3b34

URL: https://github.com/llvm/llvm-project/commit/6c72a97c0e2d9dd884d67315629be1c219da3b34
DIFF: https://github.com/llvm/llvm-project/commit/6c72a97c0e2d9dd884d67315629be1c219da3b34.diff

LOG: [clangd] Qualify calls to std::move to silence -Wunqualified-std-cast-call. NFC.

Added: 
    

Modified: 
    clang-tools-extra/clangd/TUScheduler.cpp
    clang-tools-extra/clangd/index/dex/Dex.cpp
    clang-tools-extra/clangd/index/dex/Iterator.h
    clang-tools-extra/clangd/unittests/DexTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index 37baf9d3d862a..6aec87d197ed2 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -1504,7 +1504,7 @@ TUScheduler::TUScheduler(const GlobalCompilationDatabase &CDB,
                          const Options &Opts,
                          std::unique_ptr<ParsingCallbacks> Callbacks)
     : CDB(CDB), Opts(Opts),
-      Callbacks(Callbacks ? move(Callbacks)
+      Callbacks(Callbacks ? std::move(Callbacks)
                           : std::make_unique<ParsingCallbacks>()),
       Barrier(Opts.AsyncThreadsCount), QuickRunBarrier(Opts.AsyncThreadsCount),
       IdleASTs(

diff  --git a/clang-tools-extra/clangd/index/dex/Dex.cpp b/clang-tools-extra/clangd/index/dex/Dex.cpp
index 6975533c01f08..5829d780c6072 100644
--- a/clang-tools-extra/clangd/index/dex/Dex.cpp
+++ b/clang-tools-extra/clangd/index/dex/Dex.cpp
@@ -206,7 +206,7 @@ bool Dex::fuzzyFind(const FuzzyFindRequest &Req,
   std::vector<std::unique_ptr<Iterator>> TrigramIterators;
   for (const auto &Trigram : TrigramTokens)
     TrigramIterators.push_back(iterator(Trigram));
-  Criteria.push_back(Corpus.intersect(move(TrigramIterators)));
+  Criteria.push_back(Corpus.intersect(std::move(TrigramIterators)));
 
   // Generate scope tokens for search query.
   std::vector<std::unique_ptr<Iterator>> ScopeIterators;
@@ -215,7 +215,7 @@ bool Dex::fuzzyFind(const FuzzyFindRequest &Req,
   if (Req.AnyScope)
     ScopeIterators.push_back(
         Corpus.boost(Corpus.all(), ScopeIterators.empty() ? 1.0 : 0.2));
-  Criteria.push_back(Corpus.unionOf(move(ScopeIterators)));
+  Criteria.push_back(Corpus.unionOf(std::move(ScopeIterators)));
 
   // Add proximity paths boosting (all symbols, some boosted).
   Criteria.push_back(createFileProximityIterator(Req.ProximityPaths));
@@ -227,12 +227,12 @@ bool Dex::fuzzyFind(const FuzzyFindRequest &Req,
 
   // Use TRUE iterator if both trigrams and scopes from the query are not
   // present in the symbol index.
-  auto Root = Corpus.intersect(move(Criteria));
+  auto Root = Corpus.intersect(std::move(Criteria));
   // Retrieve more items than it was requested: some of  the items with high
   // final score might not be retrieved otherwise.
   // FIXME(kbobyrev): Tune this ratio.
   if (Req.Limit)
-    Root = Corpus.limit(move(Root), *Req.Limit * 100);
+    Root = Corpus.limit(std::move(Root), *Req.Limit * 100);
   SPAN_ATTACH(Tracer, "query", llvm::to_string(*Root));
   vlog("Dex query tree: {0}", *Root);
 

diff  --git a/clang-tools-extra/clangd/index/dex/Iterator.h b/clang-tools-extra/clangd/index/dex/Iterator.h
index 85661eed9fdfd..c7a5bae4adbba 100644
--- a/clang-tools-extra/clangd/index/dex/Iterator.h
+++ b/clang-tools-extra/clangd/index/dex/Iterator.h
@@ -124,8 +124,8 @@ inline void populateChildren(std::vector<std::unique_ptr<Iterator>> &) {}
 template <typename... TailT>
 void populateChildren(std::vector<std::unique_ptr<Iterator>> &Children,
                       std::unique_ptr<Iterator> Head, TailT... Tail) {
-  Children.push_back(move(Head));
-  populateChildren(Children, move(Tail)...);
+  Children.push_back(std::move(Head));
+  populateChildren(Children, std::move(Tail)...);
 }
 } // namespace detail
 
@@ -178,7 +178,7 @@ class Corpus {
   std::unique_ptr<Iterator> intersect(Args... args) const {
     std::vector<std::unique_ptr<Iterator>> Children;
     detail::populateChildren(Children, std::forward<Args>(args)...);
-    return intersect(move(Children));
+    return intersect(std::move(Children));
   }
 
   /// This allows unionOf(create(...), create(...)) syntax.
@@ -186,7 +186,7 @@ class Corpus {
   std::unique_ptr<Iterator> unionOf(Args... args) const {
     std::vector<std::unique_ptr<Iterator>> Children;
     detail::populateChildren(Children, std::forward<Args>(args)...);
-    return unionOf(move(Children));
+    return unionOf(std::move(Children));
   }
 };
 

diff  --git a/clang-tools-extra/clangd/unittests/DexTests.cpp b/clang-tools-extra/clangd/unittests/DexTests.cpp
index 17cf8de921d08..cafbfd324840c 100644
--- a/clang-tools-extra/clangd/unittests/DexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/DexTests.cpp
@@ -252,7 +252,7 @@ TEST(DexIterators, StringRepresentation) {
   auto I2 = L1.iterator(&Tok);
   EXPECT_EQ(llvm::to_string(*I2), "T=L2");
 
-  auto Tree = C.limit(C.intersect(move(I1), move(I2)), 10);
+  auto Tree = C.limit(C.intersect(std::move(I1), std::move(I2)), 10);
   // AND reorders its children, we don't care which order it prints.
   EXPECT_THAT(llvm::to_string(*Tree), AnyOf("(LIMIT 10 (& [1 3 5] T=L2))",
                                             "(LIMIT 10 (& T=L2 [1 3 5]))"));


        


More information about the cfe-commits mailing list