class Diagnostic

Declaration

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

Description

A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) that allows clients to enquire about the currently in-flight diagnostic.

Declared at: clang/include/clang/Basic/Diagnostic.h:1561

Member Variables

private const clang::DiagnosticsEngine* DiagObj
private llvm::StringRef StoredDiagMessage

Method Overview

  • public Diagnostic(const clang::DiagnosticsEngine * DO, llvm::StringRef storedDiagMessage)
  • public Diagnostic(const clang::DiagnosticsEngine * DO)
  • public void FormatDiagnostic(const char * DiagStr, const char * DiagEnd, SmallVectorImpl<char> & OutStr) const
  • public void FormatDiagnostic(SmallVectorImpl<char> & OutStr) const
  • public const char * getArgCStr(unsigned int Idx) const
  • public const clang::IdentifierInfo * getArgIdentifier(unsigned int Idx) const
  • public DiagnosticsEngine::ArgumentKind getArgKind(unsigned int Idx) const
  • public int64_t getArgSInt(unsigned int Idx) const
  • public const std::string & getArgStdStr(unsigned int Idx) const
  • public uint64_t getArgUInt(unsigned int Idx) const
  • public const clang::DiagnosticsEngine * getDiags() const
  • public const clang::FixItHint & getFixItHint(unsigned int Idx) const
  • public ArrayRef<clang::FixItHint> getFixItHints() const
  • public unsigned int getID() const
  • public const clang::SourceLocation & getLocation() const
  • public unsigned int getNumArgs() const
  • public unsigned int getNumFixItHints() const
  • public unsigned int getNumRanges() const
  • public const clang::CharSourceRange & getRange(unsigned int Idx) const
  • public ArrayRef<clang::CharSourceRange> getRanges() const
  • public uint64_t getRawArg(unsigned int Idx) const
  • public clang::SourceManager & getSourceManager() const
  • public bool hasSourceManager() const

Methods

Diagnostic(const clang::DiagnosticsEngine* DO,
           llvm::StringRef storedDiagMessage)

Declared at: clang/include/clang/Basic/Diagnostic.h:1567

Parameters

const clang::DiagnosticsEngine* DO
llvm::StringRef storedDiagMessage

Diagnostic(const clang::DiagnosticsEngine* DO)

Declared at: clang/include/clang/Basic/Diagnostic.h:1566

Parameters

const clang::DiagnosticsEngine* DO

void FormatDiagnostic(
    const char* DiagStr,
    const char* DiagEnd,
    SmallVectorImpl<char>& OutStr) const

Description

Format the given format-string into the output buffer using the arguments stored in this diagnostic.

Declared at: clang/include/clang/Basic/Diagnostic.h:1677

Parameters

const char* DiagStr
const char* DiagEnd
SmallVectorImpl<char>& OutStr

void FormatDiagnostic(
    SmallVectorImpl<char>& OutStr) const

Description

Format this diagnostic into a string, substituting the formal arguments into the %0 slots. The result is appended onto the \p OutStr array.

Declared at: clang/include/clang/Basic/Diagnostic.h:1673

Parameters

SmallVectorImpl<char>& OutStr

const char* getArgCStr(unsigned int Idx) const

Description

Return the specified C string argument.

Declared at: clang/include/clang/Basic/Diagnostic.h:1600

Parameters

unsigned int Idx

const clang::IdentifierInfo* getArgIdentifier(
    unsigned int Idx) const

Description

Return the specified IdentifierInfo argument.

Declared at: clang/include/clang/Basic/Diagnostic.h:1625

Parameters

unsigned int Idx

DiagnosticsEngine::ArgumentKind getArgKind(
    unsigned int Idx) const

Description

Return the kind of the specified index. Based on the kind of argument, the accessors below can be used to get the value.

Declared at: clang/include/clang/Basic/Diagnostic.h:1584

Parameters

unsigned int Idx

int64_t getArgSInt(unsigned int Idx) const

Description

Return the specified signed integer argument.

Declared at: clang/include/clang/Basic/Diagnostic.h:1609

Parameters

unsigned int Idx

const std::string& getArgStdStr(
    unsigned int Idx) const

Description

Return the provided argument string specified by \p Idx.

Declared at: clang/include/clang/Basic/Diagnostic.h:1592

Parameters

unsigned int Idx

uint64_t getArgUInt(unsigned int Idx) const

Description

Return the specified unsigned integer argument.

Declared at: clang/include/clang/Basic/Diagnostic.h:1617

Parameters

unsigned int Idx

const clang::DiagnosticsEngine* getDiags() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1570

const clang::FixItHint& getFixItHint(
    unsigned int Idx) const

Declared at: clang/include/clang/Basic/Diagnostic.h:1660

Parameters

unsigned int Idx

ArrayRef<clang::FixItHint> getFixItHints() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1665

unsigned int getID() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1571

const clang::SourceLocation& getLocation() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1572

unsigned int getNumArgs() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1576

unsigned int getNumFixItHints() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1656

unsigned int getNumRanges() const

Description

Return the number of source ranges associated with this diagnostic.

Declared at: clang/include/clang/Basic/Diagnostic.h:1641

const clang::CharSourceRange& getRange(
    unsigned int Idx) const

Declared at: clang/include/clang/Basic/Diagnostic.h:1646

Parameters

unsigned int Idx

ArrayRef<clang::CharSourceRange> getRanges() const

Description

Return an array reference for this diagnostic's ranges.

Declared at: clang/include/clang/Basic/Diagnostic.h:1652

uint64_t getRawArg(unsigned int Idx) const

Description

Return the specified non-string argument in an opaque form.

Declared at: clang/include/clang/Basic/Diagnostic.h:1634

Parameters

unsigned int Idx

clang::SourceManager& getSourceManager() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1574

bool hasSourceManager() const

Declared at: clang/include/clang/Basic/Diagnostic.h:1573