11#include "llvm/Support/ErrorHandling.h"
27 if (str.size() && str.back() ==
'\n') {
44 llvm_unreachable(
"switch needs another case for lldb::Severity enum");
49 llvm::raw_string_ostream stream(ret);
55 llvm::StringRef message = diagnostic->GetMessage();
56 std::string searchable_message = message.lower();
57 auto severity_pos = message.find(severity);
58 stream << message.take_front(severity_pos);
60 if (severity_pos != llvm::StringRef::npos)
61 stream << message.drop_front(severity_pos + severity.size());
73 va_start(args, format);
83 llvm::StringRef str) {
static const char * StringForSeverity(lldb::Severity severity)
size_t void PutString(lldb::Severity severity, llvm::StringRef str)
std::string GetString(char separator='\n')
const DiagnosticList & Diagnostics()
void AddDiagnostic(llvm::StringRef message, lldb::Severity severity, DiagnosticOrigin origin, uint32_t compiler_id=LLDB_INVALID_COMPILER_ID)
size_t Printf(lldb::Severity severity, const char *format,...) __attribute__((format(printf
void PutCString(const char *cstr)
llvm::StringRef GetString() const
size_t size_t PrintfVarArg(const char *format, va_list args)
A class that represents a running process on the host machine.
Severity
Used for expressing severity in logs and diagnostics.