[llvm] r286686 - Try to fix build after llvm::formatv() patch.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 11 16:18:43 PST 2016
Author: zturner
Date: Fri Nov 11 18:18:42 2016
New Revision: 286686
URL: http://llvm.org/viewvc/llvm-project?rev=286686&view=rev
Log:
Try to fix build after llvm::formatv() patch.
Modified:
llvm/trunk/include/llvm/Support/FormatAdapters.h
llvm/trunk/include/llvm/Support/FormatProviders.h
llvm/trunk/include/llvm/Support/FormatVariadicDetails.h
Modified: llvm/trunk/include/llvm/Support/FormatAdapters.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormatAdapters.h?rev=286686&r1=286685&r2=286686&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FormatAdapters.h (original)
+++ llvm/trunk/include/llvm/Support/FormatAdapters.h Fri Nov 11 18:18:42 2016
@@ -33,10 +33,10 @@ template <typename T> class AlignAdapter
public:
AlignAdapter(T &&Item, AlignStyle Where, size_t Amount)
- : AdapterBase(std::forward<T>(Item)), Where(Where), Amount(Amount) {}
+ : AdapterBase<T>(std::forward<T>(Item)), Where(Where), Amount(Amount) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
- auto Wrapper = detail::build_format_wrapper(std::forward<T>(Item));
+ auto Wrapper = detail::build_format_wrapper(std::forward<T>(this->Item));
FmtAlign(Wrapper, Where, Amount).format(Stream, Style);
}
};
@@ -47,10 +47,10 @@ template <typename T> class PadAdapter :
public:
PadAdapter(T &&Item, size_t Left, size_t Right)
- : AdapterBase(std::forward<T>(Item)), Left(Left), Right(Right) {}
+ : AdapterBase<T>(std::forward<T>(Item)), Left(Left), Right(Right) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
- auto Wrapper = detail::build_format_wrapper(std::forward<T>(Item));
+ auto Wrapper = detail::build_format_wrapper(std::forward<T>(this->Item));
Stream.indent(Left);
Wrapper.format(Stream, Style);
Stream.indent(Right);
@@ -62,10 +62,10 @@ template <typename T> class RepeatAdapte
public:
RepeatAdapter(T &&Item, size_t Count)
- : AdapterBase(std::forward<T>(Item)), Count(Count) {}
+ : AdapterBase<T>(std::forward<T>(Item)), Count(Count) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
- auto Wrapper = detail::build_format_wrapper(std::forward<T>(Item));
+ auto Wrapper = detail::build_format_wrapper(std::forward<T>(this->Item));
for (size_t I = 0; I < Count; ++I) {
Wrapper.format(Stream, Style);
}
Modified: llvm/trunk/include/llvm/Support/FormatProviders.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormatProviders.h?rev=286686&r1=286685&r2=286686&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FormatProviders.h (original)
+++ llvm/trunk/include/llvm/Support/FormatProviders.h Fri Nov 11 18:18:42 2016
@@ -68,7 +68,7 @@ protected:
Result = None;
} else {
assert(Prec < 100 && "Precision out of range");
- Result = std::min(99u, Prec);
+ Result = std::min<size_t>(99u, Prec);
}
return Result;
}
Modified: llvm/trunk/include/llvm/Support/FormatVariadicDetails.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormatVariadicDetails.h?rev=286686&r1=286685&r2=286686&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FormatVariadicDetails.h (original)
+++ llvm/trunk/include/llvm/Support/FormatVariadicDetails.h Fri Nov 11 18:18:42 2016
@@ -50,13 +50,7 @@ public:
}
};
-template <typename T> class missing_format_wrapper : public format_wrapper {
-public:
- missing_format_wrapper() {
- static_assert(false, "T does not have a format_provider");
- }
- void format(llvm::raw_ostream &S, StringRef Options) override {}
-};
+template <typename T> class missing_format_wrapper;
// Test if T is a class that contains a member function with the signature:
//
More information about the llvm-commits
mailing list