diff --git a/include/llvm-dialects/TableGen/Format.h b/include/llvm-dialects/TableGen/Format.h
index 9ecf184..4524bb2 100644
--- a/include/llvm-dialects/TableGen/Format.h
+++ b/include/llvm-dialects/TableGen/Format.h
@@ -35,13 +35,6 @@
namespace llvm_dialects {
-namespace llvm_support_detail =
-#if !defined(LLVM_MAIN_REVISION) || LLVM_MAIN_REVISION >= 494496
- llvm::support::detail;
-#else
- llvm::detail;
-#endif
-
/// Format context containing substitutions for special placeholders.
///
/// This context divides special placeholders into two categories: builtin ones
@@ -192,14 +185,15 @@ class FmtObjectBase {
// std::vector.
struct CreateAdapters {
template
- std::vector operator()(Ts &...items) {
- return std::vector{&items...};
+ std::vector
+ operator()(Ts &... items) {
+ return std::vector{&items...};
}
};
llvm::StringRef fmt;
const FmtContext *context;
- std::vector adapters;
+ std::vector adapters;
std::vector replacements;
public:
@@ -259,8 +253,8 @@ template class FmtObject : public FmtObjectBase {
class FmtStrVecObject : public FmtObjectBase {
public:
- using StrFormatAdapter =
- decltype(llvm_support_detail::build_format_adapter(std::declval()));
+ using StrFormatAdapter = decltype(
+ llvm::support::detail::build_format_adapter(std::declval()));
FmtStrVecObject(llvm::StringRef fmt, const FmtContext *ctx,
llvm::ArrayRef params);
@@ -318,15 +312,16 @@ class FmtStrVecObject : public FmtObjectBase {
/// 2. This utility does not support format layout because it is rarely needed
/// in C++ code generation.
template
-inline auto tgfmt(llvm::StringRef fmt, const FmtContext *ctx, Ts &&...vals)
- -> FmtObject(vals))...))> {
+inline auto tgfmt(llvm::StringRef fmt, const FmtContext *ctx, Ts &&... vals)
+ -> FmtObject<
+ decltype(std::make_tuple(llvm::support::detail::build_format_adapter(
+ std::forward(vals))...))> {
using ParamTuple = decltype(std::make_tuple(
- llvm_support_detail::build_format_adapter(std::forward(vals))...));
+ llvm::support::detail::build_format_adapter(std::forward(vals))...));
return FmtObject(
fmt, ctx,
- std::make_tuple(
- llvm_support_detail::build_format_adapter(std::forward(vals))...));
+ std::make_tuple(llvm::support::detail::build_format_adapter(
+ std::forward(vals))...));
}
inline FmtStrVecObject tgfmt(llvm::StringRef fmt, const FmtContext *ctx,
diff --git a/lib/TableGen/Format.cpp b/lib/TableGen/Format.cpp
index a55cef9..d911618 100644
--- a/lib/TableGen/Format.cpp
+++ b/lib/TableGen/Format.cpp
@@ -218,7 +218,7 @@ void FmtObjectBase::format(raw_ostream &s) const {
s << repl.spec << kMarkerForNoSubst;
continue;
}
- auto range = ArrayRef(adapters);
+ auto range = ArrayRef(adapters);
range = range.drop_front(repl.index);
llvm::interleaveComma(range, s,
[&](auto &x) { x->format(s, /*Options=*/""); });
@@ -254,7 +254,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_support_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)