Go to the documentation of this file.
9 #ifndef LLVM_CLANG_BASIC_DIAGNOSTICERROR_H
10 #define LLVM_CLANG_BASIC_DIAGNOSTICERROR_H
13 #include "llvm/Support/Error.h"
25 void log(raw_ostream &OS)
const override { OS <<
"clang diagnostic"; }
33 return llvm::make_error<DiagnosticError>(
40 static std::optional<PartialDiagnosticAt>
take(llvm::Error &Err) {
41 std::optional<PartialDiagnosticAt> Result;
52 std::error_code convertToErrorCode()
const override {
53 return llvm::inconvertibleErrorCode();
61 #endif // LLVM_CLANG_BASIC_DIAGNOSTICERROR_H
static std::optional< PartialDiagnosticAt > take(llvm::Error &Err)
Extracts and returns the diagnostic payload from the given Error if the error is a DiagnosticError.
Encodes a location in the source.
Carries a Clang diagnostic in an llvm::Error.
void log(raw_ostream &OS) const override
const PartialDiagnosticAt & getDiagnostic() const
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs.
static llvm::Error create(SourceLocation Loc, PartialDiagnostic Diag)
Creates a new DiagnosticError that contains the given diagnostic at the given location.
DiagnosticError(PartialDiagnosticAt Diag)
PartialDiagnosticAt & getDiagnostic()