clang
3.9.0
|
Helper class to manage error messages. More...
#include <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_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_ParserUnsignedError = 109, ET_ParserOverloadedType = 110 } |
All errors from the system. More... | |
Public Member Functions | |
ArgStream | addError (SourceRange Range, ErrorType Error) |
Add an error to the diagnostics. More... | |
ArrayRef< ErrorContent > | errors () const |
void | printToStream (llvm::raw_ostream &OS) const |
Returns a simple string representation of each error. More... | |
std::string | toString () const |
void | printToStreamFull (llvm::raw_ostream &OS) const |
Returns the full string representation of each error. More... | |
std::string | toStringFull () const |
Helper class to manage error messages.
Definition at line 51 of file Diagnostics.h.
Parser context types.
Enumerator | |
---|---|
CT_MatcherArg | |
CT_MatcherConstruct |
Definition at line 54 of file Diagnostics.h.
All errors from the system.
Definition at line 60 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 66 of file Diagnostics.cpp.
References clang::ast_matchers::dynamic::Diagnostics::ErrorContent::ContextStack, clang::LangAS::Last, and clang::ast_matchers::dynamic::Diagnostics::ErrorContent::Messages.
Referenced by clang::ast_matchers::dynamic::Registry::constructBoundMatcher(), clang::ast_matchers::dynamic::internal::OverloadedMatcherDescriptor::create(), clang::ast_matchers::dynamic::internal::VariadicOperatorMatcherDescriptor::create(), clang::ast_matchers::dynamic::Parser::parseExpression(), clang::ast_matchers::dynamic::Parser::parseMatcherExpression(), and clang::ast_matchers::dynamic::internal::variadicMatcherDescriptor().
|
inline |
Definition at line 159 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 187 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 201 of file Diagnostics.cpp.
References clang::ast_matchers::dynamic::Diagnostics::ErrorContent::ContextStack, 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 194 of file Diagnostics.cpp.
References printToStream(), and S.
std::string clang::ast_matchers::dynamic::Diagnostics::toStringFull | ( | ) | const |
Definition at line 213 of file Diagnostics.cpp.
References printToStreamFull(), and S.