clang 8.0.0

Classes | Public Types | Public Member Functions | Friends | List of all members
clang::DiagnosticsEngine Class Reference

Concrete class used by the front-end to report problems and issues. More...

`#include "clang/Basic/Diagnostic.h"`

Inheritance diagram for clang::DiagnosticsEngine:
[legend]
Collaboration diagram for clang::DiagnosticsEngine:
[legend]

## Public Types
enum | Level { Ignored = DiagnosticIDs::Ignored, Note = DiagnosticIDs::Note, Remark = DiagnosticIDs::Remark, Warning = DiagnosticIDs::Warning, Error = DiagnosticIDs::Error, Fatal = DiagnosticIDs::Fatal }
| The level of the diagnostic, after it has been through mapping. More...
enum | ArgumentKind { ak_std_string, ak_c_string, ak_sint, ak_uint, ak_tokenkind, ak_identifierinfo, ak_qual, ak_qualtype, ak_declarationname, ak_nameddecl, ak_nestednamespec, ak_declcontext, ak_qualtype_pair, ak_attr }
using | ArgumentValue = std::pair< ArgumentKind, intptr_t >
| Represents on argument value, which is a union discriminated by ArgumentKind, with a value. More...
using | diag_mapping_range = llvm::iterator_range< DiagState::const_iterator >

