[clang-tools-extra] r368990 - Replace llvm::integer_sequence and friends with the C++14 standard version

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 15 03:56:05 PDT 2019


Author: d0k
Date: Thu Aug 15 03:56:05 2019
New Revision: 368990

URL: http://llvm.org/viewvc/llvm-project?rev=368990&view=rev
Log:
Replace llvm::integer_sequence and friends with the C++14 standard version

The implementation in libc++ takes O(1) compile time, ours was O(n).

Modified:
    clang-tools-extra/trunk/clangd/Function.h
    clang-tools-extra/trunk/clangd/unittests/Matchers.h

Modified: clang-tools-extra/trunk/clangd/Function.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Function.h?rev=368990&r1=368989&r2=368990&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Function.h (original)
+++ clang-tools-extra/trunk/clangd/Function.h Thu Aug 15 03:56:05 2019
@@ -59,14 +59,14 @@ private:
 public:
   template <class... RestArgs>
   auto operator()(RestArgs &&... Rest)
-      -> decltype(this->CallImpl(llvm::index_sequence_for<Args...>(),
+      -> decltype(this->CallImpl(std::index_sequence_for<Args...>(),
                                  std::forward<RestArgs>(Rest)...)) {
 
 #ifndef NDEBUG
     assert(!WasCalled && "Can only call result of Bind once.");
     WasCalled = true;
 #endif
-    return CallImpl(llvm::index_sequence_for<Args...>(),
+    return CallImpl(std::index_sequence_for<Args...>(),
                     std::forward<RestArgs>(Rest)...);
   }
 };

Modified: clang-tools-extra/trunk/clangd/unittests/Matchers.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/Matchers.h?rev=368990&r1=368989&r2=368990&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/Matchers.h (original)
+++ clang-tools-extra/trunk/clangd/unittests/Matchers.h Thu Aug 15 03:56:05 2019
@@ -89,12 +89,12 @@ public:
 
   template <typename T> operator Matcher<const std::vector<T> &>() const {
     return ::testing::MakeMatcher(new SubsequenceMatcher<T>(
-        TypedMatchers<T>(llvm::index_sequence_for<M...>{})));
+        TypedMatchers<T>(std::index_sequence_for<M...>{})));
   }
 
 private:
   template <typename T, size_t... I>
-  std::vector<Matcher<T>> TypedMatchers(llvm::index_sequence<I...>) const {
+  std::vector<Matcher<T>> TypedMatchers(std::index_sequence<I...>) const {
     return {std::get<I>(Matchers)...};
   }
 };




More information about the cfe-commits mailing list