[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
Fri Jan 20 20:28:34 PST 2023


zyounan updated this revision to Diff 491024.
zyounan added a reviewer: MaskRay.
zyounan added a comment.

Fix issue


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141352

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


Index: llvm/include/llvm/MC/SubtargetFeature.h
===================================================================
--- llvm/include/llvm/MC/SubtargetFeature.h
+++ llvm/include/llvm/MC/SubtargetFeature.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_MC_SUBTARGETFEATURE_H
 #define LLVM_MC_SUBTARGETFEATURE_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/MathExtras.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>
@@ -832,9 +833,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.491024.patch
Type: text/x-patch
Size: 1625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230121/a1bf9672/attachment.bin>


More information about the llvm-commits mailing list