11#include "llvm/ADT/SmallString.h"
12#include "llvm/ADT/SmallVector.h"
13#include "llvm/ADT/StringRef.h"
21 llvm::SmallString<16>
error(
"<Encoding error>");
26 va_copy(copy_args, args);
28 buf.resize(buf.capacity());
30 int length = ::vsnprintf(buf.data(), buf.size(), fmt, args);
37 if (
size_t(length) >= buf.size()) {
40 buf.resize(length + 1);
41 length = ::vsnprintf(buf.data(), buf.size(), fmt, copy_args);
47 assert(
size_t(length) < buf.size());
static llvm::raw_ostream & error(Stream &strm)
bool VASprintf(llvm::SmallVectorImpl< char > &buf, const char *fmt, va_list args)