clang  6.0.0svn
Classes | Public Types | Public Member Functions | Friends | List of all members
clang::PartialDiagnostic Class Reference

#include "clang/Basic/PartialDiagnostic.h"

Classes

struct  NullDiagnostic
 
struct  Storage
 
class  StorageAllocator
 An allocator for Storage objects, which uses a small cache to objects, used to reduce malloc()/free() traffic for partial diagnostics. More...
 

Public Types

enum  { MaxArguments = DiagnosticsEngine::MaxArguments }
 

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. More...
 
 PartialDiagnostic (unsigned DiagID, StorageAllocator &Allocator)
 
 PartialDiagnostic (const PartialDiagnostic &Other)
 
 PartialDiagnostic (PartialDiagnostic &&Other)
 
 PartialDiagnostic (const PartialDiagnostic &Other, Storage *DiagStorage)
 
 PartialDiagnostic (const Diagnostic &Other, StorageAllocator &Allocator)
 
PartialDiagnosticoperator= (const PartialDiagnostic &Other)
 
PartialDiagnosticoperator= (PartialDiagnostic &&Other)
 
 ~PartialDiagnostic ()
 
void swap (PartialDiagnostic &PD)
 
unsigned getDiagID () const
 
void AddTaggedVal (intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
 
void AddString (StringRef V) const
 
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. More...
 
bool hasStorage () const
 
StringRef getStringArg (unsigned I)
 Retrieve the string argument at the given index. More...
 

Friends

const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, unsigned I)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, int I)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, const char *S)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, StringRef S)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, const IdentifierInfo *II)
 
template<typename T >
std::enable_if< std::is_same< T, DeclContext >::value, const PartialDiagnostic & >::type operator<< (const PartialDiagnostic &PD, T *DC)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, SourceRange R)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, const CharSourceRange &R)
 
const PartialDiagnosticoperator<< (const PartialDiagnostic &PD, const FixItHint &Hint)
 

Detailed Description

Definition at line 28 of file PartialDiagnostic.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxArguments 

Definition at line 30 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 181 of file PartialDiagnostic.h.

◆ PartialDiagnostic() [2/6]

clang::PartialDiagnostic::PartialDiagnostic ( unsigned  DiagID,
StorageAllocator Allocator 
)
inline

Definition at line 184 of file PartialDiagnostic.h.

◆ PartialDiagnostic() [3/6]

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

Definition at line 187 of file PartialDiagnostic.h.

◆ PartialDiagnostic() [4/6]

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

Definition at line 196 of file PartialDiagnostic.h.

◆ PartialDiagnostic() [5/6]

clang::PartialDiagnostic::PartialDiagnostic ( const PartialDiagnostic Other,
Storage DiagStorage 
)
inline

Definition at line 202 of file PartialDiagnostic.h.

◆ PartialDiagnostic() [6/6]

clang::PartialDiagnostic::PartialDiagnostic ( const Diagnostic Other,
StorageAllocator Allocator 
)
inline

Definition at line 210 of file PartialDiagnostic.h.

◆ ~PartialDiagnostic()

clang::PartialDiagnostic::~PartialDiagnostic ( )
inline

Definition at line 255 of file PartialDiagnostic.h.

Member Function Documentation

◆ AddString()

void clang::PartialDiagnostic::AddString ( StringRef  V) const
inline

◆ AddTaggedVal()

void clang::PartialDiagnostic::AddTaggedVal ( intptr_t  V,
DiagnosticsEngine::ArgumentKind  Kind 
) const
inline

◆ Emit()

void clang::PartialDiagnostic::Emit ( const DiagnosticBuilder DB) const
inline

◆ EmitToString()

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

◆ getDiagID()

unsigned clang::PartialDiagnostic::getDiagID ( ) const
inline

◆ getStringArg()

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

Retrieve the string argument at the given index.

Definition at line 333 of file PartialDiagnostic.h.

◆ hasStorage()

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

Definition at line 330 of file PartialDiagnostic.h.

◆ operator=() [1/2]

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

Definition at line 230 of file PartialDiagnostic.h.

◆ operator=() [2/2]

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

Definition at line 244 of file PartialDiagnostic.h.

◆ 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 325 of file PartialDiagnostic.h.

Referenced by clang::sema::AccessedEntity::setDiag().

◆ swap()

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

Definition at line 259 of file PartialDiagnostic.h.

Friends And Related Function Documentation

◆ operator<< [1/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
unsigned  I 
)
friend

Definition at line 341 of file PartialDiagnostic.h.

◆ operator<< [2/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
int  I 
)
friend

Definition at line 347 of file PartialDiagnostic.h.

◆ operator<< [3/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
const char *  S 
)
friend

Definition at line 353 of file PartialDiagnostic.h.

◆ operator<< [4/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
StringRef  S 
)
friend

Definition at line 360 of file PartialDiagnostic.h.

◆ operator<< [5/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
const IdentifierInfo II 
)
friend

Definition at line 367 of file PartialDiagnostic.h.

◆ operator<< [6/9]

template<typename T >
std::enable_if<std::is_same<T, DeclContext>::value, const PartialDiagnostic &>::type operator<< ( const PartialDiagnostic PD,
T DC 
)
friend

Definition at line 382 of file PartialDiagnostic.h.

◆ operator<< [7/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
SourceRange  R 
)
friend

Definition at line 388 of file PartialDiagnostic.h.

◆ operator<< [8/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
const CharSourceRange R 
)
friend

Definition at line 394 of file PartialDiagnostic.h.

◆ operator<< [9/9]

const PartialDiagnostic& operator<< ( const PartialDiagnostic PD,
const FixItHint Hint 
)
friend

Definition at line 400 of file PartialDiagnostic.h.


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