summaryrefslogtreecommitdiff
path: root/include/llvm/Support/FormatAdapters.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/FormatAdapters.h')
-rw-r--r--include/llvm/Support/FormatAdapters.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/Support/FormatAdapters.h b/include/llvm/Support/FormatAdapters.h
index 698e134b328d..197beb7363df 100644
--- a/include/llvm/Support/FormatAdapters.h
+++ b/include/llvm/Support/FormatAdapters.h
@@ -28,14 +28,16 @@ namespace detail {
template <typename T> class AlignAdapter final : public FormatAdapter<T> {
AlignStyle Where;
size_t Amount;
+ char Fill;
public:
- AlignAdapter(T &&Item, AlignStyle Where, size_t Amount)
- : FormatAdapter<T>(std::forward<T>(Item)), Where(Where), Amount(Amount) {}
+ AlignAdapter(T &&Item, AlignStyle Where, size_t Amount, char Fill)
+ : FormatAdapter<T>(std::forward<T>(Item)), Where(Where), Amount(Amount),
+ Fill(Fill) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
auto Adapter = detail::build_format_adapter(std::forward<T>(this->Item));
- FmtAlign(Adapter, Where, Amount).format(Stream, Style);
+ FmtAlign(Adapter, Where, Amount, Fill).format(Stream, Style);
}
};
@@ -72,8 +74,9 @@ public:
}
template <typename T>
-detail::AlignAdapter<T> fmt_align(T &&Item, AlignStyle Where, size_t Amount) {
- return detail::AlignAdapter<T>(std::forward<T>(Item), Where, Amount);
+detail::AlignAdapter<T> fmt_align(T &&Item, AlignStyle Where, size_t Amount,
+ char Fill = ' ') {
+ return detail::AlignAdapter<T>(std::forward<T>(Item), Where, Amount, Fill);
}
template <typename T>