clang
3.9.0
|
A little helper class used to produce diagnostics. More...
#include <Diagnostic.h>
Public Member Functions | |
DiagnosticBuilder (const DiagnosticBuilder &D) | |
Copy constructor. More... | |
~DiagnosticBuilder () | |
Emits the diagnostic. More... | |
const DiagnosticBuilder & | setForceEmit () const |
Forces the diagnostic to be emitted. More... | |
operator bool () const | |
Conversion of DiagnosticBuilder to bool always returns true . More... | |
void | AddString (StringRef S) const |
void | AddTaggedVal (intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const |
void | AddSourceRange (const CharSourceRange &R) const |
void | AddFixItHint (const FixItHint &Hint) const |
void | addFlagValue (StringRef V) const |
Static Public Member Functions | |
static DiagnosticBuilder | getEmpty () |
Retrieve an empty diagnostic builder. More... | |
Protected Member Functions | |
void | FlushCounts () |
void | Clear () const |
Clear out the current diagnostic. More... | |
bool | isActive () const |
Determine whether this diagnostic is still active. More... | |
bool | Emit () |
Force the diagnostic builder to emit the diagnostic now. More... | |
Friends | |
class | DiagnosticsEngine |
class | PartialDiagnostic |
A little helper class used to produce diagnostics.
This is constructed by the DiagnosticsEngine::Report method, and allows insertion of extra information (arguments and source ranges) into the currently "in flight" diagnostic. When the temporary for the builder is destroyed, the diagnostic is issued.
Note that many of these will be created as temporary objects (many call sites), so we want them to be small and we never want their address taken. This ensures that compilers with somewhat reasonable optimizers will promote the common fields to registers, eliminating increments of the NumArgs field, for example.
Definition at line 873 of file Diagnostic.h.
|
inline |
Copy constructor.
When copied, this "takes" the diagnostic info from the input and neuters it.
Definition at line 945 of file Diagnostic.h.
References Clear(), and clang::NumArgs.
|
inline |
|
inline |
Definition at line 999 of file Diagnostic.h.
References isActive(), and clang::FixItHint::isNull().
Referenced by addFixitForObjCARCConversion(), applyCocoaAPICheck(), clang::PartialDiagnostic::Emit(), and clang::operator<<().
|
inline |
Definition at line 1005 of file Diagnostic.h.
Referenced by clang::operator<<().
|
inline |
Definition at line 994 of file Diagnostic.h.
References isActive().
Referenced by clang::PartialDiagnostic::Emit(), and clang::operator<<().
|
inline |
Definition at line 978 of file Diagnostic.h.
References clang::DiagnosticsEngine::ak_std_string, isActive(), clang::NumArgs, and S.
Referenced by clang::PartialDiagnostic::Emit(), and clang::operator<<().
|
inline |
Definition at line 986 of file Diagnostic.h.
References isActive(), and clang::NumArgs.
Referenced by clang::PartialDiagnostic::Emit(), and clang::operator<<().
|
inlineprotected |
Clear out the current diagnostic.
Definition at line 908 of file Diagnostic.h.
Referenced by DiagnosticBuilder(), Emit(), and clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder().
|
inlineprotected |
Force the diagnostic builder to emit the diagnostic now.
Once this function has been called, the DiagnosticBuilder object should not be used again before it is destroyed.
Definition at line 924 of file Diagnostic.h.
References Clear(), clang::DiagnosticsEngine::EmitCurrentDiagnostic(), FlushCounts(), isActive(), and clang::Result.
Referenced by ~DiagnosticBuilder().
|
inlineprotected |
Definition at line 903 of file Diagnostic.h.
References clang::NumArgs.
Referenced by Emit(), and clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder().
|
inlinestatic |
Retrieve an empty diagnostic builder.
Definition at line 954 of file Diagnostic.h.
|
inlineprotected |
Determine whether this diagnostic is still active.
Definition at line 915 of file Diagnostic.h.
Referenced by AddFixItHint(), AddSourceRange(), AddString(), AddTaggedVal(), Emit(), and clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder().
|
inline |
Conversion of DiagnosticBuilder 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 976 of file Diagnostic.h.
|
inline |
Forces the diagnostic to be emitted.
Definition at line 964 of file Diagnostic.h.
Referenced by PrintExpected(), and PrintUnexpected().
|
friend |
Definition at line 889 of file Diagnostic.h.
|
friend |
Definition at line 900 of file Diagnostic.h.