clang: clang::DiagnosticsEngine Class Reference (original) (raw)
Concrete class used by the front-end to report problems and issues. More...
#include "[clang/Basic/Diagnostic.h](Basic%5F2Diagnostic%5F8h%5Fsource.html)"
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_addrspace, 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. | |
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. | |
diag_mapping_range | getDiagnosticMappings () const |
Get the current set of diagnostic mappings. | |
DiagnosticConsumer * | getClient () |
const DiagnosticConsumer * | getClient () const |
bool | ownsClient () const |
Determine whether this DiagnosticsEngine object own its client. | |
std::unique_ptr< DiagnosticConsumer > | takeClient () |
Return the current diagnostic client along with ownership of that client. | |
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. | |
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. | |
void | setClient (DiagnosticConsumer *client, bool ShouldOwnClient=true) |
Set the diagnostic client associated with this diagnostic object. | |
void | setErrorLimit (unsigned Limit) |
Specify a limit for the number of errors we should emit before giving up. | |
void | setTemplateBacktraceLimit (unsigned Limit) |
Specify the maximum number of template instantiation notes to emit along with a given diagnostic. | |
unsigned | getTemplateBacktraceLimit () const |
Retrieve the maximum number of template instantiation notes to emit along with a given diagnostic. | |
void | setConstexprBacktraceLimit (unsigned Limit) |
Specify the maximum number of constexpr evaluation notes to emit along with a given diagnostic. | |
unsigned | getConstexprBacktraceLimit () const |
Retrieve the maximum number of constexpr evaluation notes to emit along with a given diagnostic. | |
void | setIgnoreAllWarnings (bool Val) |
When set to true, any unmapped warnings are ignored. | |
bool | getIgnoreAllWarnings () const |
void | setEnableAllWarnings (bool Val) |
When set to true, any unmapped ignored warnings are no longer ignored. | |
bool | getEnableAllWarnings () const |
void | setWarningsAsErrors (bool Val) |
When set to true, any warnings reported are issued as errors. | |
bool | getWarningsAsErrors () const |
void | setErrorsAsFatal (bool Val) |
When set to true, any error reported is made a fatal error. | |
bool | getErrorsAsFatal () const |
void | setFatalsAsError (bool Val) |
When set to true, any fatal error reported is made an error. | |
bool | getFatalsAsError () const |
void | setSuppressSystemWarnings (bool Val) |
When set to true mask warnings that come from system headers. | |
bool | getSuppressSystemWarnings () const |
void | setSuppressAllDiagnostics (bool Val) |
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. | |
bool | getSuppressAllDiagnostics () const |
void | setElideType (bool Val) |
Set type eliding, to skip outputting same types occurring in template types. | |
bool | getElideType () |
void | setPrintTemplateTree (bool Val) |
Set tree printing, to outputting the template difference in a tree format. | |
bool | getPrintTemplateTree () |
void | setShowColors (bool Val) |
Set color printing, so the type diffing will inject color markers into the output. | |
bool | getShowColors () |
void | setShowOverloads (OverloadsShown Val) |
Specify which overload candidates to show when overload resolution fails. | |
OverloadsShown | getShowOverloads () const |
unsigned | getNumOverloadCandidatesToShow () const |
When a call or operator fails, print out up to this many candidate overloads as suggestions. | |
void | overloadCandidatesShown (unsigned N) |
Call this after showing N overload candidates. | |
void | setLastDiagnosticIgnored (bool Ignored) |
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. | |
bool | isLastDiagnosticIgnored () const |
Determine whether the previous diagnostic was ignored. | |
void | setExtensionHandlingBehavior (diag::Severity H) |
Controls whether otherwise-unmapped extension diagnostics are mapped onto ignore/warning/error. | |
diag::Severity | getExtensionHandlingBehavior () const |
void | IncrementAllExtensionsSilenced () |
Counter bumped when an extension block is/ encountered. | |
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. | |
bool | setSeverityForGroup (diag::Flavor Flavor, StringRef Group, diag::Severity Map, SourceLocation Loc=SourceLocation()) |
Change an entire diagnostic group (e.g. | |
bool | setSeverityForGroup (diag::Flavor Flavor, diag::Group Group, diag::Severity Map, SourceLocation Loc=SourceLocation()) |
bool | setDiagnosticGroupWarningAsError (StringRef Group, bool Enabled) |
Set the warning-as-error flag for the given diagnostic group. | |
bool | setDiagnosticGroupErrorAsFatal (StringRef Group, bool Enabled) |
Set the error-as-fatal flag for the given diagnostic group. | |
void | setSeverityForAll (diag::Flavor Flavor, diag::Severity Map, SourceLocation Loc=SourceLocation()) |
Add the specified mapping to all diagnostics of the specified flavor. | |
bool | hasErrorOccurred () const |
bool | hasUncompilableErrorOccurred () const |
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror. | |
bool | hasFatalErrorOccurred () const |
bool | hasUnrecoverableErrorOccurred () const |
Determine whether any kind of unrecoverable error has occurred. | |
unsigned | getNumErrors () const |
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. | |
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. | |
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. | |
void | Reset (bool soft=false) |
Reset the state of the diagnostic object to its initial configuration. | |
bool | isIgnored (unsigned DiagID, SourceLocation Loc) const |
Determine whether the diagnostic is known to be ignored. | |
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. | |
void | setDiagSuppressionMapping (llvm::MemoryBuffer &Input) |
Diagnostic suppression mappings can be used to suppress specific diagnostics in specific files. | |
bool | isSuppressedViaMapping (diag::kind DiagId, SourceLocation DiagLoc) const |
DiagnosticBuilder | Report (SourceLocation Loc, unsigned DiagID) |
Issue the message to the client. | |
DiagnosticBuilder | Report (unsigned DiagID) |
void | Report (const StoredDiagnostic &storedDiag) |
Friends | |
---|---|
class | Diagnostic |
class | DiagnosticBuilder |
class | DiagnosticErrorTrap |
class | DiagnosticIDs |
class | PartialDiagnostic |
void | DiagnosticsTestHelper (DiagnosticsEngine &) |
Diagnostic Emission | |
---|---|
class | ASTReader |
class | ASTWriter |
class | Sema |
bool | EmitDiagnostic (const DiagnosticBuilder &DB, bool Force=false) |
Emit the diagnostic. | |
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 231 of file Diagnostic.h.
◆ ArgumentValue
Represents on argument value, which is a union discriminated by ArgumentKind, with a value.
Definition at line 292 of file Diagnostic.h.
◆ diag_mapping_range
◆ ArgumentKind
◆ Level
The level of the diagnostic, after it has been through mapping.
Enumerator |
---|
Ignored |
Note |
Remark |
Warning |
Error |
Fatal |
Definition at line 234 of file Diagnostic.h.
◆ DiagnosticsEngine() [2/2]
◆ ~DiagnosticsEngine()
DiagnosticsEngine::~DiagnosticsEngine | ( | ) |
---|
◆ ConvertArgToString()
◆ DecrementAllExtensionsSilenced()
void clang::DiagnosticsEngine::DecrementAllExtensionsSilenced ( ) | inline |
---|
◆ dump() [1/2]
void DiagnosticsEngine::dump | ( | ) | const |
---|
◆ dump() [2/2]
void DiagnosticsEngine::dump | ( | StringRef | DiagName | ) | const |
---|
◆ EmitDiagnostic()
◆ getClient() [1/2]
Definition at line 595 of file Diagnostic.h.
Referenced by clang::arcmt::CheckAction::BeginInvocation(), clang::arcmt::ModifyAction::BeginInvocation(), clang::arcmt::MigrateAction::BeginInvocation(), createAndRunToolInvocation(), clang::installapi::InstallAPIAction::CreateASTConsumer(), EmitDiagnostic(), clang::ASTUnit::enableSourceFileDiagnostics(), clang::ASTMergeAction::ExecuteAction(), clang::CompilerInstance::ExecuteAction(), clang::FixItRewriter::FixItRewriter(), clang::PCHGenerator::HandleTranslationUnit(), clang::CompilerInstance::printDiagnosticStats(), SetUpDiagnosticLog(), SetupSerializedDiagnostics(), and clang::ASTUnit::~ASTUnit().
◆ getClient() [2/2]
◆ 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 666 of file Diagnostic.h.
◆ getCustomDiagID()
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 896 of file Diagnostic.h.
Referenced by clang::driver::tools::Flang::ConstructJob(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), clang::EmbedObject(), emitAArch64DeclareSimdFunction(), clang::emitBackendOutput(), emitCommonOMPTargetDirective(), clang::CodeGen::CodeGenModule::Error(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::CGCXXABI::ErrorUnsupportedABI(), clang::TextDiagnosticBuffer::FlushDiagnostics(), clang::driver::toolchains::HIPAMDToolChain::getDeviceLibs(), getObjCEncodingForPrimitiveType(), getUnionInitName(), rewriteToNumericBoxedExpression(), setPGOUseInstrumentor(), clang::CodeGen::CodeGenModule::stopAutoInit(), and clang::driver::ToolChain::TranslateXarchArgs().
◆ getDiagnosticIDs()
◆ getDiagnosticLevel()
◆ getDiagnosticMappings()
Get the current set of diagnostic mappings.
Definition at line 590 of file Diagnostic.h.
◆ getDiagnosticOptions()
◆ getElideType()
bool clang::DiagnosticsEngine::getElideType ( ) | inline |
---|
◆ getEnableAllWarnings()
bool clang::DiagnosticsEngine::getEnableAllWarnings ( ) const | inline |
---|
◆ getErrorsAsFatal()
bool clang::DiagnosticsEngine::getErrorsAsFatal ( ) const | inline |
---|
◆ getExtensionHandlingBehavior()
diag::Severity clang::DiagnosticsEngine::getExtensionHandlingBehavior ( ) const | inline |
---|
◆ getFatalsAsError()
bool clang::DiagnosticsEngine::getFatalsAsError ( ) const | inline |
---|
◆ getIgnoreAllWarnings()
bool clang::DiagnosticsEngine::getIgnoreAllWarnings ( ) const | inline |
---|
◆ getNumErrors()
unsigned clang::DiagnosticsEngine::getNumErrors ( ) const | inline |
---|
◆ getNumOverloadCandidatesToShow()
unsigned clang::DiagnosticsEngine::getNumOverloadCandidatesToShow ( ) const | inline |
---|
◆ getNumWarnings()
unsigned clang::DiagnosticsEngine::getNumWarnings ( ) const | inline |
---|
◆ getPrintTemplateTree()
bool clang::DiagnosticsEngine::getPrintTemplateTree ( ) | inline |
---|
◆ getShowColors()
bool clang::DiagnosticsEngine::getShowColors ( ) | inline |
---|
◆ getShowOverloads()
OverloadsShown clang::DiagnosticsEngine::getShowOverloads ( ) const | inline |
---|
◆ getSourceManager()
SourceManager & clang::DiagnosticsEngine::getSourceManager ( ) const | inline |
---|
◆ getSuppressAllDiagnostics()
bool clang::DiagnosticsEngine::getSuppressAllDiagnostics ( ) const | inline |
---|
◆ getSuppressSystemWarnings()
bool clang::DiagnosticsEngine::getSuppressSystemWarnings ( ) const | inline |
---|
◆ getTemplateBacktraceLimit()
unsigned clang::DiagnosticsEngine::getTemplateBacktraceLimit ( ) const | inline |
---|
◆ getWarningsAsErrors()
bool clang::DiagnosticsEngine::getWarningsAsErrors ( ) const | inline |
---|
◆ hasAllExtensionsSilenced()
bool clang::DiagnosticsEngine::hasAllExtensionsSilenced ( ) | inline |
---|
◆ hasErrorOccurred()
bool clang::DiagnosticsEngine::hasErrorOccurred ( ) const | inline |
---|
◆ hasFatalErrorOccurred()
bool clang::DiagnosticsEngine::hasFatalErrorOccurred ( ) const | inline |
---|
◆ hasSourceManager()
bool clang::DiagnosticsEngine::hasSourceManager ( ) const | inline |
---|
◆ 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 870 of file Diagnostic.h.
◆ hasUnrecoverableErrorOccurred()
bool clang::DiagnosticsEngine::hasUnrecoverableErrorOccurred ( ) const | inline |
---|
◆ IncrementAllExtensionsSilenced()
void clang::DiagnosticsEngine::IncrementAllExtensionsSilenced ( ) | inline |
---|
◆ isIgnored()
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 939 of file Diagnostic.h.
References clang::diag::Ignored, and Loc.
Referenced by clang::Sema::ActOnCompoundStmt(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnDocumentableDecls(), clang::Sema::ActOnDoStmt(), clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnForStmt(), clang::Sema::ActOnIfStmt(), clang::Sema::ActOnWhileStmt(), clang::Sema::AddInitializerToDecl(), applyCocoaAPICheck(), clang::driver::Driver::BuildCompilation(), clang::Sema::BuildDeclRefExpr(), clang::SemaObjC::BuildIvarRefExpr(), clang::Sema::BuildResolvedCallExpr(), clang::sema::checkAssignmentLifetime(), clang::Sema::CheckAssignmentOperands(), clang::sema::checkCaptureByLifetime(), CheckCommaOperands(), clang::Sema::CheckCompatibleReinterpretCast(), CheckConditionalOperator(), CheckConstexprFunctionBody(), CheckCXX98CompatAccessibleCopy(), CheckForDuplicateEnumValues(), checkNullabilityConsistency(), checkPointerTypesForAssignment(), CheckProtocolMethodDefs(), clang::Sema::CheckShadow(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::DiagnoseAbsenceOfOverrideControl(), clang::Sema::DiagnoseAssignmentEnum(), DiagnoseBaseOrMemInitializerOrder(), clang::Sema::DiagnoseEmptyLoopBody(), DiagnoseForRangeVariableCopies(), clang::Sema::DiagnoseHiddenVirtualMethods(), DiagnoseMismatchedSelectors(), clang::SemaObjC::DiagnoseMultipleMethodInGlobalPool(), DiagnoseNullConversion(), clang::Sema::DiagnoseSelfMove(), diagnoseTautologicalComparison(), clang::Sema::diagnoseZeroToNullptrConversion(), clang::Sema::EvaluateStaticAssertMessageAsString(), EvaluateValue(), handleFormatSignedness(), clang::Sema::isAcceptableTagRedeclaration(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::HeaderSearch::LookupFile(), LookupMemberExpr(), maybeDiagnoseIDCharCompat(), clang::sema::shouldRunGSLAssignmentAnalysis(), and shouldWarnIfShadowedDecl().
◆ isLastDiagnosticIgnored()
bool clang::DiagnosticsEngine::isLastDiagnosticIgnored ( ) const | inline |
---|
◆ isSuppressedViaMapping()
◆ notePriorDiagnosticFrom()
void clang::DiagnosticsEngine::notePriorDiagnosticFrom ( const DiagnosticsEngine & Other) | inline |
---|
◆ operator=()
◆ overloadCandidatesShown()
void clang::DiagnosticsEngine::overloadCandidatesShown ( unsigned N) | inline |
---|
◆ ownsClient()
bool clang::DiagnosticsEngine::ownsClient ( ) const | inline |
---|
◆ popMappings()
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 115 of file Diagnostic.cpp.
References Loc.
◆ pushMappings()
Copies the current DiagMappings and pushes the new copy onto the top of the stack.
Definition at line 111 of file Diagnostic.cpp.
◆ Report() [1/3]
Definition at line 631 of file Diagnostic.cpp.
References clang::DiagnosticStorage::DiagRanges, clang::StoredDiagnostic::fixit_begin(), clang::StoredDiagnostic::fixit_end(), clang::DiagnosticStorage::FixItHints, 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.
◆ Report() [2/3]
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 1493 of file Diagnostic.h.
References DiagnosticBuilder, and Loc.
Referenced by clang::Sema::ActOnIfStmt(), clang::TargetInfo::adjust(), clang::ASTReader::ASTReader(), clang::AttachHeaderIncludeGen(), clang::FrontendAction::BeginSourceFile(), clang::driver::Driver::BuildCompilation(), checkAliasedGlobal(), checkAliasForTocData(), CheckAtomicAlignment(), clang::TargetInfo::checkCFBranchLabelSchemeSupported(), clang::TargetInfo::checkCFProtectionBranchSupported(), clang::TargetInfo::checkCFProtectionReturnSupported(), checkDiagnosticGroupMappings(), checkDiagnosticMappings(), clang::ento::CheckerRegistry::CheckerRegistry(), checkLanguageOptions(), checkModuleCachePath(), clang::Preprocessor::checkModuleIsAvailable(), checkMSVCHeaderSearch(), checkPreprocessorOptions(), checkPrivateAPINotesName(), checkTargetOptions(), checkVerifyPrefixes(), clang::CompilerInstance::clearOutputFiles(), compileModuleAndReadASTBehindLock(), compileModuleAndReadASTImpl(), clang::CXXRecordDecl::completeDefinition(), clang::GeneratePCHAction::ComputeASTConsumerArguments(), clang::driver::tools::Flang::ConstructJob(), clang::TestModuleFileExtension::createExtensionReader(), clang::CreateFrontendAction(), clang::CreateFrontendBaseAction(), clang::CompilerInstance::createModuleFromSource(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), clang::CompilerInstance::createOutputFile(), clang::CompilerInstance::createTarget(), clang::TargetInfo::CreateTargetInfo(), clang::createVFSFromOverlayFiles(), DefineBuiltinMacro(), Diag(), clang::Parser::Diag(), clang::FixItRewriter::Diag(), clang::Preprocessor::Diag(), clang::ASTReader::Diag(), clang::driver::Driver::Diag(), clang::StructuralEquivalenceContext::Diag1(), clang::StructuralEquivalenceContext::Diag2(), diagnoseExtensionInIdentifier(), clang::OpenCLOptions::diagnoseFeatureExtensionDifferences(), diagnoseFrameworkInclude(), clang::ModuleMap::diagnoseHeaderInclusion(), diagnoseIfNeedsFPReg(), diagnoseInvalidUnicodeCodepointInIdentifier(), diagnoseSubMismatchMethodParameters(), clang::OpenCLOptions::diagnoseUnsupportedFeatureDependencies(), clang::BackendConsumer::DiagnosticHandlerImpl(), clang::BackendConsumer::DontCallDiagHandler(), clang::EmbedObject(), emitAArch64DeclareSimdFunction(), EmitAsmStores(), clang::emitBackendOutput(), emitCallStackNotes(), emitCommonOMPTargetDirective(), clang::cross_tu::CrossTranslationUnitContext::emitCrossTUDiagnostics(), clang::installapi::DylibVerifier::VerifierContext::emitDiag(), clang::BackendConsumer::EmitOptimizationMessage(), clang::PartialDiagnostic::EmitToString(), EmitUnknownDiagWarning(), EnableCodeCompletion(), clang::CodeGen::CodeGenModule::Error(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::CGCXXABI::ErrorUnsupportedABI(), clang::DumpModuleInfoAction::ExecuteAction(), clang::CompilerInstance::ExecuteAction(), clang::VerifyDiagnosticConsumer::MarkerTracker::finalize(), FixupInvocation(), clang::TextDiagnosticBuffer::FlushDiagnostics(), forEachDriverJob(), clang::ASTImporter::FromDiag(), clang::BackendConsumer::getBestLocationFromDebugLoc(), clang::tooling::getCC1Arguments(), getInputBufferForModule(), getObjCEncodingForPrimitiveType(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::ASTReader::getOriginalSourceFile(), getPrivateModuleMap(), getUnionInitName(), clang::SourceMgrAdapter::handleDiag(), clang::interp::handleFixedPointOverflow(), clang::targets::ARMTargetInfo::handleTargetFeatures(), clang::targets::RISCVTargetInfo::handleTargetFeatures(), clang::targets::X86TargetInfo::handleTargetFeatures(), clang::CXX20ModulesGenerator::HandleTranslationUnit(), clang::targets::PPCTargetInfo::initFeatureMap(), clang::targets::RISCVTargetInfo::initFeatureMap(), clang::targets::X86TargetInfo::initFeatureMap(), clang::TargetInfo::initFeatureMap(), clang::targets::AMDGPUTargetInfo::initFeatureMap(), InitializeFileRemapping(), clang::CompilerInstance::InitializeSourceManager(), initOption(), initTargetOptions(), clang::BackendConsumer::InlineAsmDiagHandler(), insertAndValidate(), isOptionContainedIn(), clang::CompilerInstance::loadModule(), clang::CompilerInstance::loadModuleFile(), clang::CompilerInstance::LoadRequestedPlugins(), clang::HeaderSearch::lookupModuleMapFile(), maybeDiagnoseIDCharCompat(), maybeDiagnoseUTF8Homoglyph(), clang::driver::Driver::maybeGenerateCompilationDiagnostics(), clang::RecordDecl::mayInsertExtraPadding(), clang::BackendConsumer::MisExpectDiagHandler(), normalizeSimpleEnum(), normalizeStringIntegral(), clang::NumericLiteralParser::NumericLiteralParser(), ParseAnalyzerArgs(), parseAnalyzerConfigs(), ParseAPINotesArgs(), clang::driver::Driver::ParseArgStrings(), ParseDependencyOutputArgs(), parseDiagnosticLevelMask(), ParseDirective(), ParseFrontendArgs(), clang::ModuleMapParser::parseModuleMapFile(), ParseOptimizationRemark(), ParsePreprocessorArgs(), parseSanitizerKinds(), parseSanitizerWeightedKinds(), ParseTargetArgs(), ppcUserFeaturesCheck(), prepareToBuildModule(), PrintExpected(), clang::Sema::PrintInstantiationStack(), clang::Sema::PrintPragmaAttributeInstantiationPoint(), PrintUnexpected(), clang::ProcessWarningOptions(), readASTAfterCompileModule(), clang::CodeGen::CodeGenModule::Release(), clang::arcmt::TransformActions::report(), clang::arcmt::CapturedDiagList::reportDiagnostics(), clang::CodeGen::InstrProfStats::reportDiagnostics(), clang::ento::CheckerManager::reportInvalidCheckerOptionValue(), clang::reportOptRecordError(), clang::BackendConsumer::ResourceLimitDiagHandler(), rewriteToNumericBoxedExpression(), RoundTrip(), selectBestPath(), clang::CodeGen::CodeGenModule::setGlobalVisibility(), setPGOUseInstrumentor(), SetUpDiagnosticLog(), clang::BackendConsumer::SrcMgrDiagHandler(), clang::BackendConsumer::StackSizeDiagHandler(), clang::CodeGen::CodeGenModule::stopAutoInit(), clang::ASTImporter::ToDiag(), clang::BackendConsumer::UnsupportedDiagHandler(), clang::ento::CheckerRegistry::validateCheckerOptions(), clang::TargetInfo::validateOpenCLTarget(), clang::targets::AArch64TargetInfo::validateTarget(), clang::targets::MipsTargetInfo::validateTarget(), clang::installapi::DylibVerifier::verifyBinaryAttrs(), and clang::FixItRewriter::WriteFixedFiles().
◆ Report() [3/3]
◆ Reset()
void DiagnosticsEngine::Reset | ( | bool | soft = false | ) |
---|
◆ SetArgToStringFn()
void clang::DiagnosticsEngine::SetArgToStringFn ( ArgToStringFnTy Fn, void * Cookie ) | inline |
---|
◆ setClient()
◆ setConstexprBacktraceLimit()
void clang::DiagnosticsEngine::setConstexprBacktraceLimit ( unsigned Limit) | inline |
---|
◆ setDiagnosticGroupErrorAsFatal()
bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal | ( | StringRef | Group, |
---|---|---|---|
bool | Enabled | ||
) |
◆ setDiagnosticGroupWarningAsError()
bool DiagnosticsEngine::setDiagnosticGroupWarningAsError | ( | StringRef | Group, |
---|---|---|---|
bool | Enabled | ||
) |
◆ setDiagSuppressionMapping()
void DiagnosticsEngine::setDiagSuppressionMapping | ( | llvm::MemoryBuffer & | Input | ) |
---|
Diagnostic suppression mappings can be used to suppress specific diagnostics in specific files.
Mapping file is expected to be a special case list with sections denoting diagnostic groups and src
entries for globs to suppress. emit
category can be used to disable suppression. Longest glob that matches a filepath takes precedence. For example: [unused] src:clang/* src:clang/foo/*=emit src:clang/foo/bar/*
Such a mappings file suppress all diagnostics produced by -Wunused in all sources under clang/
directory apart from clang/foo/
. Diagnostics under clang/foo/bar/
will also be suppressed. Note that the FilePath is matched against the globs as-is. These take presumed locations into account, and can still be overriden by clang-diagnostics pragmas.
Definition at line 564 of file Diagnostic.cpp.
References Error, clang::sema::Report, and SM.
Referenced by clang::ProcessWarningOptions().
◆ setElideType()
void clang::DiagnosticsEngine::setElideType ( bool Val) | inline |
---|
◆ 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 684 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
◆ setErrorLimit()
void clang::DiagnosticsEngine::setErrorLimit ( unsigned Limit) | inline |
---|
◆ setErrorsAsFatal()
void clang::DiagnosticsEngine::setErrorsAsFatal ( bool Val) | inline |
---|
◆ 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 801 of file Diagnostic.h.
Referenced by clang::ProcessWarningOptions().
◆ setFatalsAsError()
void clang::DiagnosticsEngine::setFatalsAsError ( bool Val) | inline |
---|
When set to true, any fatal error reported is made an error.
This setting takes precedence over the setErrorsAsFatal setting above.
Definition at line 706 of file Diagnostic.h.
◆ setIgnoreAllWarnings()
void clang::DiagnosticsEngine::setIgnoreAllWarnings ( bool Val) | inline |
---|
◆ setLastDiagnosticIgnored()
void clang::DiagnosticsEngine::setLastDiagnosticIgnored ( bool Ignored) | inline |
---|
◆ setNumWarnings()
void clang::DiagnosticsEngine::setNumWarnings ( unsigned NumWarnings) | inline |
---|
◆ setPrintTemplateTree()
void clang::DiagnosticsEngine::setPrintTemplateTree ( bool Val) | inline |
---|
◆ setSeverity()
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 344 of file Diagnostic.cpp.
References Diag(), clang::diag::DIAG_UPPER_LIMIT, clang::diag::Error, clang::diag::Fatal, clang::DiagnosticMapping::getSeverity(), clang::DiagnosticMapping::hasNoWarningAsError(), clang::SourceLocation::isInvalid(), clang::DiagnosticMapping::setNoWarningAsError(), clang::DiagnosticMapping::setUpgradedFromWarning(), and clang::diag::Warning.
Referenced by setSeverityForAll(), and setSeverityForGroup().
◆ setSeverityForAll()
◆ setSeverityForGroup() [1/2]
◆ setSeverityForGroup() [2/2]
◆ setShowColors()
void clang::DiagnosticsEngine::setShowColors ( bool Val) | inline |
---|
◆ setShowOverloads()
void clang::DiagnosticsEngine::setShowOverloads ( OverloadsShown Val) | inline |
---|
◆ setSourceManager()
void clang::DiagnosticsEngine::setSourceManager ( SourceManager * SrcMgr) | inline |
---|
◆ setSuppressAllDiagnostics()
void clang::DiagnosticsEngine::setSuppressAllDiagnostics ( bool Val) | inline |
---|
◆ setSuppressSystemWarnings()
void clang::DiagnosticsEngine::setSuppressSystemWarnings ( bool Val) | inline |
---|
◆ setTemplateBacktraceLimit()
void clang::DiagnosticsEngine::setTemplateBacktraceLimit ( unsigned Limit) | inline |
---|
◆ setWarningsAsErrors()
void clang::DiagnosticsEngine::setWarningsAsErrors ( bool Val) | inline |
---|
◆ takeClient()
◆ ASTReader
◆ ASTWriter
◆ Diagnostic
◆ DiagnosticBuilder
◆ DiagnosticErrorTrap
◆ DiagnosticIDs
◆ DiagnosticsTestHelper
◆ PartialDiagnostic
◆ Sema
The documentation for this class was generated from the following files:
- include/clang/Basic/Diagnostic.h
- lib/Basic/Diagnostic.cpp