9#ifndef LLDB_EXPRESSION_DIAGNOSTICMANAGER_H
10#define LLDB_EXPRESSION_DIAGNOSTICMANAGER_H
19#include "llvm/ADT/STLExtras.h"
20#include "llvm/ADT/StringRef.h"
30 :
public llvm::ErrorInfo<ExpressionError, DiagnosticError> {
38 std::vector<DiagnosticDetail> details = {});
39 std::string
message()
const override;
40 llvm::ArrayRef<DiagnosticDetail>
GetDetails()
const override {
44 void log(llvm::raw_ostream &
OS)
const override;
45 std::unique_ptr<CloneableError>
Clone()
const override;
92 void AppendMessage(llvm::StringRef message,
bool precede_with_newline =
true);
114 [](
const std::unique_ptr<Diagnostic> &diag) {
115 return diag->HasFixIts();
131 std::move(other.m_diagnostics.begin(), other.m_diagnostics.end(),
138 __attribute__((format(printf, 3, 4)));
148 llvm::Twine message = {})
const;
155 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.
llvm::Error GetAsError(lldb::ExpressionResults result, llvm::Twine message={}) const
Returns an ExpressionError with arg as error code.
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()
DiagnosticDetail m_detail
const DiagnosticDetail & GetDetail() const
Diagnostic(DiagnosticOrigin origin, uint32_t compiler_id, DiagnosticDetail detail)
virtual ~Diagnostic()=default
uint32_t m_compiler_id
Compiler-specific diagnostic ID.
uint32_t GetCompilerID() const
void AppendMessage(llvm::StringRef message, bool precede_with_newline=true)
virtual bool HasFixIts() const
lldb::Severity GetSeverity() const
DiagnosticOrigin getKind() const
DiagnosticOrigin m_origin
llvm::StringRef GetMessage() const
static bool classof(const Diagnostic *diag)
An llvm::Error used to communicate diagnostics in Status.
std::vector< DiagnosticDetail > m_details
void log(llvm::raw_ostream &OS) const override
std::unique_ptr< CloneableError > Clone() const override
llvm::ArrayRef< DiagnosticDetail > GetDetails() const override
std::error_code convertToErrorCode() const override
std::string message() const override
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.
ExpressionResults
The results of expression evaluation.
A compiler-independent representation of an lldb_private::Diagnostic.
lldb::Severity severity
Contains eSeverityError in the example above.
std::string message
Contains "use of undeclared identifier 'foo'" in the example above.