clang 20.0.0git
|
Helper class to manage error messages. More...
#include "clang/ASTMatchers/Dynamic/Diagnostics.h"
Classes | |
class | ArgStream |
Helper stream class. More... | |
struct | Context |
Class defining a parser context. More... | |
struct | ContextFrame |
Information stored for one frame of the context. More... | |
struct | ErrorContent |
Information stored for each error found. More... | |
struct | OverloadContext |
Context for overloaded matcher construction. More... | |
Public Types | |
enum | ContextType { CT_MatcherArg = 0 , CT_MatcherConstruct = 1 } |
Parser context types. More... | |
enum | ErrorType { ET_None = 0 , ET_RegistryMatcherNotFound = 1 , ET_RegistryWrongArgCount = 2 , ET_RegistryWrongArgType = 3 , ET_RegistryNotBindable = 4 , ET_RegistryAmbiguousOverload = 5 , ET_RegistryValueNotFound = 6 , ET_RegistryUnknownEnumWithReplace = 7 , ET_RegistryNonNodeMatcher = 8 , ET_RegistryMatcherNoWithSupport = 9 , ET_ParserStringError = 100 , ET_ParserNoOpenParen = 101 , ET_ParserNoCloseParen = 102 , ET_ParserNoComma = 103 , ET_ParserNoCode = 104 , ET_ParserNotAMatcher = 105 , ET_ParserInvalidToken = 106 , ET_ParserMalformedBindExpr = 107 , ET_ParserTrailingCode = 108 , ET_ParserNumberError = 109 , ET_ParserOverloadedType = 110 , ET_ParserMalformedChainedExpr = 111 , ET_ParserFailedToBuildMatcher = 112 } |
All errors from the system. More... | |
Public Member Functions | |
ArgStream | addError (SourceRange Range, ErrorType Error) |
Add an error to the diagnostics. | |
ArrayRef< ErrorContent > | errors () const |
void | printToStream (llvm::raw_ostream &OS) const |
Returns a simple string representation of each error. | |
std::string | toString () const |
void | printToStreamFull (llvm::raw_ostream &OS) const |
Returns the full string representation of each error. | |
std::string | toStringFull () const |
Helper class to manage error messages.
Definition at line 50 of file Diagnostics.h.
Parser context types.
Enumerator | |
---|---|
CT_MatcherArg | |
CT_MatcherConstruct |
Definition at line 53 of file Diagnostics.h.
All errors from the system.
Definition at line 59 of file Diagnostics.h.
Diagnostics::ArgStream clang::ast_matchers::dynamic::Diagnostics::addError | ( | SourceRange | Range, |
ErrorType | Error | ||
) |
Add an error to the diagnostics.
All the context information will be kept on the error message.
Definition at line 65 of file Diagnostics.cpp.
References clang::Last, and Range.
|
inline |
Definition at line 163 of file Diagnostics.h.
void clang::ast_matchers::dynamic::Diagnostics::printToStream | ( | llvm::raw_ostream & | OS | ) | const |
Returns a simple string representation of each error.
Each error only shows the error message without any context.
Definition at line 196 of file Diagnostics.cpp.
References clang::ast_matchers::dynamic::printErrorContentToStream().
Referenced by toString().
void clang::ast_matchers::dynamic::Diagnostics::printToStreamFull | ( | llvm::raw_ostream & | OS | ) | const |
Returns the full string representation of each error.
Each error message contains the full context.
Definition at line 210 of file Diagnostics.cpp.
References clang::ast_matchers::dynamic::printContextFrameToStream(), and clang::ast_matchers::dynamic::printErrorContentToStream().
Referenced by toStringFull().
std::string clang::ast_matchers::dynamic::Diagnostics::toString | ( | ) | const |
Definition at line 203 of file Diagnostics.cpp.
References printToStream().
std::string clang::ast_matchers::dynamic::Diagnostics::toStringFull | ( | ) | const |
Definition at line 222 of file Diagnostics.cpp.
References printToStreamFull().