From b879cfa11a535062121e04777fc4e222ae9d79c5 Mon Sep 17 00:00:00 2001 From: Adrian Kuegel Date: Thu, 4 Apr 2024 06:41:32 -0700 Subject: [PATCH] Reverts 99e7acf3535eed1982be5cec9ec0537b1c2bb84f PiperOrigin-RevId: 621842461 --- third_party/llvm/vs2019.patch | 394 ------------------ third_party/llvm/workspace.bzl | 1 - third_party/tsl/third_party/llvm/vs2019.patch | 394 ------------------ .../tsl/third_party/llvm/workspace.bzl | 1 - 4 files changed, 790 deletions(-) delete mode 100644 third_party/llvm/vs2019.patch delete mode 100644 third_party/tsl/third_party/llvm/vs2019.patch diff --git a/third_party/llvm/vs2019.patch b/third_party/llvm/vs2019.patch deleted file mode 100644 index d6eff968e5f83..0000000000000 --- a/third_party/llvm/vs2019.patch +++ /dev/null @@ -1,394 +0,0 @@ -diff --git a/llvm/include/llvm/Support/FormatAdapters.h b/llvm/include/llvm/Support/FormatAdapters.h -index 495205d11748..4131e956873e 100644 ---- a/llvm/include/llvm/Support/FormatAdapters.h -+++ b/llvm/include/llvm/Support/FormatAdapters.h -@@ -16,13 +16,15 @@ - #include "llvm/Support/raw_ostream.h" - - namespace llvm { --template class FormatAdapter : public detail::format_adapter { -+template -+class FormatAdapter : public support::detail::format_adapter { - protected: - explicit FormatAdapter(T &&Item) : Item(std::forward(Item)) {} - - T Item; - }; - -+namespace support { - namespace detail { - template class AlignAdapter final : public FormatAdapter { - AlignStyle Where; -@@ -80,29 +82,31 @@ public: - Stream << Item; - } - }; --} -+} // namespace detail -+} // namespace support - - template --detail::AlignAdapter fmt_align(T &&Item, AlignStyle Where, size_t Amount, -- char Fill = ' ') { -- return detail::AlignAdapter(std::forward(Item), Where, Amount, Fill); -+support::detail::AlignAdapter fmt_align(T &&Item, AlignStyle Where, -+ size_t Amount, char Fill = ' ') { -+ return support::detail::AlignAdapter(std::forward(Item), Where, Amount, -+ Fill); - } - - template --detail::PadAdapter fmt_pad(T &&Item, size_t Left, size_t Right) { -- return detail::PadAdapter(std::forward(Item), Left, Right); -+support::detail::PadAdapter fmt_pad(T &&Item, size_t Left, size_t Right) { -+ return support::detail::PadAdapter(std::forward(Item), Left, Right); - } - - template --detail::RepeatAdapter fmt_repeat(T &&Item, size_t Count) { -- return detail::RepeatAdapter(std::forward(Item), Count); -+support::detail::RepeatAdapter fmt_repeat(T &&Item, size_t Count) { -+ return support::detail::RepeatAdapter(std::forward(Item), Count); - } - - // llvm::Error values must be consumed before being destroyed. - // Wrapping an error in fmt_consume explicitly indicates that the formatv_object - // should take ownership and consume it. --inline detail::ErrorAdapter fmt_consume(Error &&Item) { -- return detail::ErrorAdapter(std::move(Item)); -+inline support::detail::ErrorAdapter fmt_consume(Error &&Item) { -+ return support::detail::ErrorAdapter(std::move(Item)); - } - } - -diff --git a/llvm/include/llvm/Support/FormatCommon.h b/llvm/include/llvm/Support/FormatCommon.h -index 24a40c325e13..326e00936aa7 100644 ---- a/llvm/include/llvm/Support/FormatCommon.h -+++ b/llvm/include/llvm/Support/FormatCommon.h -@@ -17,13 +17,13 @@ namespace llvm { - enum class AlignStyle { Left, Center, Right }; - - struct FmtAlign { -- detail::format_adapter &Adapter; -+ support::detail::format_adapter &Adapter; - AlignStyle Where; - size_t Amount; - char Fill; - -- FmtAlign(detail::format_adapter &Adapter, AlignStyle Where, size_t Amount, -- char Fill = ' ') -+ FmtAlign(support::detail::format_adapter &Adapter, AlignStyle Where, -+ size_t Amount, char Fill = ' ') - : Adapter(Adapter), Where(Where), Amount(Amount), Fill(Fill) {} - - void format(raw_ostream &S, StringRef Options) { -diff --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h -index aa0773847161..bf489e2bfa07 100644 ---- a/llvm/include/llvm/Support/FormatProviders.h -+++ b/llvm/include/llvm/Support/FormatProviders.h -@@ -25,6 +25,7 @@ - #include - - namespace llvm { -+namespace support { - namespace detail { - template - struct use_integral_formatter -@@ -98,7 +99,8 @@ protected: - return Default; - } - }; --} -+} // namespace detail -+} // namespace support - - /// Implementation of format_provider for integral arithmetic types. - /// -@@ -125,8 +127,8 @@ protected: - - template - struct format_provider< -- T, std::enable_if_t::value>> -- : public detail::HelperFunctions { -+ T, std::enable_if_t::value>> -+ : public support::detail::HelperFunctions { - private: - public: - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { -@@ -174,8 +176,8 @@ public: - /// cases indicates the minimum number of nibbles to print. - template - struct format_provider< -- T, std::enable_if_t::value>> -- : public detail::HelperFunctions { -+ T, std::enable_if_t::value>> -+ : public support::detail::HelperFunctions { - private: - public: - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { -@@ -199,7 +201,7 @@ public: - - template - struct format_provider< -- T, std::enable_if_t::value>> { -+ T, std::enable_if_t::value>> { - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { - size_t N = StringRef::npos; - if (!Style.empty() && Style.getAsInteger(10, N)) { -@@ -231,8 +233,8 @@ template <> struct format_provider { - /// character. Otherwise, it is treated as an integer options string. - /// - template --struct format_provider::value>> { -+struct format_provider< -+ T, std::enable_if_t::value>> { - static void format(const char &V, llvm::raw_ostream &Stream, - StringRef Style) { - if (Style.empty()) -@@ -297,9 +299,9 @@ template <> struct format_provider { - /// else. - - template --struct format_provider::value>> -- : public detail::HelperFunctions { -+struct format_provider< -+ T, std::enable_if_t::value>> -+ : public support::detail::HelperFunctions { - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { - FloatStyle S; - if (Style.consume_front("P") || Style.consume_front("p")) -@@ -321,6 +323,7 @@ struct format_provider - using IterValue = typename std::iterator_traits::value_type; -@@ -328,8 +331,10 @@ using IterValue = typename std::iterator_traits::value_type; - template - struct range_item_has_provider - : public std::integral_constant< -- bool, !uses_missing_provider>::value> {}; --} -+ bool, -+ !support::detail::uses_missing_provider>::value> {}; -+} // namespace detail -+} // namespace support - - /// Implementation of format_provider for ranges. - /// -@@ -393,7 +398,7 @@ template class format_provider> { - } - - public: -- static_assert(detail::range_item_has_provider::value, -+ static_assert(support::detail::range_item_has_provider::value, - "Range value_type does not have a format provider!"); - static void format(const llvm::iterator_range &V, - llvm::raw_ostream &Stream, StringRef Style) { -@@ -403,18 +408,18 @@ public: - auto Begin = V.begin(); - auto End = V.end(); - if (Begin != End) { -- auto Adapter = detail::build_format_adapter(*Begin); -+ auto Adapter = support::detail::build_format_adapter(*Begin); - Adapter.format(Stream, ArgStyle); - ++Begin; - } - while (Begin != End) { - Stream << Sep; -- auto Adapter = detail::build_format_adapter(*Begin); -+ auto Adapter = support::detail::build_format_adapter(*Begin); - Adapter.format(Stream, ArgStyle); - ++Begin; - } - } - }; --} -+} // namespace llvm - - #endif -diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h -index ddd80d89f1cd..595f2cf559a4 100644 ---- a/llvm/include/llvm/Support/FormatVariadic.h -+++ b/llvm/include/llvm/Support/FormatVariadic.h -@@ -66,7 +66,7 @@ struct ReplacementItem { - class formatv_object_base { - protected: - StringRef Fmt; -- ArrayRef Adapters; -+ ArrayRef Adapters; - - static bool consumeFieldLayout(StringRef &Spec, AlignStyle &Where, - size_t &Align, char &Pad); -@@ -75,7 +75,7 @@ protected: - splitLiteralAndReplacement(StringRef Fmt); - - formatv_object_base(StringRef Fmt, -- ArrayRef Adapters) -+ ArrayRef Adapters) - : Fmt(Fmt), Adapters(Adapters) {} - - formatv_object_base(formatv_object_base const &rhs) = delete; -@@ -130,7 +130,7 @@ template class formatv_object : public formatv_object_base { - // of the parameters, we have to own the storage for the parameters here, and - // have the base class store type-erased pointers into this tuple. - Tuple Parameters; -- std::array::value> -+ std::array::value> - ParameterPointers; - - // The parameters are stored in a std::tuple, which does not provide runtime -@@ -142,8 +142,8 @@ template class formatv_object : public formatv_object_base { - // std::array. - struct create_adapters { - template -- std::array::value> -- operator()(Ts &... Items) { -+ std::array::value> -+ operator()(Ts &...Items) { - return {{&Items...}}; - } - }; -@@ -248,13 +248,14 @@ public: - // the details of what that is are undefined. - // - template --inline auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object(Vals))...))> { -- using ParamTuple = decltype( -- std::make_tuple(detail::build_format_adapter(std::forward(Vals))...)); -+inline auto formatv(const char *Fmt, Ts &&...Vals) -+ -> formatv_object(Vals))...))> { -+ using ParamTuple = decltype(std::make_tuple( -+ support::detail::build_format_adapter(std::forward(Vals))...)); - return formatv_object( -- Fmt, -- std::make_tuple(detail::build_format_adapter(std::forward(Vals))...)); -+ Fmt, std::make_tuple(support::detail::build_format_adapter( -+ std::forward(Vals))...)); - } - - } // end namespace llvm -diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h -index 068c327df396..a221fcadbd3c 100644 ---- a/llvm/include/llvm/Support/FormatVariadicDetails.h -+++ b/llvm/include/llvm/Support/FormatVariadicDetails.h -@@ -19,6 +19,7 @@ namespace llvm { - template struct format_provider {}; - class Error; - -+namespace support { - namespace detail { - class format_adapter { - virtual void anchor(); -@@ -156,7 +157,8 @@ std::enable_if_t::value, missing_format_adapter> - build_format_adapter(T &&) { - return missing_format_adapter(); - } --} --} -+} // namespace detail -+} // namespace support -+} // namespace llvm - - #endif -diff --git a/llvm/lib/Support/FormatVariadic.cpp b/llvm/lib/Support/FormatVariadic.cpp -index 91b4c38ade4f..3c07a80a00ae 100644 ---- a/llvm/lib/Support/FormatVariadic.cpp -+++ b/llvm/lib/Support/FormatVariadic.cpp -@@ -152,4 +152,4 @@ formatv_object_base::parseFormatString(StringRef Fmt) { - return Replacements; - } - --void detail::format_adapter::anchor() { } -+void support::detail::format_adapter::anchor() {} - -diff --git a/llvm/unittests/Support/FormatVariadicTest.cpp b/llvm/unittests/Support/FormatVariadicTest.cpp -index 58c89aad7a85..a78b25c53d7e 100644 ---- a/llvm/unittests/Support/FormatVariadicTest.cpp -+++ b/llvm/unittests/Support/FormatVariadicTest.cpp -@@ -20,8 +20,8 @@ struct Format : public FormatAdapter { - void format(raw_ostream &OS, StringRef Opt) override { OS << "Format"; } - }; - --using detail::uses_format_member; --using detail::uses_missing_provider; -+using support::detail::uses_format_member; -+using support::detail::uses_missing_provider; - - static_assert(uses_format_member::value, ""); - static_assert(uses_format_member::value, ""); -diff --git a/mlir/include/mlir/TableGen/Format.h b/mlir/include/mlir/TableGen/Format.h -index 79d3d26a9d68..e92f6c64eab5 100644 ---- a/mlir/include/mlir/TableGen/Format.h -+++ b/mlir/include/mlir/TableGen/Format.h -@@ -133,14 +133,15 @@ protected: - // std::vector. - struct CreateAdapters { - template -- std::vector operator()(Ts &...items) { -- return std::vector{&items...}; -+ std::vector -+ operator()(Ts &...items) { -+ return std::vector{&items...}; - } - }; - - StringRef fmt; - const FmtContext *context; -- std::vector adapters; -+ std::vector adapters; - std::vector replacements; - - public: -@@ -205,8 +206,8 @@ public: - - class FmtStrVecObject : public FmtObjectBase { - public: -- using StrFormatAdapter = -- decltype(llvm::detail::build_format_adapter(std::declval())); -+ using StrFormatAdapter = decltype(llvm::support::detail::build_format_adapter( -+ std::declval())); - - FmtStrVecObject(StringRef fmt, const FmtContext *ctx, - ArrayRef params); -@@ -259,14 +260,15 @@ private: - /// in C++ code generation. - template - inline auto tgfmt(StringRef fmt, const FmtContext *ctx, Ts &&...vals) -- -> FmtObject(vals))...))> { -+ -> FmtObject< -+ decltype(std::make_tuple(llvm::support::detail::build_format_adapter( -+ std::forward(vals))...))> { - using ParamTuple = decltype(std::make_tuple( -- llvm::detail::build_format_adapter(std::forward(vals))...)); -+ llvm::support::detail::build_format_adapter(std::forward(vals))...)); - return FmtObject( - fmt, ctx, -- std::make_tuple( -- llvm::detail::build_format_adapter(std::forward(vals))...)); -+ std::make_tuple(llvm::support::detail::build_format_adapter( -+ std::forward(vals))...)); - } - - inline FmtStrVecObject tgfmt(StringRef fmt, const FmtContext *ctx, -diff --git a/mlir/lib/TableGen/Format.cpp b/mlir/lib/TableGen/Format.cpp -index 03f888b139f8..65f4ad56dd15 100644 ---- a/mlir/lib/TableGen/Format.cpp -+++ b/mlir/lib/TableGen/Format.cpp -@@ -203,7 +203,8 @@ FmtStrVecObject::FmtStrVecObject(StringRef fmt, const FmtContext *ctx, - : FmtObjectBase(fmt, ctx, params.size()) { - parameters.reserve(params.size()); - for (std::string p : params) -- parameters.push_back(llvm::detail::build_format_adapter(std::move(p))); -+ parameters.push_back( -+ llvm::support::detail::build_format_adapter(std::move(p))); - - adapters.reserve(parameters.size()); - for (auto &p : parameters) diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl index 74784aeb9440d..be9d4839bee07 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -21,7 +21,6 @@ def repo(name): "//third_party/llvm:build.patch", "//third_party/llvm:mathextras.patch", "//third_party/llvm:toolchains.patch", - "//third_party/llvm:vs2019.patch", "//third_party/llvm:zstd.patch", ], link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"}, diff --git a/third_party/tsl/third_party/llvm/vs2019.patch b/third_party/tsl/third_party/llvm/vs2019.patch deleted file mode 100644 index d6eff968e5f83..0000000000000 --- a/third_party/tsl/third_party/llvm/vs2019.patch +++ /dev/null @@ -1,394 +0,0 @@ -diff --git a/llvm/include/llvm/Support/FormatAdapters.h b/llvm/include/llvm/Support/FormatAdapters.h -index 495205d11748..4131e956873e 100644 ---- a/llvm/include/llvm/Support/FormatAdapters.h -+++ b/llvm/include/llvm/Support/FormatAdapters.h -@@ -16,13 +16,15 @@ - #include "llvm/Support/raw_ostream.h" - - namespace llvm { --template class FormatAdapter : public detail::format_adapter { -+template -+class FormatAdapter : public support::detail::format_adapter { - protected: - explicit FormatAdapter(T &&Item) : Item(std::forward(Item)) {} - - T Item; - }; - -+namespace support { - namespace detail { - template class AlignAdapter final : public FormatAdapter { - AlignStyle Where; -@@ -80,29 +82,31 @@ public: - Stream << Item; - } - }; --} -+} // namespace detail -+} // namespace support - - template --detail::AlignAdapter fmt_align(T &&Item, AlignStyle Where, size_t Amount, -- char Fill = ' ') { -- return detail::AlignAdapter(std::forward(Item), Where, Amount, Fill); -+support::detail::AlignAdapter fmt_align(T &&Item, AlignStyle Where, -+ size_t Amount, char Fill = ' ') { -+ return support::detail::AlignAdapter(std::forward(Item), Where, Amount, -+ Fill); - } - - template --detail::PadAdapter fmt_pad(T &&Item, size_t Left, size_t Right) { -- return detail::PadAdapter(std::forward(Item), Left, Right); -+support::detail::PadAdapter fmt_pad(T &&Item, size_t Left, size_t Right) { -+ return support::detail::PadAdapter(std::forward(Item), Left, Right); - } - - template --detail::RepeatAdapter fmt_repeat(T &&Item, size_t Count) { -- return detail::RepeatAdapter(std::forward(Item), Count); -+support::detail::RepeatAdapter fmt_repeat(T &&Item, size_t Count) { -+ return support::detail::RepeatAdapter(std::forward(Item), Count); - } - - // llvm::Error values must be consumed before being destroyed. - // Wrapping an error in fmt_consume explicitly indicates that the formatv_object - // should take ownership and consume it. --inline detail::ErrorAdapter fmt_consume(Error &&Item) { -- return detail::ErrorAdapter(std::move(Item)); -+inline support::detail::ErrorAdapter fmt_consume(Error &&Item) { -+ return support::detail::ErrorAdapter(std::move(Item)); - } - } - -diff --git a/llvm/include/llvm/Support/FormatCommon.h b/llvm/include/llvm/Support/FormatCommon.h -index 24a40c325e13..326e00936aa7 100644 ---- a/llvm/include/llvm/Support/FormatCommon.h -+++ b/llvm/include/llvm/Support/FormatCommon.h -@@ -17,13 +17,13 @@ namespace llvm { - enum class AlignStyle { Left, Center, Right }; - - struct FmtAlign { -- detail::format_adapter &Adapter; -+ support::detail::format_adapter &Adapter; - AlignStyle Where; - size_t Amount; - char Fill; - -- FmtAlign(detail::format_adapter &Adapter, AlignStyle Where, size_t Amount, -- char Fill = ' ') -+ FmtAlign(support::detail::format_adapter &Adapter, AlignStyle Where, -+ size_t Amount, char Fill = ' ') - : Adapter(Adapter), Where(Where), Amount(Amount), Fill(Fill) {} - - void format(raw_ostream &S, StringRef Options) { -diff --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h -index aa0773847161..bf489e2bfa07 100644 ---- a/llvm/include/llvm/Support/FormatProviders.h -+++ b/llvm/include/llvm/Support/FormatProviders.h -@@ -25,6 +25,7 @@ - #include - - namespace llvm { -+namespace support { - namespace detail { - template - struct use_integral_formatter -@@ -98,7 +99,8 @@ protected: - return Default; - } - }; --} -+} // namespace detail -+} // namespace support - - /// Implementation of format_provider for integral arithmetic types. - /// -@@ -125,8 +127,8 @@ protected: - - template - struct format_provider< -- T, std::enable_if_t::value>> -- : public detail::HelperFunctions { -+ T, std::enable_if_t::value>> -+ : public support::detail::HelperFunctions { - private: - public: - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { -@@ -174,8 +176,8 @@ public: - /// cases indicates the minimum number of nibbles to print. - template - struct format_provider< -- T, std::enable_if_t::value>> -- : public detail::HelperFunctions { -+ T, std::enable_if_t::value>> -+ : public support::detail::HelperFunctions { - private: - public: - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { -@@ -199,7 +201,7 @@ public: - - template - struct format_provider< -- T, std::enable_if_t::value>> { -+ T, std::enable_if_t::value>> { - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { - size_t N = StringRef::npos; - if (!Style.empty() && Style.getAsInteger(10, N)) { -@@ -231,8 +233,8 @@ template <> struct format_provider { - /// character. Otherwise, it is treated as an integer options string. - /// - template --struct format_provider::value>> { -+struct format_provider< -+ T, std::enable_if_t::value>> { - static void format(const char &V, llvm::raw_ostream &Stream, - StringRef Style) { - if (Style.empty()) -@@ -297,9 +299,9 @@ template <> struct format_provider { - /// else. - - template --struct format_provider::value>> -- : public detail::HelperFunctions { -+struct format_provider< -+ T, std::enable_if_t::value>> -+ : public support::detail::HelperFunctions { - static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) { - FloatStyle S; - if (Style.consume_front("P") || Style.consume_front("p")) -@@ -321,6 +323,7 @@ struct format_provider - using IterValue = typename std::iterator_traits::value_type; -@@ -328,8 +331,10 @@ using IterValue = typename std::iterator_traits::value_type; - template - struct range_item_has_provider - : public std::integral_constant< -- bool, !uses_missing_provider>::value> {}; --} -+ bool, -+ !support::detail::uses_missing_provider>::value> {}; -+} // namespace detail -+} // namespace support - - /// Implementation of format_provider for ranges. - /// -@@ -393,7 +398,7 @@ template class format_provider> { - } - - public: -- static_assert(detail::range_item_has_provider::value, -+ static_assert(support::detail::range_item_has_provider::value, - "Range value_type does not have a format provider!"); - static void format(const llvm::iterator_range &V, - llvm::raw_ostream &Stream, StringRef Style) { -@@ -403,18 +408,18 @@ public: - auto Begin = V.begin(); - auto End = V.end(); - if (Begin != End) { -- auto Adapter = detail::build_format_adapter(*Begin); -+ auto Adapter = support::detail::build_format_adapter(*Begin); - Adapter.format(Stream, ArgStyle); - ++Begin; - } - while (Begin != End) { - Stream << Sep; -- auto Adapter = detail::build_format_adapter(*Begin); -+ auto Adapter = support::detail::build_format_adapter(*Begin); - Adapter.format(Stream, ArgStyle); - ++Begin; - } - } - }; --} -+} // namespace llvm - - #endif -diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h -index ddd80d89f1cd..595f2cf559a4 100644 ---- a/llvm/include/llvm/Support/FormatVariadic.h -+++ b/llvm/include/llvm/Support/FormatVariadic.h -@@ -66,7 +66,7 @@ struct ReplacementItem { - class formatv_object_base { - protected: - StringRef Fmt; -- ArrayRef Adapters; -+ ArrayRef Adapters; - - static bool consumeFieldLayout(StringRef &Spec, AlignStyle &Where, - size_t &Align, char &Pad); -@@ -75,7 +75,7 @@ protected: - splitLiteralAndReplacement(StringRef Fmt); - - formatv_object_base(StringRef Fmt, -- ArrayRef Adapters) -+ ArrayRef Adapters) - : Fmt(Fmt), Adapters(Adapters) {} - - formatv_object_base(formatv_object_base const &rhs) = delete; -@@ -130,7 +130,7 @@ template class formatv_object : public formatv_object_base { - // of the parameters, we have to own the storage for the parameters here, and - // have the base class store type-erased pointers into this tuple. - Tuple Parameters; -- std::array::value> -+ std::array::value> - ParameterPointers; - - // The parameters are stored in a std::tuple, which does not provide runtime -@@ -142,8 +142,8 @@ template class formatv_object : public formatv_object_base { - // std::array. - struct create_adapters { - template -- std::array::value> -- operator()(Ts &... Items) { -+ std::array::value> -+ operator()(Ts &...Items) { - return {{&Items...}}; - } - }; -@@ -248,13 +248,14 @@ public: - // the details of what that is are undefined. - // - template --inline auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object(Vals))...))> { -- using ParamTuple = decltype( -- std::make_tuple(detail::build_format_adapter(std::forward(Vals))...)); -+inline auto formatv(const char *Fmt, Ts &&...Vals) -+ -> formatv_object(Vals))...))> { -+ using ParamTuple = decltype(std::make_tuple( -+ support::detail::build_format_adapter(std::forward(Vals))...)); - return formatv_object( -- Fmt, -- std::make_tuple(detail::build_format_adapter(std::forward(Vals))...)); -+ Fmt, std::make_tuple(support::detail::build_format_adapter( -+ std::forward(Vals))...)); - } - - } // end namespace llvm -diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h -index 068c327df396..a221fcadbd3c 100644 ---- a/llvm/include/llvm/Support/FormatVariadicDetails.h -+++ b/llvm/include/llvm/Support/FormatVariadicDetails.h -@@ -19,6 +19,7 @@ namespace llvm { - template struct format_provider {}; - class Error; - -+namespace support { - namespace detail { - class format_adapter { - virtual void anchor(); -@@ -156,7 +157,8 @@ std::enable_if_t::value, missing_format_adapter> - build_format_adapter(T &&) { - return missing_format_adapter(); - } --} --} -+} // namespace detail -+} // namespace support -+} // namespace llvm - - #endif -diff --git a/llvm/lib/Support/FormatVariadic.cpp b/llvm/lib/Support/FormatVariadic.cpp -index 91b4c38ade4f..3c07a80a00ae 100644 ---- a/llvm/lib/Support/FormatVariadic.cpp -+++ b/llvm/lib/Support/FormatVariadic.cpp -@@ -152,4 +152,4 @@ formatv_object_base::parseFormatString(StringRef Fmt) { - return Replacements; - } - --void detail::format_adapter::anchor() { } -+void support::detail::format_adapter::anchor() {} - -diff --git a/llvm/unittests/Support/FormatVariadicTest.cpp b/llvm/unittests/Support/FormatVariadicTest.cpp -index 58c89aad7a85..a78b25c53d7e 100644 ---- a/llvm/unittests/Support/FormatVariadicTest.cpp -+++ b/llvm/unittests/Support/FormatVariadicTest.cpp -@@ -20,8 +20,8 @@ struct Format : public FormatAdapter { - void format(raw_ostream &OS, StringRef Opt) override { OS << "Format"; } - }; - --using detail::uses_format_member; --using detail::uses_missing_provider; -+using support::detail::uses_format_member; -+using support::detail::uses_missing_provider; - - static_assert(uses_format_member::value, ""); - static_assert(uses_format_member::value, ""); -diff --git a/mlir/include/mlir/TableGen/Format.h b/mlir/include/mlir/TableGen/Format.h -index 79d3d26a9d68..e92f6c64eab5 100644 ---- a/mlir/include/mlir/TableGen/Format.h -+++ b/mlir/include/mlir/TableGen/Format.h -@@ -133,14 +133,15 @@ protected: - // std::vector. - struct CreateAdapters { - template -- std::vector operator()(Ts &...items) { -- return std::vector{&items...}; -+ std::vector -+ operator()(Ts &...items) { -+ return std::vector{&items...}; - } - }; - - StringRef fmt; - const FmtContext *context; -- std::vector adapters; -+ std::vector adapters; - std::vector replacements; - - public: -@@ -205,8 +206,8 @@ public: - - class FmtStrVecObject : public FmtObjectBase { - public: -- using StrFormatAdapter = -- decltype(llvm::detail::build_format_adapter(std::declval())); -+ using StrFormatAdapter = decltype(llvm::support::detail::build_format_adapter( -+ std::declval())); - - FmtStrVecObject(StringRef fmt, const FmtContext *ctx, - ArrayRef params); -@@ -259,14 +260,15 @@ private: - /// in C++ code generation. - template - inline auto tgfmt(StringRef fmt, const FmtContext *ctx, Ts &&...vals) -- -> FmtObject(vals))...))> { -+ -> FmtObject< -+ decltype(std::make_tuple(llvm::support::detail::build_format_adapter( -+ std::forward(vals))...))> { - using ParamTuple = decltype(std::make_tuple( -- llvm::detail::build_format_adapter(std::forward(vals))...)); -+ llvm::support::detail::build_format_adapter(std::forward(vals))...)); - return FmtObject( - fmt, ctx, -- std::make_tuple( -- llvm::detail::build_format_adapter(std::forward(vals))...)); -+ std::make_tuple(llvm::support::detail::build_format_adapter( -+ std::forward(vals))...)); - } - - inline FmtStrVecObject tgfmt(StringRef fmt, const FmtContext *ctx, -diff --git a/mlir/lib/TableGen/Format.cpp b/mlir/lib/TableGen/Format.cpp -index 03f888b139f8..65f4ad56dd15 100644 ---- a/mlir/lib/TableGen/Format.cpp -+++ b/mlir/lib/TableGen/Format.cpp -@@ -203,7 +203,8 @@ FmtStrVecObject::FmtStrVecObject(StringRef fmt, const FmtContext *ctx, - : FmtObjectBase(fmt, ctx, params.size()) { - parameters.reserve(params.size()); - for (std::string p : params) -- parameters.push_back(llvm::detail::build_format_adapter(std::move(p))); -+ parameters.push_back( -+ llvm::support::detail::build_format_adapter(std::move(p))); - - adapters.reserve(parameters.size()); - for (auto &p : parameters) diff --git a/third_party/tsl/third_party/llvm/workspace.bzl b/third_party/tsl/third_party/llvm/workspace.bzl index 74784aeb9440d..be9d4839bee07 100644 --- a/third_party/tsl/third_party/llvm/workspace.bzl +++ b/third_party/tsl/third_party/llvm/workspace.bzl @@ -21,7 +21,6 @@ def repo(name): "//third_party/llvm:build.patch", "//third_party/llvm:mathextras.patch", "//third_party/llvm:toolchains.patch", - "//third_party/llvm:vs2019.patch", "//third_party/llvm:zstd.patch", ], link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"},