## Public Member Functions
| DiagnosticsEngine (IntrusiveRefCntPtr< DiagnosticIDs > Diags, IntrusiveRefCntPtr< DiagnosticOptions > DiagOpts, DiagnosticConsumer *client=nullptr, bool ShouldOwnClient=true)
| DiagnosticsEngine (const DiagnosticsEngine &)=delete
DiagnosticsEngine & | operator= (const DiagnosticsEngine &)=delete
| ~DiagnosticsEngine ()
LLVM_DUMP_METHOD void | dump () const
LLVM_DUMP_METHOD void | dump (StringRef DiagName) const
const IntrusiveRefCntPtr< DiagnosticIDs > & | getDiagnosticIDs () const
DiagnosticOptions & | getDiagnosticOptions () const
| Retrieve the diagnostic options. More...
diag_mapping_range | getDiagnosticMappings () const
| Get the current set of diagnostic mappings. More...
DiagnosticConsumer * | getClient ()
const DiagnosticConsumer * | getClient () const
bool | ownsClient () const
| Determine whether this `DiagnosticsEngine` object own its client. More...
std::unique_ptr< DiagnosticConsumer > | takeClient ()
| Return the current diagnostic client along with ownership of that client. More...
bool | hasSourceManager () const
SourceManager & | getSourceManager () const
void | setSourceManager (SourceManager *SrcMgr)
void | pushMappings (SourceLocation Loc)
| Copies the current DiagMappings and pushes the new copy onto the top of the stack. More...
bool | popMappings (SourceLocation Loc)
| Pops the current DiagMappings off the top of the stack, causing the new top of the stack to be the active mappings. More...
void | setClient (DiagnosticConsumer *client, bool ShouldOwnClient=true)
| Set the diagnostic client associated with this diagnostic object. More...
void | setErrorLimit (unsigned Limit)
| Specify a limit for the number of errors we should emit before giving up. More...
void | setTemplateBacktraceLimit (unsigned Limit)
| Specify the maximum number of template instantiation notes to emit along with a given diagnostic. More...
unsigned | getTemplateBacktraceLimit () const
| Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic. More...
void | setConstexprBacktraceLimit (unsigned Limit)
| Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic. More...
unsigned | getConstexprBacktraceLimit () const
| Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic. More...
void | setIgnoreAllWarnings (bool Val)
| When set to true, any unmapped warnings are ignored. More...
bool | getIgnoreAllWarnings () const
void | setEnableAllWarnings (bool Val)
| When set to true, any unmapped ignored warnings are no longer ignored. More...
bool | getEnableAllWarnings () const
void | setWarningsAsErrors (bool Val)
| When set to true, any warnings reported are issued as errors. More...
bool | getWarningsAsErrors () const
void | setErrorsAsFatal (bool Val)
| When set to true, any error reported is made a fatal error. More...
bool | getErrorsAsFatal () const
void | setSuppressAfterFatalError (bool Val)
| When set to true (the default), suppress further diagnostics after a fatal error. More...
void | setSuppressSystemWarnings (bool Val)
| When set to true mask warnings that come from system headers. More...
bool | getSuppressSystemWarnings () const
void | setSuppressAllDiagnostics (bool Val=true)
| Suppress all diagnostics, to silence the front end when we know that we don't want any more diagnostics to be passed along to the client. More...
bool | getSuppressAllDiagnostics () const
void | setElideType (bool Val=true)
| Set type eliding, to skip outputting same types occurring in template types. More...
bool | getElideType ()
void | setPrintTemplateTree (bool Val=false)
| Set tree printing, to outputting the template difference in a tree format. More...
bool | getPrintTemplateTree ()
void | setShowColors (bool Val=false)
| Set color printing, so the type diffing will inject color markers into the output. More...
bool | getShowColors ()
void | setShowOverloads (OverloadsShown Val)
| Specify which overload candidates to show when overload resolution fails. More...
OverloadsShown | getShowOverloads () const
void | setLastDiagnosticIgnored (bool Ignored=true)
| Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed, or restore a prior ignoring state after ignoring some diagnostics and their notes, possibly in the middle of another diagnostic. More...
bool | isLastDiagnosticIgnored () const
| Determine whether the previous diagnostic was ignored. More...
void | setExtensionHandlingBehavior (diag::Severity H)
| Controls whether otherwise-unmapped extension diagnostics are mapped onto ignore/warning/error. More...
diag::Severity | getExtensionHandlingBehavior () const
void | IncrementAllExtensionsSilenced ()
| Counter bumped when an extension block is/ encountered. More...
void | DecrementAllExtensionsSilenced ()
bool | hasAllExtensionsSilenced ()
void | setSeverity (diag::kind Diag, diag::Severity Map, SourceLocation Loc)
| This allows the client to specify that certain warnings are ignored. More...
bool | setSeverityForGroup (diag::Flavor Flavor, StringRef Group, diag::Severity Map, SourceLocation Loc=SourceLocation())
| Change an entire diagnostic group (e.g. More...
bool | setDiagnosticGroupWarningAsError (StringRef Group, bool Enabled)
| Set the warning-as-error flag for the given diagnostic group. More...
bool | setDiagnosticGroupErrorAsFatal (StringRef Group, bool Enabled)
| Set the error-as-fatal flag for the given diagnostic group. More...
void | setSeverityForAll (diag::Flavor Flavor, diag::Severity Map, SourceLocation Loc=SourceLocation())
| Add the specified mapping to all diagnostics of the specified flavor. More...
bool | hasErrorOccurred () const
bool | hasUncompilableErrorOccurred () const
| Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror. More...
bool | hasFatalErrorOccurred () const
bool | hasUnrecoverableErrorOccurred () const
| Determine whether any kind of unrecoverable error has occurred. More...
unsigned | getNumWarnings () const
void | setNumWarnings (unsigned NumWarnings)
template<unsigned N>
unsigned | getCustomDiagID (Level L, const char(&FormatString)[N])
| Return an ID for a diagnostic with the specified format string and level. More...
void | ConvertArgToString (ArgumentKind Kind, intptr_t Val, StringRef Modifier, StringRef Argument, ArrayRef< ArgumentValue > PrevArgs, SmallVectorImpl< char > &Output, ArrayRef< intptr_t > QualTypeVals) const
| Converts a diagnostic argument (as an intptr_t) into the string that represents it. More...
void | SetArgToStringFn (ArgToStringFnTy Fn, void *Cookie)
void | notePriorDiagnosticFrom (const DiagnosticsEngine &Other)
| Note that the prior diagnostic was emitted by some other `DiagnosticsEngine`, and we may be attaching a note to that diagnostic. More...
void | Reset ()
| Reset the state of the diagnostic object to its initial configuration. More...
bool | isIgnored (unsigned DiagID, SourceLocation Loc) const
| Determine whether the diagnostic is known to be ignored. More...
Level | getDiagnosticLevel (unsigned DiagID, SourceLocation Loc) const
| Based on the way the client configured the DiagnosticsEngine object, classify the specified diagnostic ID into a Level, consumable by the DiagnosticConsumer. More...
DiagnosticBuilder | Report (SourceLocation Loc, unsigned DiagID)
| Issue the message to the client. More...
DiagnosticBuilder | Report (unsigned DiagID)
void | Report (const StoredDiagnostic &storedDiag)
bool | isDiagnosticInFlight () const
| Determine whethere there is already a diagnostic in flight. More...
void | SetDelayedDiagnostic (unsigned DiagID, StringRef Arg1="", StringRef Arg2="")
| Set the "delayed" diagnostic that will be emitted once the current diagnostic completes. More...
void | Clear ()
| Clear out the current diagnostic. More...
StringRef | getFlagValue () const
| Return the value associated with this diagnostic flag. More...

## Friends
class | Diagnostic
class | DiagnosticBuilder
class | DiagnosticErrorTrap
class | DiagnosticIDs
class | PartialDiagnostic

## Diagnostic Emission
class | ASTReader
class | ASTWriter
class | Sema
bool | EmitCurrentDiagnostic (bool Force=false)
| Emit the current diagnostic and clear the diagnostic state. More...
unsigned | getCurrentDiagID () const
SourceLocation | getCurrentDiagLoc () const

## Detailed Description

Concrete class used by the front-end to report problems and issues.

This massages the diagnostics (e.g. handling things like "report warnings as errors" and passes them off to the DiagnosticConsumer for reporting to the user. DiagnosticsEngine is tied to one translation unit and one SourceManager.

Definition at line 149 of file Diagnostic.h.

## Member Typedef Documentation

## ◆ ArgumentValue

using clang::DiagnosticsEngine::ArgumentValue = std::pair<ArgumentKind, intptr_t>

Represents on argument value, which is a union discriminated by ArgumentKind, with a value.

Definition at line 207 of file Diagnostic.h.

## ◆ diag_mapping_range

using clang::DiagnosticsEngine::diag_mapping_range = llvm::iterator_range<DiagState::const_iterator>

Definition at line 502 of file Diagnostic.h.

## Member Enumeration Documentation

## ◆ ArgumentKind

enum clang::DiagnosticsEngine::ArgumentKind

Enumerator
ak_std_string | std::string
ak_c_string | const char *
ak_sint | int
ak_uint | unsigned
ak_tokenkind | enum TokenKind : unsigned
ak_identifierinfo | IdentifierInfo.
ak_qual | Qualifiers.
ak_qualtype | QualType.
ak_declarationname | DeclarationName.
ak_nameddecl | NamedDecl *.
ak_nestednamespec | NestedNameSpecifier *.
ak_declcontext | DeclContext *.
ak_qualtype_pair | pair<QualType, QualType>
ak_attr | Attr *.

Definition at line 161 of file Diagnostic.h.

## ◆ Level

enum clang::DiagnosticsEngine::Level

The level of the diagnostic, after it has been through mapping.

Enumerator
Ignored |
Note |
Remark |
Warning |
Error |
Fatal |

Definition at line 152 of file Diagnostic.h.

## Constructor & Destructor Documentation

## ◆ DiagnosticsEngine() [1/2]

DiagnosticsEngine::DiagnosticsEngine | ( | IntrusiveRefCntPtr< DiagnosticIDs > | Diags,
|  | IntrusiveRefCntPtr< DiagnosticOptions > | DiagOpts,
|  | DiagnosticConsumer * | client = `nullptr`,
|  | bool | ShouldOwnClient = `true`
| ) |  |
| explicit

Definition at line 75 of file Diagnostic.cpp.

References DummyArgToStringFn(), Reset(), and setClient().

## ◆ DiagnosticsEngine() [2/2]

clang::DiagnosticsEngine::DiagnosticsEngine | ( | const DiagnosticsEngine & |  | ) |
| delete

## ◆ ~DiagnosticsEngine()

DiagnosticsEngine::~DiagnosticsEngine | ( |  | ) |

Definition at line 86 of file Diagnostic.cpp.

References setClient().

## Member Function Documentation

## ◆ Clear()

void clang::DiagnosticsEngine::Clear | ( |  | ) |
| inline

Clear out the current diagnostic.

Definition at line 881 of file Diagnostic.h.

References max().

Referenced by EmitCurrentDiagnostic(), clang::Sema::EmitCurrentDiagnostic(), and clang::PartialDiagnostic::EmitToString().

## ◆ ConvertArgToString()

void clang::DiagnosticsEngine::ConvertArgToString | ( | ArgumentKind | Kind,
|  | intptr_t | Val,
|  | StringRef | Modifier,
|  | StringRef | Argument,
|  | ArrayRef< ArgumentValue > | PrevArgs,
|  | SmallVectorImpl< char > & | Output,
|  | ArrayRef< intptr_t > | QualTypeVals
| ) |  | const
| inline

Converts a diagnostic argument (as an intptr_t) into the string that represents it.

Definition at line 783 of file Diagnostic.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor().

## ◆ DecrementAllExtensionsSilenced()

void clang::DiagnosticsEngine::DecrementAllExtensionsSilenced | ( |  | ) |
| inline

Definition at line 697 of file Diagnostic.h.

Referenced by clang::ExtensionRAIIObject::~ExtensionRAIIObject().

## ◆ dump() [1/2]

void DiagnosticsEngine::dump | ( |  | ) | const

Definition at line 92 of file Diagnostic.cpp.

Referenced by clang::Preprocessor::LexOnOffSwitch().

## ◆ dump() [2/2]

void DiagnosticsEngine::dump | ( | StringRef | DiagName | ) | const

Definition at line 96 of file Diagnostic.cpp.

## ◆ EmitCurrentDiagnostic()

bool DiagnosticsEngine::EmitCurrentDiagnostic | ( | bool | Force = `false` | ) |
| protected

Emit the current diagnostic and clear the diagnostic state.

Parameters

  Force | Emit the diagnostic regardless of suppression settings.

Definition at line 499 of file Diagnostic.cpp.

References Clear(), getClient(), clang::Diagnostic::getID(), clang::Diagnostic::getLocation(), clang::DiagnosticIDs::Ignored, and clang::DiagnosticConsumer::~DiagnosticConsumer().

Referenced by clang::Sema::EmitCurrentDiagnostic().

## ◆ getClient() [1/2]

DiagnosticConsumer* clang::DiagnosticsEngine::getClient | ( |  | ) |
| inline

Definition at line 510 of file Diagnostic.h.

Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::ModifyAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), EmitCurrentDiagnostic(), clang::ASTUnit::enableSourceFileDiagnostics(), clang::ASTMergeAction::ExecuteAction(), clang::FixItRewriter::FixItRewriter(), clang::DiagnosticIDs::getNearestOption(), SetupSerializedDiagnostics(), and clang::ASTUnit::~ASTUnit().

## ◆ getClient() [2/2]

const DiagnosticConsumer* clang::DiagnosticsEngine::getClient | ( |  | ) | const
| inline

Definition at line 511 of file Diagnostic.h.

## ◆ getConstexprBacktraceLimit()

unsigned clang::DiagnosticsEngine::getConstexprBacktraceLimit | ( |  | ) | const
| inline

Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic.

Definition at line 581 of file Diagnostic.h.

## ◆ getCurrentDiagID()

unsigned clang::DiagnosticsEngine::getCurrentDiagID | ( |  | ) | const
| inline protected

Definition at line 989 of file Diagnostic.h.

Referenced by clang::Sema::EmitCurrentDiagnostic().

## ◆ getCurrentDiagLoc()

SourceLocation clang::DiagnosticsEngine::getCurrentDiagLoc | ( |  | ) | const
| inline protected

Definition at line 991 of file Diagnostic.h.

Referenced by clang::Sema::EmitCurrentDiagnostic().

## ◆ getCustomDiagID()

template<unsigned N>

unsigned clang::DiagnosticsEngine::getCustomDiagID | ( | Level | L,
|  | const char(&) | FormatString[N]
| ) |  |
| inline

Return an ID for a diagnostic with the specified format string and level.

If this is the first request for this diagnostic, it is registered and created, otherwise the existing ID is returned.

Parameters

  FormatString | A fixed diagnostic format string that will be hashed and mapped to a unique DiagID.

Definition at line 776 of file Diagnostic.h.

Referenced by clang::CodeGen::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::CodeGenModule::Error(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::TextDiagnosticBuffer::FlushDiagnostics(), hasSuperInitCall(), IsHeaderFile(), isParenthesizedADLCallee(), isTypeSubstitutable(), clang::CodeGen::loadOffloadInfoMetadata(), mangleAArch64VectorBase(), clang::arcmt::FileRemapper::remap(), reportDiag(), rewriteToNumericBoxedExpression(), runThinLTOBackend(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().

## ◆ getDiagnosticIDs()

const IntrusiveRefCntPtr<DiagnosticIDs>& clang::DiagnosticsEngine::getDiagnosticIDs | ( |  | ) | const
| inline

Definition at line 495 of file Diagnostic.h.

Referenced by checkDiagnosticGroupMappings(), clang::ASTMergeAction::ExecuteAction(), clang::html::HighlightMacros(), isTargetEnvironment(), clang::ProcessWarningOptions(), and clang::PCHValidator::ReadDiagnosticOptions().

## ◆ getDiagnosticLevel()

Level clang::DiagnosticsEngine::getDiagnosticLevel | ( | unsigned | DiagID,
|  | SourceLocation | Loc
| ) |  | const
| inline

Based on the way the client configured the DiagnosticsEngine object, classify the specified diagnostic ID into a Level, consumable by the DiagnosticConsumer.

To preserve invariant assumptions, this function should not be used to influence parse or semantic analysis actions. Instead consider using `isIgnored()`.

Parameters

  Loc | The source location we are interested in finding out the diagnostic state. Can be null in order to query the latest state.

Definition at line 834 of file Diagnostic.h.

Referenced by checkDiagnosticGroupMappings(), EmitDeferredDiags(), clang::driver::Driver::ParseArgStrings(), and clang::Sema::CUDADiagBuilder::~CUDADiagBuilder().

## ◆ getDiagnosticMappings()

diag_mapping_range clang::DiagnosticsEngine::getDiagnosticMappings | ( |  | ) | const
| inline

Get the current set of diagnostic mappings.

Definition at line 505 of file Diagnostic.h.

## ◆ getDiagnosticOptions()

DiagnosticOptions& clang::DiagnosticsEngine::getDiagnosticOptions | ( |  | ) | const
| inline

Retrieve the diagnostic options.

Definition at line 500 of file Diagnostic.h.

Referenced by CheckResults(), clang::html::HighlightMacros(), and RenderDiagnosticsOptions().

## ◆ getElideType()

bool clang::DiagnosticsEngine::getElideType | ( |  | ) |
| inline

Definition at line 641 of file Diagnostic.h.

## ◆ getEnableAllWarnings()

bool clang::DiagnosticsEngine::getEnableAllWarnings | ( |  | ) | const
| inline

Definition at line 602 of file Diagnostic.h.

Referenced by checkDiagnosticMappings().

## ◆ getErrorsAsFatal()

bool clang::DiagnosticsEngine::getErrorsAsFatal | ( |  | ) | const
| inline

Definition at line 616 of file Diagnostic.h.

## ◆ getExtensionHandlingBehavior()

diag::Severity clang::DiagnosticsEngine::getExtensionHandlingBehavior | ( |  | ) | const
| inline

Definition at line 688 of file Diagnostic.h.

Referenced by HasExtension(), and isExtHandlingFromDiagsError().

## ◆ getFlagValue()

StringRef clang::DiagnosticsEngine::getFlagValue | ( |  | ) | const
| inline

Return the value associated with this diagnostic flag.

Definition at line 884 of file Diagnostic.h.

Referenced by printDiagnosticOptions().

## ◆ getIgnoreAllWarnings()

bool clang::DiagnosticsEngine::getIgnoreAllWarnings | ( |  | ) | const
| inline

Definition at line 591 of file Diagnostic.h.

Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().

## ◆ getNumWarnings()

unsigned clang::DiagnosticsEngine::getNumWarnings | ( |  | ) | const
| inline

Definition at line 761 of file Diagnostic.h.

Referenced by makeStandaloneDiagnostic().

## ◆ getPrintTemplateTree()

bool clang::DiagnosticsEngine::getPrintTemplateTree | ( |  | ) |
| inline

Definition at line 646 of file Diagnostic.h.

## ◆ getShowColors()

bool clang::DiagnosticsEngine::getShowColors | ( |  | ) |
| inline

Definition at line 651 of file Diagnostic.h.

Referenced by clang::Decl::dump(), and clang::DeclContext::dumpLookups().

## ◆ getShowOverloads()

OverloadsShown clang::DiagnosticsEngine::getShowOverloads | ( |  | ) | const
| inline

Definition at line 660 of file Diagnostic.h.

Referenced by clang::TemplateSpecCandidateSet::NoteCandidates().

## ◆ getSourceManager()

SourceManager& clang::DiagnosticsEngine::getSourceManager | ( |  | ) | const
| inline

Definition at line 522 of file Diagnostic.h.

Referenced by clang::Diagnostic::getSourceManager(), and toLevel().

## ◆ getSuppressAllDiagnostics()

bool clang::DiagnosticsEngine::getSuppressAllDiagnostics | ( |  | ) | const
| inline

Definition at line 636 of file Diagnostic.h.

Referenced by buildCounterUpdate(), and clang::Sema::tryExprAsCall().

## ◆ getSuppressSystemWarnings()

bool clang::DiagnosticsEngine::getSuppressSystemWarnings | ( |  | ) | const
| inline

Definition at line 626 of file Diagnostic.h.

Referenced by checkDiagnosticMappings(), clang::Sema::diagnoseZeroToNullptrConversion(), getNullabilityCompletenessCheckFileID(), isConfigurationPattern(), and clang::sema::AnalysisBasedWarnings::IssueWarnings().

## ◆ getTemplateBacktraceLimit()

unsigned clang::DiagnosticsEngine::getTemplateBacktraceLimit | ( |  | ) | const
| inline

Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic.

Definition at line 569 of file Diagnostic.h.

Referenced by clang::Sema::PrintInstantiationStack().

## ◆ getWarningsAsErrors()

bool clang::DiagnosticsEngine::getWarningsAsErrors | ( |  | ) | const
| inline

Definition at line 610 of file Diagnostic.h.

Referenced by checkDiagnosticMappings(), and isExtHandlingFromDiagsError().

## ◆ hasAllExtensionsSilenced()

bool clang::DiagnosticsEngine::hasAllExtensionsSilenced | ( |  | ) |
| inline

Definition at line 698 of file Diagnostic.h.

References Diag().

## ◆ hasErrorOccurred()

bool clang::DiagnosticsEngine::hasErrorOccurred | ( |  | ) | const
| inline

Definition at line 747 of file Diagnostic.h.

Referenced by clang::Sema::ActOnEndOfTranslationUnit(), compileAndLoadModule(), clang::CreateModernObjCRewriter(), clang::CreateObjCRewriter(), clang::ExecuteCompilerInvocation(), clang::PCHGenerator::HandleTranslationUnit(), clang::FrontendAction::shouldEraseOutputFiles(), and Write_ProtocolExprReferencedMetadata().

## ◆ hasFatalErrorOccurred()

bool clang::DiagnosticsEngine::hasFatalErrorOccurred | ( |  | ) | const
| inline

Definition at line 754 of file Diagnostic.h.

Referenced by clang::Sema::CodeSynthesisContext::isInstantiationRecord().

## ◆ hasSourceManager()

bool clang::DiagnosticsEngine::hasSourceManager | ( |  | ) | const
| inline

Definition at line 520 of file Diagnostic.h.

Referenced by clang::Diagnostic::hasSourceManager().

## ◆ hasUncompilableErrorOccurred()

bool clang::DiagnosticsEngine::hasUncompilableErrorOccurred | ( |  | ) | const
| inline

Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror.

Definition at line 751 of file Diagnostic.h.

Referenced by clang::PCHGenerator::HandleTranslationUnit(), clang::Sema::CodeSynthesisContext::isInstantiationRecord(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::ASTUnit::serialize().

## ◆ hasUnrecoverableErrorOccurred()

bool clang::DiagnosticsEngine::hasUnrecoverableErrorOccurred | ( |  | ) | const
| inline

Determine whether any kind of unrecoverable error has occurred.

Definition at line 757 of file Diagnostic.h.

Referenced by clang::arcmt::TransformActions::hasReportedErrors().

## ◆ IncrementAllExtensionsSilenced()

void clang::DiagnosticsEngine::IncrementAllExtensionsSilenced | ( |  | ) |
| inline

Counter bumped when an extension block is/ encountered.

When non-zero, all extension diagnostics are entirely silenced, no matter how they are mapped.

Definition at line 696 of file Diagnostic.h.

Referenced by clang::ExtensionRAIIObject::ExtensionRAIIObject().

## ◆ isDiagnosticInFlight()

bool clang::DiagnosticsEngine::isDiagnosticInFlight | ( |  | ) | const
| inline

Determine whethere there is already a diagnostic in flight.

Definition at line 852 of file Diagnostic.h.

References max().

Referenced by clang::SrcMgr::ContentCache::getBuffer().

## ◆ isIgnored()

bool clang::DiagnosticsEngine::isIgnored | ( | unsigned | DiagID,
|  | SourceLocation | Loc
| ) |  | const
| inline

Determine whether the diagnostic is known to be ignored.

This can be used to opportunistically avoid expensive checks when it's known for certain that the diagnostic has been suppressed at the specified location `Loc`.

Parameters

  Loc | The source location we are interested in finding out the diagnostic state. Can be null in order to query the latest state.

Definition at line 819 of file Diagnostic.h.

References clang::diag::Ignored.

Referenced by clang::Sema::ActOnEndOfTranslationUnit(), CheckCommaOperands(), CheckConditionalOperator(), CheckCXX98CompatAccessibleCopy(), CheckFallThrough(), checkNullabilityConsistency(), DiagnoseBadFunctionCast(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseCallingConvCast(), DiagnoseForRangeVariableCopies(), DiagnoseMismatchedNewDelete(), clang::Sema::DiagnoseMultipleMethodInGlobalPool(), DiagnoseNullConversion(), clang::Sema::diagnoseZeroToNullptrConversion(), isEnabled(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), LookupMemberExpr(), LookupMethodInReceiverType(), maybeDiagnoseIDCharCompat(), ParseAlignPragma(), clang::Lexer::ReadToEndOfLine(), and shouldWarnIfShadowedDecl().

## ◆ isLastDiagnosticIgnored()

bool clang::DiagnosticsEngine::isLastDiagnosticIgnored | ( |  | ) | const
| inline

Determine whether the previous diagnostic was ignored.

This can be used by clients that want to determine whether notes attached to a diagnostic will be suppressed.

Definition at line 677 of file Diagnostic.h.

References clang::DiagnosticIDs::Ignored.

## ◆ notePriorDiagnosticFrom()

void clang::DiagnosticsEngine::notePriorDiagnosticFrom | ( | const DiagnosticsEngine & | Other | ) |
| inline

Note that the prior diagnostic was emitted by some other `DiagnosticsEngine`, and we may be attaching a note to that diagnostic.

Definition at line 799 of file Diagnostic.h.

Referenced by clang::StructuralEquivalenceContext::Diag1(), clang::StructuralEquivalenceContext::Diag2(), clang::ASTImporter::FromDiag(), and clang::ASTImporter::ToDiag().

## ◆ operator=()

DiagnosticsEngine& clang::DiagnosticsEngine::operator= | ( | const DiagnosticsEngine & |  | ) |
| delete

## ◆ ownsClient()

bool clang::DiagnosticsEngine::ownsClient | ( |  | ) | const
| inline

Determine whether this `DiagnosticsEngine` object own its client.

Definition at line 514 of file Diagnostic.h.

Referenced by SetUpDiagnosticLog(), SetupSerializedDiagnostics(), and clang::VerifyDiagnosticConsumer::~VerifyDiagnosticConsumer().

## ◆ popMappings()

bool DiagnosticsEngine::popMappings | ( | SourceLocation | Loc | ) |

Pops the current DiagMappings off the top of the stack, causing the new top of the stack to be the active mappings.

Returns
  `true` if the pop happens, `false` if there is only one DiagMapping on the stack.

Definition at line 110 of file Diagnostic.cpp.

Referenced by clang::Preprocessor::LexOnOffSwitch().

## ◆ pushMappings()

void DiagnosticsEngine::pushMappings | ( | SourceLocation | Loc | ) |

Copies the current DiagMappings and pushes the new copy onto the top of the stack.

Definition at line 106 of file Diagnostic.cpp.

Referenced by clang::Preprocessor::LexOnOffSwitch().

## ◆ Report() [1/3]

DiagnosticBuilder clang::DiagnosticsEngine::Report | ( | SourceLocation | Loc,
|  | unsigned | DiagID
| ) |  |
| inline

Issue the message to the client.

This actually returns an instance of DiagnosticBuilder which emits the diagnostics (through `ProcessDiag`) when it is destroyed.

Parameters

  DiagID | A member of the `diag::kind` enum.
  Loc | Represents the source location associated with the diagnostic, which can be an invalid location if no position information is available.

Definition at line 1295 of file Diagnostic.h.

References max().

Referenced by clang::AttachHeaderIncludeGen(), clang::FrontendAction::BeginSourceFile(), clang::TargetInfo::checkCFProtectionBranchSupported(), clang::TargetInfo::checkCFProtectionReturnSupported(), checkDiagnosticGroupMappings(), checkDiagnosticMappings(), clang::ento::CheckerRegistry::CheckerRegistry(), checkHeaderSearchOptions(), checkLanguageOptions(), clang::Preprocessor::checkModuleIsAvailable(), checkMSVCHeaderSearch(), checkPreprocessorOptions(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), checkTargetOptions(), checkVerifyPrefixes(), clang::CompilerInstance::clearOutputFiles(), collectModuleHeaderIncludes(), compileAndLoadModule(), compileModuleImpl(), clang::GeneratePCHAction::ComputeASTConsumerArguments(), computeKeyFunction(), clang::DependencyFileGenerator::CreateAndAttachToPreprocessor(), clang::CodeGenAction::CreateASTConsumer(), clang::GenerateModuleAction::CreateASTConsumer(), clang::CompilerInstance::createCodeCompletionConsumer(), clang::TestModuleFileExtension::createExtensionReader(), clang::CompilerInvocation::CreateFromArgs(), clang::CreateFrontendBaseAction(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), clang::CompilerInstance::createOutputFile(), clang::TargetInfo::CreateTargetInfo(), clang::createVFSFromCompilerInvocation(), Diag(), clang::driver::Driver::Diag(), clang::Parser::Diag(), clang::Sema::Diag(), clang::Preprocessor::Diag(), clang::StructuralEquivalenceContext::Diag1(), clang::StructuralEquivalenceContext::Diag2(), diagnoseFrameworkInclude(), clang::ModuleMap::diagnoseHeaderInclusion(), clang::cross_tu::CrossTranslationUnitContext::emitCrossTUDiagnostics(), clang::PartialDiagnostic::EmitToString(), EmitUnknownDiagWarning(), EnableCodeCompletion(), clang::CodeGen::CodeGenModule::Error(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGenAction::ExecuteAction(), clang::ExecuteCompilerInvocation(), clang::TextDiagnosticBuffer::FlushDiagnostics(), clang::ASTImporter::FromDiag(), GenerateOptimizationRemarkRegex(), getAliasedGlobal(), clang::SrcMgr::ContentCache::getBuffer(), getCC1Arguments(), getCodeModel(), clang::FrontendAction::getCurrentModule(), getInputBufferForModule(), getLastArgIntValueImpl(), clang::ASTReader::getOriginalSourceFile(), getRelocModel(), getTargetEntryUniqueInfo(), clang::targets::ARMTargetInfo::handleTargetFeatures(), clang::targets::X86TargetInfo::handleTargetFeatures(), hasSuperInitCall(), clang::Rewriter::IncreaseIndentation(), clang::targets::PPCTargetInfo::initFeatureMap(), InitializeFileRemapping(), clang::CompilerInstance::InitializeSourceManager(), isInPackage(), isParenthesizedADLCallee(), clang::CodeGen::CodeGenModule::isTypeConstant(), isTypeSubstitutable(), clang::CompilerInstance::loadModule(), clang::CompilerInstance::loadModuleFromSource(), clang::CodeGen::loadOffloadInfoMetadata(), mangleAArch64VectorBase(), maybeDiagnoseIDCharCompat(), maybeDiagnoseUTF8Homoglyph(), parseAnalyzerConfigs(), clang::driver::Driver::ParseArgStrings(), ParseCodeGenArgs(), parseDiagnosticLevelMask(), ParseFrontendArgs(), ParseLangArgs(), ParsePreprocessorArgs(), ParseTargetArgs(), parseVisibility(), ppcUserFeaturesCheck(), prepareToBuildModule(), PrintExpected(), clang::Sema::PrintInstantiationStack(), clang::Sema::PrintPragmaAttributeInstantiationPoint(), PrintUnexpected(), clang::ProcessWarningOptions(), clang::arcmt::FileRemapper::remap(), clang::arcmt::TransformActions::report(), reportDiag(), clang::arcmt::CapturedDiagList::reportDiagnostics(), clang::CodeGen::InstrProfStats::reportDiagnostics(), rewriteToNumericBoxedExpression(), runThinLTOBackend(), setCommandLineOpts(), SetDelayedDiagnostic(), SetUpDiagnosticLog(), clang::StringLiteralParser::StringLiteralParser(), clang::ASTImporter::ToDiag(), clang::ento::CheckerRegistry::validateCheckerOptions(), clang::targets::MipsTargetInfo::validateTarget(), and Write_RethrowObject().

## ◆ Report() [2/3]

DiagnosticBuilder clang::DiagnosticsEngine::Report | ( | unsigned | DiagID | ) |
| inline

Definition at line 1305 of file Diagnostic.h.

## ◆ Report() [3/3]

void DiagnosticsEngine::Report | ( | const StoredDiagnostic & | storedDiag | ) |

Definition at line 473 of file Diagnostic.cpp.

References clang::StoredDiagnostic::fixit_begin(), clang::StoredDiagnostic::fixit_end(), clang::StoredDiagnostic::getID(), clang::StoredDiagnostic::getLevel(), clang::StoredDiagnostic::getLocation(), clang::StoredDiagnostic::getMessage(), clang::DiagnosticConsumer::HandleDiagnostic(), clang::DiagnosticConsumer::IncludeInDiagnosticCounts(), max(), clang::StoredDiagnostic::range_begin(), clang::StoredDiagnostic::range_end(), and Warning.

## ◆ Reset()

void DiagnosticsEngine::Reset | ( |  | ) |

Reset the state of the diagnostic object to its initial configuration.

Definition at line 122 of file Diagnostic.cpp.

References clang::DiagnosticIDs::Ignored, and max().

Referenced by clang::FixItRecompile::BeginInvocation(), clang::PrecompiledPreamble::Build(), DiagnosticsEngine(), clang::ASTUnit::LoadFromCompilerInvocationAction(), makeStandaloneDiagnostic(), and clang::ASTUnit::Reparse().

## ◆ SetArgToStringFn()

void clang::DiagnosticsEngine::SetArgToStringFn | ( | ArgToStringFnTy | Fn,
|  | void * | Cookie
| ) |  |
| inline

Definition at line 792 of file Diagnostic.h.

Referenced by clang::ASTMergeAction::ExecuteAction().

## ◆ setClient()

void DiagnosticsEngine::setClient | ( | DiagnosticConsumer * | client,
|  | bool | ShouldOwnClient = `true`
| ) |  |

Set the diagnostic client associated with this diagnostic object.

Parameters

  ShouldOwnClient | true if the diagnostic object should take ownership of `client`.

Definition at line 100 of file Diagnostic.cpp.

Referenced by DiagnosticsEngine(), clang::FixItRewriter::FixItRewriter(), SetUpDiagnosticLog(), SetupSerializedDiagnostics(), ~DiagnosticsEngine(), and clang::FixItRewriter::~FixItRewriter().

## ◆ setConstexprBacktraceLimit()

void clang::DiagnosticsEngine::setConstexprBacktraceLimit | ( | unsigned | Limit | ) |
| inline

Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic.

Definition at line 575 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ SetDelayedDiagnostic()

void DiagnosticsEngine::SetDelayedDiagnostic | ( | unsigned | DiagID,
|  | StringRef | Arg1 = `""`,
|  | StringRef | Arg2 = `""`
| ) |  |

Set the "delayed" diagnostic that will be emitted once the current diagnostic completes.

If a diagnostic is already in-flight but the front end must report a problem (e.g., with an inconsistent file system state), this routine sets a "delayed" diagnostic that will be emitted after the current diagnostic completes. This should only be used for fatal errors detected at inconvenient times. If emitting a delayed diagnostic causes a second delayed diagnostic to be introduced, that second delayed diagnostic will be ignored.

Parameters

  DiagID | The ID of the diagnostic being delayed.
  Arg1 | A string argument that will be provided to the diagnostic. A copy of this string will be stored in the DiagnosticsEngine object itself.
  Arg2 | A string argument that will be provided to the diagnostic. A copy of this string will be stored in the DiagnosticsEngine object itself.

Definition at line 148 of file Diagnostic.cpp.

References dump(), clang::diag::Error, clang::diag::Fatal, clang::SourceManager::getBuffer(), clang::SourceManager::getDecomposedIncludedLoc(), clang::SourceManager::getDecomposedLoc(), clang::FileID::getHashValue(), clang::SourceManager::getLocForStartOfFile(), clang::SourceLocation::getLocWithOffset(), clang::DiagnosticIDs::getWarningOptionForDiag(), clang::diag::Ignored, clang::FileID::isValid(), clang::SourceLocation::isValid(), clang::Last, Offset, P, clang::SourceLocation::print(), clang::diag::Remark, Report(), State, and clang::diag::Warning.

Referenced by clang::SrcMgr::ContentCache::getBuffer(), and clang::DiagnosticIDs::getNearestOption().

## ◆ setDiagnosticGroupErrorAsFatal()

bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal | ( | StringRef | Group,
|  | bool | Enabled
| ) |  |

Set the error-as-fatal flag for the given diagnostic group.

This function always only operates on the current diagnostic state.

Returns
  True if the given group is unknown, false otherwise.

Definition at line 430 of file Diagnostic.cpp.

References Diag(), clang::diag::Error, clang::diag::Fatal, clang::DiagnosticMapping::getSeverity(), clang::DiagnosticMapping::setNoErrorAsFatal(), clang::DiagnosticMapping::setSeverity(), setSeverityForGroup(), and clang::diag::WarningOrError.

Referenced by clang::ProcessWarningOptions().

## ◆ setDiagnosticGroupWarningAsError()

bool DiagnosticsEngine::setDiagnosticGroupWarningAsError | ( | StringRef | Group,
|  | bool | Enabled
| ) |  |

Set the warning-as-error flag for the given diagnostic group.

This function always only operates on the current diagnostic state.

Returns
  True if the given group is unknown, false otherwise.

Definition at line 399 of file Diagnostic.cpp.

References Diag(), clang::diag::Error, clang::diag::Fatal, clang::DiagnosticMapping::getSeverity(), clang::DiagnosticMapping::setNoWarningAsError(), clang::DiagnosticMapping::setSeverity(), setSeverityForGroup(), clang::diag::Warning, and clang::diag::WarningOrError.

Referenced by clang::ProcessWarningOptions().

## ◆ setElideType()

void clang::DiagnosticsEngine::setElideType | ( | bool | Val = `true` | ) |
| inline

Set type eliding, to skip outputting same types occurring in template types.

Definition at line 640 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setEnableAllWarnings()

void clang::DiagnosticsEngine::setEnableAllWarnings | ( | bool | Val | ) |
| inline

When set to true, any unmapped ignored warnings are no longer ignored.

If this and IgnoreAllWarnings are both set, then that one wins.

Definition at line 599 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setErrorLimit()

void clang::DiagnosticsEngine::setErrorLimit | ( | unsigned | Limit | ) |
| inline

Specify a limit for the number of errors we should emit before giving up.

Zero disables the limit.

Definition at line 559 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setErrorsAsFatal()

void clang::DiagnosticsEngine::setErrorsAsFatal | ( | bool | Val | ) |
| inline

When set to true, any error reported is made a fatal error.

Definition at line 615 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setExtensionHandlingBehavior()

void clang::DiagnosticsEngine::setExtensionHandlingBehavior | ( | diag::Severity | H | ) |
| inline

Controls whether otherwise-unmapped extension diagnostics are mapped onto ignore/warning/error.

This corresponds to the GCC -pedantic and -pedantic-errors option.

Definition at line 685 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setIgnoreAllWarnings()

void clang::DiagnosticsEngine::setIgnoreAllWarnings | ( | bool | Val | ) |
| inline

When set to true, any unmapped warnings are ignored.

If this and WarningsAsErrors are both set, then this one wins.

Definition at line 588 of file Diagnostic.h.

Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::MigrateSourceAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), and clang::ProcessWarningOptions().

## ◆ setLastDiagnosticIgnored()

void clang::DiagnosticsEngine::setLastDiagnosticIgnored | ( | bool | Ignored = `true` | ) |
| inline

Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed, or restore a prior ignoring state after ignoring some diagnostics and their notes, possibly in the middle of another diagnostic.

This can be used by clients who suppress diagnostics themselves.

Definition at line 668 of file Diagnostic.h.

References clang::DiagnosticIDs::Fatal, clang::DiagnosticIDs::Ignored, and clang::DiagnosticIDs::Warning.

Referenced by clang::Sema::EmitCurrentDiagnostic(), clang::arcmt::CapturedDiagList::hasErrors(), and clang::Sema::SFINAETrap::~SFINAETrap().

## ◆ setNumWarnings()

void clang::DiagnosticsEngine::setNumWarnings | ( | unsigned | NumWarnings | ) |
| inline

Definition at line 763 of file Diagnostic.h.

Referenced by makeStandaloneDiagnostic(), and clang::ASTUnit::Reparse().

## ◆ setPrintTemplateTree()

void clang::DiagnosticsEngine::setPrintTemplateTree | ( | bool | Val = `false` | ) |
| inline

Set tree printing, to outputting the template difference in a tree format.

Definition at line 645 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setSeverity()

void DiagnosticsEngine::setSeverity | ( | diag::kind | Diag,
|  | diag::Severity | Map,
|  | SourceLocation | Loc
| ) |  |

This allows the client to specify that certain warnings are ignored.

Notes can never be mapped, errors can only be mapped to fatal, and WARNINGs and EXTENSIONs can be mapped arbitrarily.

Parameters

  Loc | The source location that this change of diagnostic state should take affect. It can be null if we are setting the latest state.

Definition at line 343 of file Diagnostic.cpp.

References clang::diag::DIAG_UPPER_LIMIT, clang::diag::Error, clang::diag::Fatal, clang::DiagnosticMapping::getSeverity(), clang::SourceLocation::isInvalid(), clang::DiagnosticMapping::setUpgradedFromWarning(), and clang::diag::Warning.

Referenced by ParseAlignPragma(), setSeverityForAll(), and setSeverityForGroup().

## ◆ setSeverityForAll()

void DiagnosticsEngine::setSeverityForAll | ( | diag::Flavor | Flavor,
|  | diag::Severity | Map,
|  | SourceLocation | Loc = `SourceLocation()`
| ) |  |

Add the specified mapping to all diagnostics of the specified flavor.

Mainly to be used by -Wno-everything to disable all warnings but allow subsequent -W options to enable specific warnings.

Definition at line 460 of file Diagnostic.cpp.

References Diag(), clang::DiagnosticIDs::getAllDiagnostics(), and setSeverity().

Referenced by clang::Preprocessor::LexOnOffSwitch(), and clang::ProcessWarningOptions().

## ◆ setSeverityForGroup()

bool DiagnosticsEngine::setSeverityForGroup | ( | diag::Flavor | Flavor,
|  | StringRef | Group,
|  | diag::Severity | Map,
|  | SourceLocation | Loc = `SourceLocation()`
| ) |  |

Change an entire diagnostic group (e.g.

"unknown-pragmas") to have the specified mapping.

Returns
  true (and ignores the request) if "Group" was unknown, false otherwise.

Parameters

  Flavor | The flavor of group to affect. -Rfoo does not affect the state of the -Wfoo group and vice versa.
  Loc | The source location that this change of diagnostic state should take affect. It can be null if we are setting the state from command-line.

Definition at line 384 of file Diagnostic.cpp.

References Diag(), and setSeverity().

Referenced by clang::Preprocessor::LexOnOffSwitch(), clang::ProcessWarningOptions(), setDiagnosticGroupErrorAsFatal(), and setDiagnosticGroupWarningAsError().

## ◆ setShowColors()

void clang::DiagnosticsEngine::setShowColors | ( | bool | Val = `false` | ) |
| inline

Set color printing, so the type diffing will inject color markers into the output.

Definition at line 650 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setShowOverloads()

void clang::DiagnosticsEngine::setShowOverloads | ( | OverloadsShown | Val | ) |
| inline

Specify which overload candidates to show when overload resolution fails.

By default, we show all candidates.

Definition at line 657 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setSourceManager()

void clang::DiagnosticsEngine::setSourceManager | ( | SourceManager * | SrcMgr | ) |
| inline

Definition at line 527 of file Diagnostic.h.

Referenced by clang::SourceManager::SourceManager().

## ◆ setSuppressAfterFatalError()

void clang::DiagnosticsEngine::setSuppressAfterFatalError | ( | bool | Val | ) |
| inline

When set to true (the default), suppress further diagnostics after a fatal error.

Definition at line 620 of file Diagnostic.h.

## ◆ setSuppressAllDiagnostics()

void clang::DiagnosticsEngine::setSuppressAllDiagnostics | ( | bool | Val = `true` | ) |
| inline

Suppress all diagnostics, to silence the front end when we know that we don't want any more diagnostics to be passed along to the client.

Definition at line 633 of file Diagnostic.h.

Referenced by buildCounterUpdate(), and clang::Sema::tryExprAsCall().

## ◆ setSuppressSystemWarnings()

void clang::DiagnosticsEngine::setSuppressSystemWarnings | ( | bool | Val | ) |
| inline

When set to true mask warnings that come from system headers.

Definition at line 623 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setTemplateBacktraceLimit()

void clang::DiagnosticsEngine::setTemplateBacktraceLimit | ( | unsigned | Limit | ) |
| inline

Specify the maximum number of template instantiation notes to emit along with a given diagnostic.

Definition at line 563 of file Diagnostic.h.

Referenced by clang::ProcessWarningOptions().

## ◆ setWarningsAsErrors()

void clang::DiagnosticsEngine::setWarningsAsErrors | ( | bool | Val | ) |
| inline

When set to true, any warnings reported are issued as errors.

Definition at line 607 of file Diagnostic.h.

Referenced by clang::ento::CreateAnalysisConsumer(), and clang::ProcessWarningOptions().

## ◆ takeClient()

std::unique_ptr<DiagnosticConsumer> clang::DiagnosticsEngine::takeClient | ( |  | ) |
| inline

Return the current diagnostic client along with ownership of that client.

Definition at line 518 of file Diagnostic.h.

Referenced by clang::FixItRewriter::FixItRewriter(), SetUpDiagnosticLog(), and SetupSerializedDiagnostics().

## Friends And Related Function Documentation

## ◆ ASTReader

friend class ASTReader
| friend

Definition at line 975 of file Diagnostic.h.

## ◆ ASTWriter

friend class ASTWriter
| friend

Definition at line 976 of file Diagnostic.h.

## ◆ Diagnostic

friend class Diagnostic
| friend

Definition at line 893 of file Diagnostic.h.

## ◆ DiagnosticBuilder

friend class DiagnosticBuilder
| friend

Definition at line 894 of file Diagnostic.h.

## ◆ DiagnosticErrorTrap

friend class DiagnosticErrorTrap
| friend

Definition at line 895 of file Diagnostic.h.

## ◆ DiagnosticIDs

friend class DiagnosticIDs
| friend

Definition at line 896 of file Diagnostic.h.

## ◆ PartialDiagnostic

friend class PartialDiagnostic
| friend

Definition at line 897 of file Diagnostic.h.

## ◆ Sema

friend class Sema
| friend

Definition at line 982 of file Diagnostic.h.

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

- include/clang/Basic/Diagnostic.h
- lib/Basic/Diagnostic.cpp