[Status] Add a LLDB_ERRORF macro for error reporting (similar to LLDB_LOGF)

llvm-svn: 371667
This commit is contained in:
Vedant Kumar 2019-09-11 21:23:42 +00:00
parent 0b91333d59
commit bb58118525
1 changed files with 7 additions and 0 deletions

View File

@ -212,4 +212,11 @@ template <> struct format_provider<lldb_private::Status> {
}; };
} }
#define LLDB_ERRORF(status, fmt, ...) \
do { \
if (status) { \
(status)->SetErrorStringWithFormat((fmt), __VA_ARGS__); \
} \
} while (0);
#endif // #ifndef LLDB_UTILITY_STATUS_H #endif // #ifndef LLDB_UTILITY_STATUS_H