clang 22.0.0git
clang::PartialDiagnostic Class Reference

#include "clang/Basic/PartialDiagnostic.h"

Inheritance diagram for clang::PartialDiagnostic:
[legend]

Classes

struct  NullDiagnostic

Public Member Functions

 PartialDiagnostic (NullDiagnostic)
 Create a null partial diagnostic, which cannot carry a payload, and only exists to be swapped with a real partial diagnostic.
 PartialDiagnostic (unsigned DiagID, DiagStorageAllocator &Allocator_)
 PartialDiagnostic (const PartialDiagnostic &Other)
template<typename T>
const PartialDiagnosticoperator<< (const T &V) const
template<typename T, typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
const PartialDiagnosticoperator<< (T &&V) const
 PartialDiagnostic (PartialDiagnostic &&Other)
 PartialDiagnostic (const PartialDiagnostic &Other, DiagnosticStorage *DiagStorage_)
 PartialDiagnostic (const Diagnostic &Other, DiagStorageAllocator &Allocator_)
PartialDiagnosticoperator= (const PartialDiagnostic &Other)
PartialDiagnosticoperator= (PartialDiagnostic &&Other)
void swap (PartialDiagnostic &PD)
unsigned getDiagID () const
void setDiagID (unsigned ID)
void Emit (const DiagnosticBuilder &DB) const
void EmitToString (DiagnosticsEngine &Diags, SmallVectorImpl< char > &Buf) const
void Reset (unsigned DiagID=0)
 Clear out this partial diagnostic, giving it a new diagnostic ID and removing all of its arguments, ranges, and fix-it hints.
bool hasStorage () const
StringRef getStringArg (unsigned I)
 Retrieve the string argument at the given index.
Public Member Functions inherited from clang::StreamingDiagnostic
DiagnosticStoragegetStorage () const
 Retrieve storage for this particular diagnostic.
void freeStorage ()
void freeStorageSlow ()
void AddTaggedVal (uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
void AddString (StringRef V) const
void AddSourceRange (const CharSourceRange &R) const
void AddFixItHint (const FixItHint &Hint) const
 operator bool () const
 Conversion of StreamingDiagnostic to bool always returns true.

Additional Inherited Members

Public Types inherited from clang::StreamingDiagnostic
using DiagStorageAllocator = clang::DiagStorageAllocator
Protected Member Functions inherited from clang::StreamingDiagnostic
 StreamingDiagnostic ()=default
 StreamingDiagnostic (DiagStorageAllocator &Alloc)
 Construct with a storage allocator which will manage the storage.
 StreamingDiagnostic (const StreamingDiagnostic &Diag)=default
 StreamingDiagnostic (StreamingDiagnostic &&Diag)=default
 ~StreamingDiagnostic ()
Protected Attributes inherited from clang::StreamingDiagnostic
DiagnosticStorageDiagStorage = nullptr
DiagStorageAllocatorAllocator = nullptr
 Allocator used to allocate storage for this diagnostic.

Detailed Description

Definition at line 31 of file PartialDiagnostic.h.

Constructor & Destructor Documentation

◆ PartialDiagnostic() [1/6]

clang::PartialDiagnostic::PartialDiagnostic ( NullDiagnostic )
inline

Create a null partial diagnostic, which cannot carry a payload, and only exists to be swapped with a real partial diagnostic.

Definition at line 44 of file PartialDiagnostic.h.

Referenced by operator<<(), operator<<(), operator=(), operator=(), PartialDiagnostic(), PartialDiagnostic(), PartialDiagnostic(), and swap().

◆ PartialDiagnostic() [2/6]

clang::PartialDiagnostic::PartialDiagnostic ( unsigned DiagID,
DiagStorageAllocator & Allocator_ )
inline

◆ PartialDiagnostic() [3/6]

clang::PartialDiagnostic::PartialDiagnostic ( const PartialDiagnostic & Other)
inline

◆ PartialDiagnostic() [4/6]

clang::PartialDiagnostic::PartialDiagnostic ( PartialDiagnostic && Other)
inline

◆ PartialDiagnostic() [5/6]

clang::PartialDiagnostic::PartialDiagnostic ( const PartialDiagnostic & Other,
DiagnosticStorage * DiagStorage_ )
inline

◆ PartialDiagnostic() [6/6]

clang::PartialDiagnostic::PartialDiagnostic ( const Diagnostic & Other,
DiagStorageAllocator & Allocator_ )
inline

Member Function Documentation

◆ Emit()

◆ EmitToString()

void clang::PartialDiagnostic::EmitToString ( DiagnosticsEngine & Diags,
SmallVectorImpl< char > & Buf ) const
inline

◆ getDiagID()

◆ getStringArg()

StringRef clang::PartialDiagnostic::getStringArg ( unsigned I)
inline

Retrieve the string argument at the given index.

Definition at line 185 of file PartialDiagnostic.h.

References clang::DiagnosticsEngine::ak_std_string, and clang::StreamingDiagnostic::DiagStorage.

◆ hasStorage()

bool clang::PartialDiagnostic::hasStorage ( ) const
inline

Definition at line 182 of file PartialDiagnostic.h.

References clang::StreamingDiagnostic::DiagStorage.

◆ operator<<() [1/2]

template<typename T>
const PartialDiagnostic & clang::PartialDiagnostic::operator<< ( const T & V) const
inline

◆ operator<<() [2/2]

template<typename T, typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
const PartialDiagnostic & clang::PartialDiagnostic::operator<< ( T && V) const
inline

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ Reset()

void clang::PartialDiagnostic::Reset ( unsigned DiagID = 0)
inline

Clear out this partial diagnostic, giving it a new diagnostic ID and removing all of its arguments, ranges, and fix-it hints.

Definition at line 177 of file PartialDiagnostic.h.

References clang::StreamingDiagnostic::freeStorage().

◆ setDiagID()

void clang::PartialDiagnostic::setDiagID ( unsigned ID)
inline

Definition at line 142 of file PartialDiagnostic.h.

◆ swap()

void clang::PartialDiagnostic::swap ( PartialDiagnostic & PD)
inline

The documentation for this class was generated from the following file: