class Diagnostics

Declaration

class Diagnostics { /* full declaration omitted */ };

Description

Helper class to manage error messages.

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:50

Member Variables

private std::vector<ContextFrame> ContextStack
private std::vector<ErrorContent> Errors

Method Overview

  • public clang::ast_matchers::dynamic::Diagnostics::ArgStream addError(clang::ast_matchers::dynamic::SourceRange Range, clang::ast_matchers::dynamic::Diagnostics::ErrorType Error)
  • public ArrayRef<clang::ast_matchers::dynamic::Diagnostics::ErrorContent> errors() const
  • public void printToStream(llvm::raw_ostream & OS) const
  • public void printToStreamFull(llvm::raw_ostream & OS) const
  • private clang::ast_matchers::dynamic::Diagnostics::ArgStream pushContextFrame(clang::ast_matchers::dynamic::Diagnostics::ContextType Type, clang::ast_matchers::dynamic::SourceRange Range)
  • public std::string toString() const
  • public std::string toStringFull() const

Methods

clang::ast_matchers::dynamic::Diagnostics::
    ArgStream
    addError(
        clang::ast_matchers::dynamic::SourceRange
            Range,
        clang::ast_matchers::dynamic::
            Diagnostics::ErrorType Error)

Description

Add an error to the diagnostics. All the context information will be kept on the error message.

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:144

Parameters

clang::ast_matchers::dynamic::SourceRange Range
clang::ast_matchers::dynamic::Diagnostics:: ErrorType Error

Returns

a helper class to allow the caller to pass the arguments for the error message, using the < < operator.

ArrayRef<clang::ast_matchers::dynamic::
             Diagnostics::ErrorContent>
errors() const

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:163

void printToStream(llvm::raw_ostream& OS) const

Description

Returns a simple string representation of each error. Each error only shows the error message without any context.

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:168

Parameters

llvm::raw_ostream& OS

void printToStreamFull(
    llvm::raw_ostream& OS) const

Description

Returns the full string representation of each error. Each error message contains the full context.

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:174

Parameters

llvm::raw_ostream& OS

clang::ast_matchers::dynamic::Diagnostics::
    ArgStream
    pushContextFrame(
        clang::ast_matchers::dynamic::
            Diagnostics::ContextType Type,
        clang::ast_matchers::dynamic::SourceRange
            Range)

Description

Helper function used by the constructors of ContextFrame.

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:179

Parameters

clang::ast_matchers::dynamic::Diagnostics:: ContextType Type
clang::ast_matchers::dynamic::SourceRange Range

std::string toString() const

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:169

std::string toStringFull() const

Declared at: clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h:175