25 #ifndef LLVM_SUPPORT_FORMATVARIADIC_H 26 #define LLVM_SUPPORT_FORMATVARIADIC_H 53 Where(Where), Pad(Pad), Options(Options) {}
74 template <
typename... Ts>
75 std::vector<detail::format_adapter *>
operator()(Ts &... Items) {
76 return std::vector<detail::format_adapter *>{&Items...};
81 std::vector<detail::format_adapter *>
Adapters;
85 size_t &
Align,
char &Pad);
87 static std::pair<ReplacementItem, StringRef>
88 splitLiteralAndReplacement(
StringRef Fmt);
92 : Fmt(Fmt), Replacements(parseFormatString(Fmt)) {
93 Adapters.reserve(ParamCount);
99 : Fmt(
std::move(rhs.Fmt)),
101 Replacements(
std::move(rhs.Replacements)) {
102 Adapters.reserve(rhs.
Adapters.size());
106 for (
auto &R : Replacements) {
113 if (R.Index >= Adapters.size()) {
118 auto W = Adapters[R.Index];
121 Align.
format(S, R.Options);
124 static std::vector<ReplacementItem> parseFormatString(
StringRef Fmt);
145 operator std::string()
const {
return str(); }
157 Parameters(
std::move(Params)) {
165 Parameters(
std::move(rhs.Parameters)) {
252 template <
typename... Ts>
255 using ParamTuple = decltype(
264 #endif // LLVM_SUPPORT_FORMATVARIADIC_H
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
ReplacementItem(StringRef Literal)
This class represents lattice values for constants.
A raw_ostream that writes to an SmallVector or SmallString.
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
void format(raw_ostream &S, StringRef Options)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
auto apply_tuple(F &&f, Tuple &&t) -> decltype(detail::apply_tuple_impl(std::forward< F >(f), std::forward< Tuple >(t), std::make_index_sequence< std::tuple_size< typename std::decay< Tuple >::type >::value >
Given an input tuple (a1, a2, ..., an), pass the arguments of the tuple variadically to f as if by ca...
The instances of the Type class are immutable: once they are created, they are never changed...
This struct is a compact representation of a valid (non-zero power of two) alignment.
ReplacementItem(StringRef Spec, size_t Index, size_t Align, AlignStyle Where, char Pad, StringRef Options)
std::enable_if< uses_format_member< T >::value, T >::type build_format_adapter(T &&Item)
A raw_ostream that writes to an std::string.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.