From 20556c483411f0f606f2529a1ef72a0c00ef7e75 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 24 Jan 2023 15:58:34 -0800 Subject: [PATCH] [ADT] Fix circular include dependency by using std::array. NFC 2db6b34ea introduces circular dependency on llvm::ArrayRef. By inspecting commit history, it appears that we have some issue using deduction guide on std::array. Why don't we try std::array with explicit template arguments? Differential revision: https://reviews.llvm.org/D141352 --- llvm/include/llvm/ADT/STLExtras.h | 10 ++++++---- llvm/include/llvm/MC/SubtargetFeature.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index be8800c..f6a1bd8 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/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 +#include #include #include #include @@ -832,9 +833,10 @@ class zip_shortest : public zip_common, Iters...> { template bool test(const zip_shortest &other, std::index_sequence) const { - return all_of(llvm::ArrayRef({std::get(this->iterators) != - std::get(other.iterators)...}), - identity{}); + return all_of( + std::array({std::get(this->iterators) != + std::get(other.iterators)...}), + identity{}); } public: diff --git a/llvm/include/llvm/MC/SubtargetFeature.h b/llvm/include/llvm/MC/SubtargetFeature.h index 98aed32..c38b532 100644 --- a/llvm/include/llvm/MC/SubtargetFeature.h +++ b/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" -- 2.7.4