1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00

[Support] Add a formatv provider for Twine.

llvm-svn: 297548
This commit is contained in:
Zachary Turner 2017-03-11 02:45:50 +00:00
parent 4005067c57
commit b2ef21fc43

View File

@ -18,6 +18,7 @@
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/FormatVariadicDetails.h"
#include "llvm/Support/NativeFormatting.h"
@ -209,6 +210,17 @@ struct format_provider<
}
};
/// Implementation of format_provider<T> for llvm::Twine.
///
/// This follows the same rules as the string formatter.
template <> struct format_provider<Twine> {
static void format(const Twine &V, llvm::raw_ostream &Stream,
StringRef Style) {
format_provider<std::string>::format(V.str(), Stream, Style);
}
};
/// Implementation of format_provider<T> for characters.
///
/// The options string of a character type has the grammar: