clang 24.0.0git
clang::APINotesSelectorDiagnosticReaderState Struct Reference

Tracks exact Where.Parameters selectors from one API notes reader. More...

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Sema/SemaAPINotesInternal.h"

Public Member Functions

void addSelector (const api_notes::APINotesFunctionSelectorKey &Key)
void addSelectors (llvm::ArrayRef< api_notes::APINotesFunctionSelectorKey > Selectors)
void noteSeenDeclaration (const api_notes::APINotesFunctionSelectorKey &Key, llvm::StringRef Name, SourceLocation Loc)
void markUsed (const api_notes::APINotesFunctionSelectorKey &Key)
void markCandidatesUsed (llvm::function_ref< std::optional< api_notes::APINotesFunctionSelectorKey >(llvm::ArrayRef< std::string >)> GetSelectorKey, const APINotesParameterSelectorCandidates &Candidates)
void diagnoseUnused (Sema &S, api_notes::APINotesReader &Reader) const

Public Attributes

llvm::DenseMap< api_notes::APINotesFunctionSelectorKey, boolSelectorUsed
 Exact Where.Parameters selector keys stored by API notes.
llvm::DenseMap< api_notes::APINotesFunctionSelectorKey, APINotesSelectorDiagnosticNameSeenNames
 Maps broad/name-only keys to a declaration location/name used for diagnostics.

Detailed Description

Tracks exact Where.Parameters selectors from one API notes reader.

Sema marks selectors as used when a visible declaration matches them. It also records broad/name-only declarations seen in the translation unit, so end-of-TU diagnostics can warn about exact selectors for known names that were never matched.

Definition at line 41 of file SemaAPINotesInternal.h.

Member Function Documentation

◆ addSelector()

void clang::APINotesSelectorDiagnosticReaderState::addSelector ( const api_notes::APINotesFunctionSelectorKey & Key)
inline

Definition at line 52 of file SemaAPINotesInternal.h.

References SelectorUsed.

Referenced by addSelectors().

◆ addSelectors()

void clang::APINotesSelectorDiagnosticReaderState::addSelectors ( llvm::ArrayRef< api_notes::APINotesFunctionSelectorKey > Selectors)
inline

Definition at line 56 of file SemaAPINotesInternal.h.

References addSelector(), SeenNames, and SelectorUsed.

◆ diagnoseUnused()

◆ markCandidatesUsed()

void APINotesSelectorDiagnosticReaderState::markCandidatesUsed ( llvm::function_ref< std::optional< api_notes::APINotesFunctionSelectorKey >(llvm::ArrayRef< std::string >)> GetSelectorKey,
const APINotesParameterSelectorCandidates & Candidates )

◆ markUsed()

void clang::APINotesSelectorDiagnosticReaderState::markUsed ( const api_notes::APINotesFunctionSelectorKey & Key)
inline

Definition at line 69 of file SemaAPINotesInternal.h.

References SelectorUsed.

Referenced by markCandidatesUsed().

◆ noteSeenDeclaration()

void clang::APINotesSelectorDiagnosticReaderState::noteSeenDeclaration ( const api_notes::APINotesFunctionSelectorKey & Key,
llvm::StringRef Name,
SourceLocation Loc )
inline

Member Data Documentation

◆ SeenNames

llvm::DenseMap<api_notes::APINotesFunctionSelectorKey, APINotesSelectorDiagnosticName> clang::APINotesSelectorDiagnosticReaderState::SeenNames

Maps broad/name-only keys to a declaration location/name used for diagnostics.

Definition at line 50 of file SemaAPINotesInternal.h.

Referenced by addSelectors(), diagnoseUnused(), and noteSeenDeclaration().

◆ SelectorUsed

llvm::DenseMap<api_notes::APINotesFunctionSelectorKey, bool> clang::APINotesSelectorDiagnosticReaderState::SelectorUsed

Exact Where.Parameters selector keys stored by API notes.

The bool is true once Sema sees a declaration matching the exact selector.

Definition at line 44 of file SemaAPINotesInternal.h.

Referenced by addSelector(), addSelectors(), diagnoseUnused(), and markUsed().


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