clang
6.0.0
|
Concrete class used by the front-end to report problems and issues. More...
#include "clang/Basic/Diagnostic.h"
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_qualtype, ak_declarationname, ak_nameddecl, ak_nestednamespec, ak_declcontext, ak_qualtype_pair, ak_attr } |
typedef std::pair< ArgumentKind, intptr_t > | ArgumentValue |
Represents on argument value, which is a union discriminated by ArgumentKind, with a value. More... | |
typedef llvm::iterator_range< DiagState::const_iterator > | diag_mapping_range |
Public Member Functions | |
DiagnosticsEngine (IntrusiveRefCntPtr< DiagnosticIDs > Diags, DiagnosticOptions *DiagOpts, DiagnosticConsumer *client=nullptr, bool ShouldOwnClient=true) | |
DiagnosticsEngine (const DiagnosticsEngine &)=delete | |
DiagnosticsEngine & | operator= (const DiagnosticsEngine &)=delete |
~DiagnosticsEngine () | |
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 | DiagnosticIDs |
class | DiagnosticBuilder |
class | Diagnostic |
class | PartialDiagnostic |
class | DiagnosticErrorTrap |
class | ASTReader |
class | ASTWriter |
Diagnostic Emission | |
class | Sema |
bool | EmitCurrentDiagnostic (bool Force=false) |
Emit the current diagnostic and clear the diagnostic state. More... | |
unsigned | getCurrentDiagID () const |
SourceLocation | getCurrentDiagLoc () const |
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 147 of file Diagnostic.h.
typedef std::pair<ArgumentKind, intptr_t> clang::DiagnosticsEngine::ArgumentValue |
Represents on argument value, which is a union discriminated by ArgumentKind, with a value.
Definition at line 177 of file Diagnostic.h.
typedef llvm::iterator_range<DiagState::const_iterator> clang::DiagnosticsEngine::diag_mapping_range |
Definition at line 419 of file Diagnostic.h.
Enumerator | |
---|---|
ak_std_string | std::string |
ak_c_string | const char * |
ak_sint | int |
ak_uint | unsigned |
ak_tokenkind | enum TokenKind : unsigned |
ak_identifierinfo | |
ak_qualtype | |
ak_declarationname | |
ak_nameddecl | NamedDecl *. |
ak_nestednamespec | |
ak_declcontext | DeclContext *. |
ak_qualtype_pair | pair<QualType, QualType> |
ak_attr | Attr *. |
Definition at line 159 of file Diagnostic.h.
The level of the diagnostic, after it has been through mapping.
Enumerator | |
---|---|
Ignored | |
Note | |
Remark | |
Warning | |
Error | |
Fatal |
Definition at line 150 of file Diagnostic.h.
|
explicit |
Definition at line 60 of file Diagnostic.cpp.
References DummyArgToStringFn(), clang::Ovl_All, Reset(), and setClient().
|
delete |
DiagnosticsEngine::~DiagnosticsEngine | ( | ) |
Definition at line 85 of file Diagnostic.cpp.
References setClient().
|
inline |
Clear out the current diagnostic.
Definition at line 794 of file Diagnostic.h.
Referenced by EmitCurrentDiagnostic(), clang::Sema::EmitCurrentDiagnostic(), and clang::PartialDiagnostic::EmitToString().
|
inline |
Converts a diagnostic argument (as an intptr_t) into the string that represents it.
Definition at line 698 of file Diagnostic.h.
|
inline |
Definition at line 612 of file Diagnostic.h.
Referenced by clang::ExtensionRAIIObject::~ExtensionRAIIObject().
Emit the current diagnostic and clear the diagnostic state.
Force | Emit the diagnostic regardless of suppression settings. |
Definition at line 400 of file Diagnostic.cpp.
References Clear(), getClient(), clang::Diagnostic::getID(), clang::Diagnostic::getLocation(), and clang::DiagnosticIDs::Ignored.
Referenced by clang::Sema::EmitCurrentDiagnostic().
|
inline |
Definition at line 427 of file Diagnostic.h.
Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::ModifyAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), EmitCurrentDiagnostic(), clang::ASTMergeAction::ExecuteAction(), clang::FixItRewriter::FixItRewriter(), clang::DiagnosticIDs::getNearestOption(), SetupSerializedDiagnostics(), and clang::ASTUnit::~ASTUnit().
|
inline |
Definition at line 428 of file Diagnostic.h.
|
inline |
Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic.
Definition at line 496 of file Diagnostic.h.
|
inlineprotected |
Definition at line 898 of file Diagnostic.h.
Referenced by clang::Sema::EmitCurrentDiagnostic().
|
inlineprotected |
Definition at line 900 of file Diagnostic.h.
Referenced by clang::Sema::EmitCurrentDiagnostic().
|
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.
FormatString | A fixed diagnostic format string that will be hashed and mapped to a unique DiagID. |
Definition at line 691 of file Diagnostic.h.
Referenced by clang::CodeGen::CodeGenModule::Error(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::TextDiagnosticBuffer::FlushDiagnostics(), InvalidPTH(), IsHeaderFile(), reportDiag(), rewriteToNumericBoxedExpression(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
|
inline |
Definition at line 412 of file Diagnostic.h.
Referenced by checkDiagnosticGroupMappings(), clang::ASTMergeAction::ExecuteAction(), clang::html::HighlightMacros(), isTargetEnvironment(), clang::ProcessWarningOptions(), and clang::PCHValidator::ReadDiagnosticOptions().
|
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()
.
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 749 of file Diagnostic.h.
Referenced by checkDiagnosticGroupMappings(), EmitDeferredDiags(), clang::driver::Driver::ParseArgStrings(), and clang::Sema::CUDADiagBuilder::~CUDADiagBuilder().
|
inline |
Get the current set of diagnostic mappings.
Definition at line 422 of file Diagnostic.h.
|
inline |
Retrieve the diagnostic options.
Definition at line 417 of file Diagnostic.h.
Referenced by CheckResults(), clang::html::HighlightMacros(), and RenderDiagnosticsOptions().
|
inline |
Definition at line 556 of file Diagnostic.h.
|
inline |
Definition at line 517 of file Diagnostic.h.
Referenced by checkDiagnosticMappings().
|
inline |
Definition at line 531 of file Diagnostic.h.
|
inline |
Definition at line 603 of file Diagnostic.h.
Referenced by HasExtension(), and isExtHandlingFromDiagsError().
|
inline |
Return the value associated with this diagnostic flag.
Definition at line 797 of file Diagnostic.h.
Referenced by printDiagnosticOptions().
|
inline |
Definition at line 506 of file Diagnostic.h.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().
|
inline |
Definition at line 676 of file Diagnostic.h.
Referenced by makeStandaloneDiagnostic().
|
inline |
Definition at line 561 of file Diagnostic.h.
|
inline |
Definition at line 566 of file Diagnostic.h.
Referenced by clang::Decl::dump(), and clang::DeclContext::dumpLookups().
|
inline |
Definition at line 575 of file Diagnostic.h.
Referenced by clang::TemplateSpecCandidateSet::NoteCandidates().
|
inline |
Definition at line 438 of file Diagnostic.h.
Referenced by clang::Diagnostic::getSourceManager(), and toLevel().
|
inline |
Definition at line 551 of file Diagnostic.h.
Referenced by BuildCounterUpdate().
|
inline |
Definition at line 541 of file Diagnostic.h.
Referenced by checkDiagnosticMappings(), getNullabilityCompletenessCheckFileID(), isConfigurationPattern(), and clang::sema::AnalysisBasedWarnings::IssueWarnings().
|
inline |
Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic.
Definition at line 484 of file Diagnostic.h.
Referenced by clang::Sema::PrintInstantiationStack().
|
inline |
Definition at line 525 of file Diagnostic.h.
Referenced by checkDiagnosticMappings(), and isExtHandlingFromDiagsError().
|
inline |
Definition at line 613 of file Diagnostic.h.
References Diag().
|
inline |
Definition at line 662 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().
|
inline |
Definition at line 669 of file Diagnostic.h.
Referenced by clang::Sema::CodeSynthesisContext::isInstantiationRecord().
|
inline |
Definition at line 437 of file Diagnostic.h.
Referenced by clang::Diagnostic::hasSourceManager().
|
inline |
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror.
Definition at line 666 of file Diagnostic.h.
Referenced by clang::PCHGenerator::HandleTranslationUnit(), clang::Sema::CodeSynthesisContext::isInstantiationRecord(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::ASTUnit::serialize().
|
inline |
Determine whether any kind of unrecoverable error has occurred.
Definition at line 672 of file Diagnostic.h.
Referenced by clang::arcmt::TransformActions::hasReportedErrors().
|
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 611 of file Diagnostic.h.
Referenced by clang::ExtensionRAIIObject::ExtensionRAIIObject().
|
inline |
Determine whethere there is already a diagnostic in flight.
Definition at line 767 of file Diagnostic.h.
Referenced by clang::SrcMgr::ContentCache::getBuffer().
|
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
.
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 734 of file Diagnostic.h.
References clang::diag::Ignored.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), CheckCommaOperands(), CheckConditionalOperator(), CheckCXX98CompatAccessibleCopy(), checkNullabilityConsistency(), DiagnoseBadFunctionCast(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseCallingConvCast(), DiagnoseForRangeVariableCopies(), DiagnoseMismatchedNewDelete(), clang::Sema::DiagnoseMultipleMethodInGlobalPool(), DiagnoseNullConversion(), isEnabled(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::HeaderSearch::LookupFile(), LookupMemberExpr(), LookupMethodInReceiverType(), maybeDiagnoseIDCharCompat(), ParseAlignPragma(), clang::Lexer::ReadToEndOfLine(), and shouldWarnIfShadowedDecl().
|
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 592 of file Diagnostic.h.
References clang::DiagnosticIDs::Ignored.
|
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 714 of file Diagnostic.h.
Referenced by clang::ASTImporter::FromDiag(), and clang::ASTImporter::ToDiag().
|
delete |
|
inline |
Determine whether this DiagnosticsEngine
object own its client.
Definition at line 431 of file Diagnostic.h.
Referenced by SetUpDiagnosticLog(), SetupSerializedDiagnostics(), and clang::VerifyDiagnosticConsumer::~VerifyDiagnosticConsumer().
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.
true
if the pop happens, false
if there is only one DiagMapping on the stack. Definition at line 101 of file Diagnostic.cpp.
Referenced by clang::Preprocessor::LexOnOffSwitch().
void DiagnosticsEngine::pushMappings | ( | SourceLocation | Loc | ) |
Copies the current DiagMappings and pushes the new copy onto the top of the stack.
Definition at line 97 of file Diagnostic.cpp.
Referenced by clang::Preprocessor::LexOnOffSwitch().
|
inline |
Issue the message to the client.
This actually returns an instance of DiagnosticBuilder which emits the diagnostics (through ProcessDiag
) when it is destroyed.
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 1207 of file Diagnostic.h.
Referenced by clang::AttachHeaderIncludeGen(), clang::driver::Driver::BuildCompilation(), checkDiagnosticGroupMappings(), checkDiagnosticMappings(), checkHeaderSearchOptions(), checkLanguageOptions(), clang::Preprocessor::checkModuleIsAvailable(), checkMSVCHeaderSearch(), checkTargetOptions(), checkVerifyPrefixes(), clang::CompilerInstance::clearOutputFiles(), collectModuleHeaderIncludes(), compileAndLoadModule(), clang::GeneratePCHAction::ComputeASTConsumerArguments(), computeKeyFunction(), clang::PTHManager::Create(), clang::DependencyFileGenerator::CreateAndAttachToPreprocessor(), clang::CodeGenAction::CreateASTConsumer(), clang::ento::createCheckerManager(), clang::CompilerInstance::createCodeCompletionConsumer(), clang::TestModuleFileExtension::createExtensionReader(), clang::CompilerInvocation::CreateFromArgs(), clang::CompilerInstance::createOutputFile(), clang::TargetInfo::CreateTargetInfo(), Diag(), clang::driver::Driver::Diag(), clang::Parser::Diag(), clang::Sema::Diag(), clang::Preprocessor::Diag(), clang::ModuleMap::diagnoseHeaderInclusion(), diagnosePrivateModules(), 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(), clang::tooling::getCC1Arguments(), getCodeModel(), getInputBufferForModule(), clang::getLastArgIntValueImpl(), getRelocModel(), clang::targets::ARMTargetInfo::handleTargetFeatures(), clang::targets::X86TargetInfo::handleTargetFeatures(), clang::Rewriter::IncreaseIndentation(), InitializeFileRemapping(), InvalidPTH(), clang::CodeGen::CodeGenModule::isTypeConstant(), clang::CompilerInstance::loadModule(), clang::CompilerInstance::loadModuleFromSource(), mapToLevel(), maybeDiagnoseIDCharCompat(), maybeDiagnoseUTF8Homoglyph(), clang::driver::Driver::ParseArgStrings(), ParseCodeGenArgs(), parseDiagnosticLevelMask(), ParseFrontendArgs(), ParseLangArgs(), ParsePreprocessorArgs(), ParseTargetArgs(), parseVisibility(), ppcUserFeaturesCheck(), prepareToBuildModule(), PrintExpected(), clang::Sema::PrintInstantiationStack(), clang::Sema::PrintPragmaAttributeInstantiationPoint(), clang::ProcessWarningOptions(), clang::arcmt::TransformActions::report(), reportDiag(), clang::CodeGen::InstrProfStats::reportDiagnostics(), rewriteToNumericBoxedExpression(), setCommandLineOpts(), SetDelayedDiagnostic(), SetUpDiagnosticLog(), clang::StringLiteralParser::StringLiteralParser(), clang::ASTImporter::ToDiag(), clang::ento::CheckerRegistry::validateCheckerOptions(), clang::targets::MipsTargetInfo::validateTarget(), and Write_RethrowObject().
|
inline |
Definition at line 1216 of file Diagnostic.h.
void DiagnosticsEngine::Report | ( | const StoredDiagnostic & | storedDiag | ) |
Definition at line 375 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(), clang::StoredDiagnostic::range_begin(), clang::StoredDiagnostic::range_end(), and Warning.
void DiagnosticsEngine::Reset | ( | ) |
Reset the state of the diagnostic object to its initial configuration.
Definition at line 113 of file Diagnostic.cpp.
References clang::DiagnosticIDs::Ignored.
Referenced by clang::FixItRecompile::BeginInvocation(), clang::PrecompiledPreamble::Build(), DiagnosticsEngine(), makeStandaloneDiagnostic(), and clang::ASTUnit::Reparse().
|
inline |
Definition at line 707 of file Diagnostic.h.
Referenced by clang::ASTMergeAction::ExecuteAction().
void DiagnosticsEngine::setClient | ( | DiagnosticConsumer * | client, |
bool | ShouldOwnClient = true |
||
) |
Set the diagnostic client associated with this diagnostic object.
ShouldOwnClient | true if the diagnostic object should take ownership of client . |
Definition at line 91 of file Diagnostic.cpp.
Referenced by DiagnosticsEngine(), clang::FixItRewriter::FixItRewriter(), SetUpDiagnosticLog(), SetupSerializedDiagnostics(), ~DiagnosticsEngine(), and clang::FixItRewriter::~FixItRewriter().
|
inline |
Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic.
Definition at line 490 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
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.
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 139 of file Diagnostic.cpp.
References clang::SourceManager::getDecomposedIncludedLoc(), clang::SourceManager::getDecomposedLoc(), clang::FileID::isValid(), clang::SourceLocation::isValid(), clang::Last, P, Report(), and State.
Referenced by clang::SrcMgr::ContentCache::getBuffer(), and clang::DiagnosticIDs::getNearestOption().
Set the error-as-fatal flag for the given diagnostic group.
This function always only operates on the current diagnostic state.
Definition at line 332 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().
Set the warning-as-error flag for the given diagnostic group.
This function always only operates on the current diagnostic state.
Definition at line 301 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().
Set type eliding, to skip outputting same types occurring in template types.
Definition at line 555 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
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 514 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
Specify a limit for the number of errors we should emit before giving up.
Zero disables the limit.
Definition at line 474 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
When set to true, any error reported is made a fatal error.
Definition at line 530 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
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 600 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
When set to true, any unmapped warnings are ignored.
If this and WarningsAsErrors are both set, then this one wins.
Definition at line 503 of file Diagnostic.h.
Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::MigrateSourceAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), clang::arcmt::ObjCMigrateAction::BeginInvocation(), clang::driver::Driver::BuildCompilation(), and clang::ProcessWarningOptions().
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 583 of file Diagnostic.h.
References clang::DiagnosticIDs::Fatal, clang::driver::options::Ignored, clang::DiagnosticIDs::Ignored, and clang::DiagnosticIDs::Warning.
Referenced by clang::Sema::EmitCurrentDiagnostic(), and clang::Sema::SFINAETrap::~SFINAETrap().
|
inline |
Definition at line 678 of file Diagnostic.h.
Referenced by makeStandaloneDiagnostic(), and clang::ASTUnit::Reparse().
Set tree printing, to outputting the template difference in a tree format.
Definition at line 560 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
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.
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 245 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 clang::Sema::CheckObjCMethodOverride(), ParseAlignPragma(), setSeverityForAll(), and setSeverityForGroup().
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 362 of file Diagnostic.cpp.
References Diag(), clang::DiagnosticIDs::getAllDiagnostics(), and setSeverity().
Referenced by clang::Preprocessor::LexOnOffSwitch(), and clang::ProcessWarningOptions().
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.
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 286 of file Diagnostic.cpp.
References Diag(), and setSeverity().
Referenced by clang::Preprocessor::LexOnOffSwitch(), clang::ProcessWarningOptions(), setDiagnosticGroupErrorAsFatal(), and setDiagnosticGroupWarningAsError().
Set color printing, so the type diffing will inject color markers into the output.
Definition at line 565 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
Specify which overload candidates to show when overload resolution fails.
By default, we show all candidates.
Definition at line 572 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
Definition at line 442 of file Diagnostic.h.
Referenced by clang::SourceManager::SourceManager().
|
inline |
When set to true (the default), suppress further diagnostics after a fatal error.
Definition at line 535 of file Diagnostic.h.
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 548 of file Diagnostic.h.
Referenced by BuildCounterUpdate().
|
inline |
When set to true mask warnings that come from system headers.
Definition at line 538 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
Specify the maximum number of template instantiation notes to emit along with a given diagnostic.
Definition at line 478 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
|
inline |
When set to true, any warnings reported are issued as errors.
Definition at line 522 of file Diagnostic.h.
Referenced by clang::ento::CreateAnalysisConsumer(), and clang::ProcessWarningOptions().
|
inline |
Return the current diagnostic client along with ownership of that client.
Definition at line 435 of file Diagnostic.h.
Referenced by clang::FixItRewriter::FixItRewriter(), SetUpDiagnosticLog(), and SetupSerializedDiagnostics().
|
friend |
Definition at line 904 of file Diagnostic.h.
|
friend |
Definition at line 905 of file Diagnostic.h.
|
friend |
Definition at line 811 of file Diagnostic.h.
|
friend |
Definition at line 810 of file Diagnostic.h.
|
friend |
Definition at line 813 of file Diagnostic.h.
|
friend |
Definition at line 809 of file Diagnostic.h.
|
friend |
Definition at line 812 of file Diagnostic.h.
|
friend |
Definition at line 891 of file Diagnostic.h.