llvm.org GIT mirror llvm / fb49289
Try to fix build after llvm::formatv() patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286686 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 3 years ago
3 changed file(s) with 8 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
3232
3333 public:
3434 AlignAdapter(T &&Item, AlignStyle Where, size_t Amount)
35 : AdapterBase(std::forward(Item)), Where(Where), Amount(Amount) {}
35 : AdapterBase(std::forward(Item)), Where(Where), Amount(Amount) {}
3636
3737 void format(llvm::raw_ostream &Stream, StringRef Style) {
38 auto Wrapper = detail::build_format_wrapper(std::forward(Item));
38 auto Wrapper = detail::build_format_wrapper(std::forward(this->Item));
3939 FmtAlign(Wrapper, Where, Amount).format(Stream, Style);
4040 }
4141 };
4646
4747 public:
4848 PadAdapter(T &&Item, size_t Left, size_t Right)
49 : AdapterBase(std::forward(Item)), Left(Left), Right(Right) {}
49 : AdapterBase(std::forward(Item)), Left(Left), Right(Right) {}
5050
5151 void format(llvm::raw_ostream &Stream, StringRef Style) {
52 auto Wrapper = detail::build_format_wrapper(std::forward(Item));
52 auto Wrapper = detail::build_format_wrapper(std::forward(this->Item));
5353 Stream.indent(Left);
5454 Wrapper.format(Stream, Style);
5555 Stream.indent(Right);
6161
6262 public:
6363 RepeatAdapter(T &&Item, size_t Count)
64 : AdapterBase(std::forward(Item)), Count(Count) {}
64 : AdapterBase(std::forward(Item)), Count(Count) {}
6565
6666 void format(llvm::raw_ostream &Stream, StringRef Style) {
67 auto Wrapper = detail::build_format_wrapper(std::forward(Item));
67 auto Wrapper = detail::build_format_wrapper(std::forward(this->Item));
6868 for (size_t I = 0; I < Count; ++I) {
6969 Wrapper.format(Stream, Style);
7070 }
6767 Result = None;
6868 } else {
6969 assert(Prec < 100 && "Precision out of range");
70 Result = std::min(99u, Prec);
70 Result = std::min(99u, Prec);
7171 }
7272 return Result;
7373 }
4949 }
5050 };
5151
52 template class missing_format_wrapper : public format_wrapper {
53 public:
54 missing_format_wrapper() {
55 static_assert(false, "T does not have a format_provider");
56 }
57 void format(llvm::raw_ostream &S, StringRef Options) override {}
58 };
52 template class missing_format_wrapper;
5953
6054 // Test if T is a class that contains a member function with the signature:
6155 //