[PATCH] D141352: [ADT] Fix circular include dependency by using std::array. NFC

Younan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 22:33:37 PST 2023


zyounan updated this revision to Diff 487686.
zyounan added a comment.

Add header `llvm/ADT/Hashing.h`, which is included by `ArrayRef.h` before. This header may be dependent by some TUs indirectly.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141352/new/

https://reviews.llvm.org/D141352

Files:
  llvm/include/llvm/ADT/STLExtras.h


Index: llvm/include/llvm/ADT/STLExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLExtras.h
+++ llvm/include/llvm/ADT/STLExtras.h
@@ -17,7 +17,7 @@
 #ifndef LLVM_ADT_STLEXTRAS_H
 #define LLVM_ADT_STLEXTRAS_H
 
-#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/STLForwardCompat.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/identity.h"
@@ -26,6 +26,7 @@
 #include "llvm/Config/abi-breaking.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
+#include <array>
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -826,9 +827,10 @@
   template <size_t... Ns>
   bool test(const zip_shortest<Iters...> &other,
             std::index_sequence<Ns...>) const {
-    return all_of(llvm::ArrayRef<bool>({std::get<Ns>(this->iterators) !=
-                                        std::get<Ns>(other.iterators)...}),
-                  identity<bool>{});
+    return all_of(
+        std::array<bool, sizeof...(Ns)>({std::get<Ns>(this->iterators) !=
+                                         std::get<Ns>(other.iterators)...}),
+        identity<bool>{});
   }
 
 public:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141352.487686.patch
Type: text/x-patch
Size: 1194 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230110/9a35ca48/attachment.bin>


More information about the llvm-commits mailing list