9#ifndef LLDB_EXPRESSION_DIAGNOSTICMANAGER_H
10#define LLDB_EXPRESSION_DIAGNOSTICMANAGER_H
15#include "llvm/ADT/STLExtras.h"
16#include "llvm/ADT/StringRef.h"
72 bool precede_with_newline =
true) {
73 if (precede_with_newline)
98 [](
const std::unique_ptr<Diagnostic> &diag) {
99 return diag->HasFixIts();
107 std::make_unique<Diagnostic>(message, severity, origin, compiler_id));
118 std::move(other.m_diagnostics.begin(), other.m_diagnostics.end(),
125 __attribute__((format(printf, 3, 4)));
138 std::string
GetString(
char separator =
'\n');
size_t void PutString(lldb::Severity severity, llvm::StringRef str)
void Consume(DiagnosticManager &&other)
Moves over the contents of a second diagnostic manager over.
void SetFixedExpression(std::string fixed_expression)
void AppendMessageToDiagnostic(llvm::StringRef str)
std::string m_fixed_expression
void AddDiagnostic(std::unique_ptr< Diagnostic > diagnostic)
std::string GetString(char separator='\n')
DiagnosticList m_diagnostics
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
const std::string & GetFixedExpression()
lldb::Severity m_severity
Diagnostic(const Diagnostic &rhs)
Diagnostic(llvm::StringRef message, lldb::Severity severity, DiagnosticOrigin origin, uint32_t compiler_id)
virtual ~Diagnostic()=default
void AppendMessage(llvm::StringRef message, bool precede_with_newline=true)
uint32_t GetCompilerID() const
virtual bool HasFixIts() const
lldb::Severity GetSeverity() const
DiagnosticOrigin getKind() const
DiagnosticOrigin m_origin
llvm::StringRef GetMessage() const
static bool classof(const Diagnostic *diag)
A class that represents a running process on the host machine.
const uint32_t LLDB_INVALID_COMPILER_ID
std::vector< std::unique_ptr< Diagnostic > > DiagnosticList
@ eDiagnosticOriginUnknown
Severity
Used for expressing severity in logs and diagnostics.