Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 1 | //===-- Status.cpp -----------------------------------------------*- C++ |
| 2 | //-*-===// |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is distributed under the University of Illinois Open Source |
| 7 | // License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 11 | #include "lldb/Utility/Status.h" |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 12 | |
| 13 | #include "lldb/Utility/VASPrintf.h" |
Pavel Labath | 10c41f3 | 2017-06-06 14:06:17 +0000 | [diff] [blame] | 14 | #include "lldb/lldb-defines.h" // for LLDB_GENERIC_ERROR |
| 15 | #include "lldb/lldb-enumerations.h" // for ErrorType, ErrorType::eErr... |
| 16 | #include "llvm/ADT/SmallString.h" // for SmallString |
| 17 | #include "llvm/ADT/StringRef.h" // for StringRef |
| 18 | #include "llvm/Support/Errno.h" |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 19 | #include "llvm/Support/FormatProviders.h" // for format_provider |
| 20 | |
| 21 | #include <cerrno> |
| 22 | #include <cstdarg> |
| 23 | #include <string> // for string |
| 24 | #include <system_error> |
| 25 | |
Charles Davis | 322fc84 | 2013-08-27 06:13:56 +0000 | [diff] [blame] | 26 | #ifdef __APPLE__ |
Charles Davis | 510938e | 2013-08-27 05:04:57 +0000 | [diff] [blame] | 27 | #include <mach/mach.h> |
Charles Davis | 322fc84 | 2013-08-27 06:13:56 +0000 | [diff] [blame] | 28 | #endif |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 29 | |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 30 | #include <stdint.h> // for uint32_t |
Eugene Zelenko | a74f37a | 2016-03-10 23:57:12 +0000 | [diff] [blame] | 31 | |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 32 | namespace llvm { |
| 33 | class raw_ostream; |
| 34 | } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 35 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 36 | using namespace lldb; |
| 37 | using namespace lldb_private; |
| 38 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 39 | Status::Status() : m_code(0), m_type(eErrorTypeInvalid), m_string() {} |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 40 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 41 | Status::Status(ValueType err, ErrorType type) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 42 | : m_code(err), m_type(type), m_string() {} |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 43 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 44 | Status::Status(std::error_code EC) |
Zachary Turner | 7d86ee5 | 2017-03-08 17:56:08 +0000 | [diff] [blame] | 45 | : m_code(EC.value()), m_type(ErrorType::eErrorTypeGeneric), |
| 46 | m_string(EC.message()) {} |
| 47 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 48 | Status::Status(const Status &rhs) = default; |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 49 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 50 | Status::Status(const char *format, ...) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 51 | : m_code(0), m_type(eErrorTypeInvalid), m_string() { |
| 52 | va_list args; |
| 53 | va_start(args, format); |
| 54 | SetErrorToGenericError(); |
| 55 | SetErrorStringWithVarArg(format, args); |
| 56 | va_end(args); |
Enrico Granata | f2bbf71 | 2011-07-15 02:26:42 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Pavel Labath | 3adc408 | 2017-06-15 11:23:26 +0000 | [diff] [blame] | 59 | const Status &Status::operator=(llvm::Error error) { |
| 60 | if (!error) { |
| 61 | Clear(); |
| 62 | return *this; |
| 63 | } |
Pavel Labath | a24a3a3 | 2017-05-18 12:46:50 +0000 | [diff] [blame] | 64 | |
| 65 | // if the error happens to be a errno error, preserve the error code |
| 66 | error = llvm::handleErrors( |
| 67 | std::move(error), [&](std::unique_ptr<llvm::ECError> e) -> llvm::Error { |
| 68 | std::error_code ec = e->convertToErrorCode(); |
| 69 | if (ec.category() == std::generic_category()) { |
| 70 | m_code = ec.value(); |
| 71 | m_type = ErrorType::eErrorTypePOSIX; |
| 72 | return llvm::Error::success(); |
| 73 | } |
| 74 | return llvm::Error(std::move(e)); |
| 75 | }); |
| 76 | |
| 77 | // Otherwise, just preserve the message |
Pavel Labath | 3adc408 | 2017-06-15 11:23:26 +0000 | [diff] [blame] | 78 | if (error) { |
| 79 | SetErrorToGenericError(); |
Pavel Labath | a24a3a3 | 2017-05-18 12:46:50 +0000 | [diff] [blame] | 80 | SetErrorString(llvm::toString(std::move(error))); |
Pavel Labath | 3adc408 | 2017-06-15 11:23:26 +0000 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | return *this; |
Pavel Labath | a24a3a3 | 2017-05-18 12:46:50 +0000 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | llvm::Error Status::ToError() const { |
| 87 | if (Success()) |
| 88 | return llvm::Error::success(); |
| 89 | if (m_type == ErrorType::eErrorTypePOSIX) |
| 90 | return llvm::errorCodeToError(std::error_code(m_code, std::generic_category())); |
| 91 | return llvm::make_error<llvm::StringError>(AsCString(), |
| 92 | llvm::inconvertibleErrorCode()); |
| 93 | } |
| 94 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 95 | //---------------------------------------------------------------------- |
| 96 | // Assignment operator |
| 97 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 98 | const Status &Status::operator=(const Status &rhs) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 99 | if (this != &rhs) { |
| 100 | m_code = rhs.m_code; |
| 101 | m_type = rhs.m_type; |
| 102 | m_string = rhs.m_string; |
| 103 | } |
| 104 | return *this; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 107 | Status::~Status() = default; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 108 | |
| 109 | //---------------------------------------------------------------------- |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 110 | // Get the error value as a NULL C string. The error string will be fetched and |
| 111 | // cached on demand. The cached error string value will remain until the error |
| 112 | // value is changed or cleared. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 113 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 114 | const char *Status::AsCString(const char *default_error_str) const { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 115 | if (Success()) |
| 116 | return nullptr; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 117 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 118 | if (m_string.empty()) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 119 | switch (m_type) { |
| 120 | case eErrorTypeMachKernel: |
| 121 | #if defined(__APPLE__) |
Pavel Labath | 10c41f3 | 2017-06-06 14:06:17 +0000 | [diff] [blame] | 122 | if (const char *s = ::mach_error_string(m_code)) |
| 123 | m_string.assign(s); |
Eli Friedman | 6eb685c | 2010-06-10 23:45:58 +0000 | [diff] [blame] | 124 | #endif |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 125 | break; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 126 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 127 | case eErrorTypePOSIX: |
Pavel Labath | 10c41f3 | 2017-06-06 14:06:17 +0000 | [diff] [blame] | 128 | m_string = llvm::sys::StrError(m_code); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 129 | break; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 130 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 131 | default: |
| 132 | break; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 133 | } |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 134 | } |
| 135 | if (m_string.empty()) { |
| 136 | if (default_error_str) |
| 137 | m_string.assign(default_error_str); |
| 138 | else |
| 139 | return nullptr; // User wanted a nullptr string back... |
| 140 | } |
| 141 | return m_string.c_str(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 142 | } |
| 143 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 144 | //---------------------------------------------------------------------- |
| 145 | // Clear the error and any cached error string that it might contain. |
| 146 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 147 | void Status::Clear() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 148 | m_code = 0; |
| 149 | m_type = eErrorTypeInvalid; |
| 150 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | //---------------------------------------------------------------------- |
| 154 | // Access the error value. |
| 155 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 156 | Status::ValueType Status::GetError() const { return m_code; } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 157 | |
| 158 | //---------------------------------------------------------------------- |
| 159 | // Access the error type. |
| 160 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 161 | ErrorType Status::GetType() const { return m_type; } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 162 | |
| 163 | //---------------------------------------------------------------------- |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 164 | // Returns true if this object contains a value that describes an error or |
| 165 | // otherwise non-success result. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 166 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 167 | bool Status::Fail() const { return m_code != 0; } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 168 | |
| 169 | //---------------------------------------------------------------------- |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 170 | // Set accesssor for the error value to "err" and the type to |
| 171 | // "eErrorTypeMachKernel" |
| 172 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 173 | void Status::SetMachError(uint32_t err) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 174 | m_code = err; |
| 175 | m_type = eErrorTypeMachKernel; |
| 176 | m_string.clear(); |
| 177 | } |
| 178 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 179 | void Status::SetExpressionError(lldb::ExpressionResults result, |
| 180 | const char *mssg) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 181 | m_code = result; |
| 182 | m_type = eErrorTypeExpression; |
| 183 | m_string = mssg; |
| 184 | } |
| 185 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 186 | int Status::SetExpressionErrorWithFormat(lldb::ExpressionResults result, |
| 187 | const char *format, ...) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 188 | int length = 0; |
| 189 | |
| 190 | if (format != nullptr && format[0]) { |
| 191 | va_list args; |
| 192 | va_start(args, format); |
| 193 | length = SetErrorStringWithVarArg(format, args); |
| 194 | va_end(args); |
| 195 | } else { |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 196 | m_string.clear(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 197 | } |
| 198 | m_code = result; |
| 199 | m_type = eErrorTypeExpression; |
| 200 | return length; |
Jim Ingham | 1624a2d | 2014-05-05 02:26:40 +0000 | [diff] [blame] | 201 | } |
| 202 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 203 | //---------------------------------------------------------------------- |
| 204 | // Set accesssor for the error value and type. |
| 205 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 206 | void Status::SetError(ValueType err, ErrorType type) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 207 | m_code = err; |
| 208 | m_type = type; |
| 209 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | //---------------------------------------------------------------------- |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 213 | // Update the error value to be "errno" and update the type to be "POSIX". |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 214 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 215 | void Status::SetErrorToErrno() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 216 | m_code = errno; |
| 217 | m_type = eErrorTypePOSIX; |
| 218 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | //---------------------------------------------------------------------- |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 222 | // Update the error value to be LLDB_GENERIC_ERROR and update the type to be |
| 223 | // "Generic". |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 224 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 225 | void Status::SetErrorToGenericError() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 226 | m_code = LLDB_GENERIC_ERROR; |
| 227 | m_type = eErrorTypeGeneric; |
| 228 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | //---------------------------------------------------------------------- |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 232 | // Set accessor for the error string value for a specific error. This allows |
| 233 | // any string to be supplied as an error explanation. The error string value |
| 234 | // will remain until the error value is cleared or a new error value/type is |
| 235 | // assigned. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 236 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 237 | void Status::SetErrorString(llvm::StringRef err_str) { |
Zachary Turner | c156427 | 2016-11-16 21:15:24 +0000 | [diff] [blame] | 238 | if (!err_str.empty()) { |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 239 | // If we have an error string, we should always at least have an error set |
| 240 | // to a generic value. |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 241 | if (Success()) |
| 242 | SetErrorToGenericError(); |
Zachary Turner | c156427 | 2016-11-16 21:15:24 +0000 | [diff] [blame] | 243 | } |
| 244 | m_string = err_str; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | //------------------------------------------------------------------ |
| 248 | /// Set the current error string to a formatted error string. |
| 249 | /// |
| 250 | /// @param format |
| 251 | /// A printf style format string |
| 252 | //------------------------------------------------------------------ |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 253 | int Status::SetErrorStringWithFormat(const char *format, ...) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 254 | if (format != nullptr && format[0]) { |
| 255 | va_list args; |
| 256 | va_start(args, format); |
| 257 | int length = SetErrorStringWithVarArg(format, args); |
| 258 | va_end(args); |
| 259 | return length; |
| 260 | } else { |
| 261 | m_string.clear(); |
| 262 | } |
| 263 | return 0; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 264 | } |
| 265 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 266 | int Status::SetErrorStringWithVarArg(const char *format, va_list args) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 267 | if (format != nullptr && format[0]) { |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 268 | // If we have an error string, we should always at least have an error set |
| 269 | // to a generic value. |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 270 | if (Success()) |
| 271 | SetErrorToGenericError(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 272 | |
Zachary Turner | 24ae629 | 2017-02-16 19:38:21 +0000 | [diff] [blame] | 273 | llvm::SmallString<1024> buf; |
| 274 | VASprintf(buf, format, args); |
Pavel Labath | a272fa8 | 2017-02-17 10:19:46 +0000 | [diff] [blame] | 275 | m_string = buf.str(); |
Zachary Turner | 24ae629 | 2017-02-16 19:38:21 +0000 | [diff] [blame] | 276 | return buf.size(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 277 | } else { |
| 278 | m_string.clear(); |
| 279 | } |
| 280 | return 0; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 281 | } |
| 282 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 283 | //---------------------------------------------------------------------- |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame^] | 284 | // Returns true if the error code in this object is considered a successful |
| 285 | // return value. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 286 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 287 | bool Status::Success() const { return m_code == 0; } |
Jim Ingham | 4e5c821 | 2013-06-07 22:09:53 +0000 | [diff] [blame] | 288 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 289 | bool Status::WasInterrupted() const { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 290 | return (m_type == eErrorTypePOSIX && m_code == EINTR); |
Jim Ingham | 4e5c821 | 2013-06-07 22:09:53 +0000 | [diff] [blame] | 291 | } |
Zachary Turner | 33aba3c | 2017-02-06 18:31:44 +0000 | [diff] [blame] | 292 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 293 | void llvm::format_provider<lldb_private::Status>::format( |
| 294 | const lldb_private::Status &error, llvm::raw_ostream &OS, |
Zachary Turner | 33aba3c | 2017-02-06 18:31:44 +0000 | [diff] [blame] | 295 | llvm::StringRef Options) { |
| 296 | llvm::format_provider<llvm::StringRef>::format(error.AsCString(), OS, |
| 297 | Options); |
| 298 | } |