clang 17.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 1110 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 1236 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 1241 of file Diagnostic.h.
|
protecteddefault |
|
protecteddefault |
|
inlineprotected |
Definition at line 1247 of file Diagnostic.h.
References freeStorage().
|
inline |
Definition at line 1212 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 1205 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 1194 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 clang::BackendConsumer::DiagnosticHandlerImpl(), clang::PartialDiagnostic::Emit(), clang::BackendConsumer::InlineAsmDiagHandler(), clang::operator<<(), clang::PartialDiagnostic::PartialDiagnostic(), and clang::BackendConsumer::SrcMgrDiagHandler().
|
inline |
Definition at line 1184 of file Diagnostic.h.
References clang::DiagnosticStorage::DiagArgumentsKind, clang::DiagnosticStorage::DiagArgumentsVal, DiagStorage, getStorage(), clang::DiagnosticStorage::MaxArguments, clang::DiagnosticStorage::NumDiagArgs, and V.
Referenced by clang::PartialDiagnostic::Emit(), clang::operator<<(), and clang::PartialDiagnostic::PartialDiagnostic().
|
inline |
Definition at line 1164 of file Diagnostic.h.
References DiagStorage, and freeStorageSlow().
Referenced by clang::PartialDiagnostic::operator=(), clang::PartialDiagnostic::Reset(), and ~StreamingDiagnostic().
|
inline |
Definition at line 1177 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 1155 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 1229 of file Diagnostic.h.
|
protected |
Allocator used to allocate storage for this diagnostic.
Definition at line 1151 of file Diagnostic.h.
Referenced by freeStorageSlow(), getStorage(), clang::PartialDiagnostic::operator=(), clang::PartialDiagnostic::PartialDiagnostic(), and clang::PartialDiagnostic::swap().
|
mutableprotected |
Definition at line 1148 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().