clang 20.0.0git
|
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic. More...
#include "clang/Basic/Diagnostic.h"
Classes | |
class | DiagStorageAllocator |
An allocator for DiagnosticStorage objects, which uses a small cache to objects, used to reduce malloc()/free() traffic for partial diagnostics. More... | |
Public Member Functions | |
DiagnosticStorage * | getStorage () 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 . | |
Protected Member Functions | |
StreamingDiagnostic ()=default | |
StreamingDiagnostic (DiagnosticStorage *Storage) | |
Construct with an external storage not owned by itself. | |
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 | |
DiagnosticStorage * | DiagStorage = nullptr |
DiagStorageAllocator * | Allocator = nullptr |
Allocator used to allocate storage for this diagnostic. | |
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
This class is not intended to be constructed directly but only as base class of DiagnosticBuilder and PartialDiagnostic builder.
Any new type of argument accepted by DiagnosticBuilder and PartialDiagnostic should be implemented as a '<<' operator of StreamingDiagnostic, e.g.
const StreamingDiagnostic& operator<<(const StreamingDiagnostic&, NewArgType);
Definition at line 1115 of file Diagnostic.h.
|
protecteddefault |
|
inlineexplicitprotected |
Construct with an external storage not owned by itself.
The allocator is a null pointer in this case.
Definition at line 1241 of file Diagnostic.h.
|
inlineexplicitprotected |
Construct with a storage allocator which will manage the storage.
The allocator is not a null pointer in this case.
Definition at line 1246 of file Diagnostic.h.
|
protecteddefault |
|
protecteddefault |
|
inlineprotected |
Definition at line 1252 of file Diagnostic.h.
References freeStorage().
|
inline |
Definition at line 1217 of file Diagnostic.h.
References DiagStorage, clang::DiagnosticStorage::FixItHints, getStorage(), and clang::FixItHint::isNull().
Referenced by clang::PartialDiagnostic::Emit(), clang::operator<<(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1210 of file Diagnostic.h.
References clang::DiagnosticStorage::DiagRanges, DiagStorage, and getStorage().
Referenced by clang::PartialDiagnostic::Emit(), clang::operator<<(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1199 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string, clang::DiagnosticStorage::DiagArgumentsKind, clang::DiagnosticStorage::DiagArgumentsStr, DiagStorage, getStorage(), clang::DiagnosticStorage::MaxArguments, clang::DiagnosticStorage::NumDiagArgs, and V.
Referenced by addConstraintSatisfaction(), clang::BackendConsumer::DiagnosticHandlerImpl(), clang::PartialDiagnostic::Emit(), clang::BackendConsumer::InlineAsmDiagHandler(), llvm::MachO::operator<<(), clang::operator<<(), clang::PartialDiagnostic::PartialDiagnostic(), and clang::BackendConsumer::SrcMgrDiagHandler().
|
inline |
Definition at line 1189 of file Diagnostic.h.
References clang::DiagnosticStorage::DiagArgumentsKind, clang::DiagnosticStorage::DiagArgumentsVal, DiagStorage, getStorage(), Kind, clang::DiagnosticStorage::MaxArguments, clang::DiagnosticStorage::NumDiagArgs, and V.
Referenced by clang::PartialDiagnostic::Emit(), clang::operator<<(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1169 of file Diagnostic.h.
References DiagStorage, and freeStorageSlow().
Referenced by clang::PartialDiagnostic::operator=(), clang::PartialDiagnostic::Reset(), and ~StreamingDiagnostic().
|
inline |
Definition at line 1182 of file Diagnostic.h.
References Allocator, clang::StreamingDiagnostic::DiagStorageAllocator::Deallocate(), and DiagStorage.
Referenced by freeStorage().
|
inline |
Retrieve storage for this particular diagnostic.
Definition at line 1160 of file Diagnostic.h.
References clang::StreamingDiagnostic::DiagStorageAllocator::Allocate(), Allocator, and DiagStorage.
Referenced by AddFixItHint(), AddSourceRange(), AddString(), AddTaggedVal(), clang::PartialDiagnostic::operator=(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Conversion of StreamingDiagnostic to bool always returns true
.
This allows is to be used in boolean error contexts (where true
is used to indicate that an error has occurred), like:
Definition at line 1234 of file Diagnostic.h.
|
protected |
Allocator used to allocate storage for this diagnostic.
Definition at line 1156 of file Diagnostic.h.
Referenced by freeStorageSlow(), getStorage(), clang::PartialDiagnostic::operator=(), clang::PartialDiagnostic::PartialDiagnostic(), and clang::PartialDiagnostic::swap().
|
mutableprotected |
Definition at line 1153 of file Diagnostic.h.
Referenced by AddFixItHint(), AddSourceRange(), AddString(), AddTaggedVal(), clang::DiagnosticBuilder::DiagnosticBuilder(), clang::PartialDiagnostic::Emit(), freeStorage(), freeStorageSlow(), getStorage(), clang::PartialDiagnostic::getStringArg(), clang::PartialDiagnostic::hasStorage(), clang::PartialDiagnostic::operator=(), clang::PartialDiagnostic::PartialDiagnostic(), and clang::PartialDiagnostic::swap().