clang API Documentation
An abstract interface that should be implemented by external AST sources that also provide information for semantic analysis. More...
#include <ExternalSemaSource.h>
Public Member Functions | |
ExternalSemaSource () | |
~ExternalSemaSource () | |
virtual void | InitializeSema (Sema &S) |
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree. | |
virtual void | ForgetSema () |
Inform the semantic consumer that Sema is no longer available. | |
virtual void | ReadMethodPool (Selector Sel) |
Load the contents of the global method pool for a given selector. | |
virtual void | ReadKnownNamespaces (SmallVectorImpl< NamespaceDecl * > &Namespaces) |
Load the set of namespaces that are known to the external source, which will be used during typo correction. | |
virtual void | ReadUndefinedButUsed (llvm::DenseMap< NamedDecl *, SourceLocation > &Undefined) |
Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions. | |
virtual bool | LookupUnqualified (LookupResult &R, Scope *S) |
Do last resort, unqualified lookup on a LookupResult that Sema cannot find. | |
virtual void | ReadTentativeDefinitions (SmallVectorImpl< VarDecl * > &TentativeDefs) |
Read the set of tentative definitions known to the external Sema source. | |
virtual void | ReadUnusedFileScopedDecls (SmallVectorImpl< const DeclaratorDecl * > &Decls) |
Read the set of unused file-scope declarations known to the external Sema source. | |
virtual void | ReadDelegatingConstructors (SmallVectorImpl< CXXConstructorDecl * > &Decls) |
Read the set of delegating constructors known to the external Sema source. | |
virtual void | ReadExtVectorDecls (SmallVectorImpl< TypedefNameDecl * > &Decls) |
Read the set of ext_vector type declarations known to the external Sema source. | |
virtual void | ReadDynamicClasses (SmallVectorImpl< CXXRecordDecl * > &Decls) |
Read the set of dynamic classes known to the external Sema source. | |
virtual void | ReadUnusedLocalTypedefNameCandidates (llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) |
Read the set of potentially unused typedefs known to the source. | |
virtual void | ReadLocallyScopedExternCDecls (SmallVectorImpl< NamedDecl * > &Decls) |
Read the set of locally-scoped external declarations known to the external Sema source. | |
virtual void | ReadReferencedSelectors (SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) |
Read the set of referenced selectors known to the external Sema source. | |
virtual void | ReadWeakUndeclaredIdentifiers (SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) |
Read the set of weak, undeclared identifiers known to the external Sema source. | |
virtual void | ReadUsedVTables (SmallVectorImpl< ExternalVTableUse > &VTables) |
Read the set of used vtables known to the external Sema source. | |
virtual void | ReadPendingInstantiations (SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) |
Read the set of pending instantiations known to the external Sema source. | |
virtual void | ReadLateParsedTemplates (llvm::DenseMap< const FunctionDecl *, LateParsedTemplate * > &LPTMap) |
Read the set of late parsed template functions for this source. | |
virtual TypoCorrection | CorrectTypo (const DeclarationNameInfo &Typo, int LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, DeclContext *MemberContext, bool EnteringContext, const ObjCObjectPointerType *OPT) |
virtual bool | MaybeDiagnoseMissingCompleteType (SourceLocation Loc, QualType T) |
Produces a diagnostic note if the external source contains a complete definition for T . | |
Static Public Member Functions | |
static bool | classof (const ExternalASTSource *Source) |
An abstract interface that should be implemented by external AST sources that also provide information for semantic analysis.
Definition at line 52 of file ExternalSemaSource.h.
clang::ExternalSemaSource::ExternalSemaSource | ( | ) | [inline] |
Definition at line 54 of file ExternalSemaSource.h.
static bool clang::ExternalSemaSource::classof | ( | const ExternalASTSource * | Source | ) | [inline, static] |
Definition at line 236 of file ExternalSemaSource.h.
virtual TypoCorrection clang::ExternalSemaSource::CorrectTypo | ( | const DeclarationNameInfo & | Typo, |
int | LookupKind, | ||
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
CorrectionCandidateCallback & | CCC, | ||
DeclContext * | MemberContext, | ||
bool | EnteringContext, | ||
const ObjCObjectPointerType * | OPT | ||
) | [inline, virtual] |
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code.
TypoName | the DeclarationNameInfo structure that contains the name that was present in the source code along with its location. |
LookupKind | the name-lookup criteria used to search for the name. |
S | the scope in which name lookup occurs. |
SS | the nested-name-specifier that precedes the name we're looking for, if present. |
CCC | A CorrectionCandidateCallback object that provides further validation of typo correction candidates. It also provides flags for determining the set of keywords permitted. |
MemberContext | if non-NULL, the context in which to look for a member access expression. |
EnteringContext | whether we're entering the context described by the nested-name-specifier SS. |
OPT | when non-NULL, the search for visible declarations will also walk the protocols in the qualified interfaces of OPT . |
TypoCorrection
containing the corrected name if the typo along with information such as the NamedDecl
where the corrected name was declared, and any additional NestedNameSpecifier
needed to access it (C++ only). The TypoCorrection
is empty if there is no correction. ExternalSemaSource::CorrectTypo is always given the first chance to correct a typo (really, to offer suggestions to repair a failed lookup). It will even be called when SpellChecking is turned off or after a fatal error has already been detected.
Reimplemented in clang::MultiplexExternalSemaSource.
Definition at line 212 of file ExternalSemaSource.h.
Referenced by clang::Sema::CorrectTypo().
virtual void clang::ExternalSemaSource::ForgetSema | ( | ) | [inline, virtual] |
Inform the semantic consumer that Sema is no longer available.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 66 of file ExternalSemaSource.h.
virtual void clang::ExternalSemaSource::InitializeSema | ( | Sema & | S | ) | [inline, virtual] |
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 63 of file ExternalSemaSource.h.
virtual bool clang::ExternalSemaSource::LookupUnqualified | ( | LookupResult & | R, |
Scope * | S | ||
) | [inline, virtual] |
Do last resort, unqualified lookup on a LookupResult that Sema cannot find.
R | a LookupResult that is being recovered. |
S | the Scope of the identifier occurrence. |
Reimplemented in clang::MultiplexExternalSemaSource.
Definition at line 90 of file ExternalSemaSource.h.
virtual bool clang::ExternalSemaSource::MaybeDiagnoseMissingCompleteType | ( | SourceLocation | Loc, |
QualType | T | ||
) | [inline, virtual] |
Produces a diagnostic note if the external source contains a complete definition for T
.
Loc | the location at which a complete type was required but not provided |
T | the QualType that should have been complete at Loc |
Reimplemented in clang::MultiplexExternalSemaSource.
Definition at line 230 of file ExternalSemaSource.h.
virtual void clang::ExternalSemaSource::ReadDelegatingConstructors | ( | SmallVectorImpl< CXXConstructorDecl * > & | Decls | ) | [inline, virtual] |
Read the set of delegating constructors known to the external Sema source.
The external source should append its own delegating constructors to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 119 of file ExternalSemaSource.h.
virtual void clang::ExternalSemaSource::ReadDynamicClasses | ( | SmallVectorImpl< CXXRecordDecl * > & | Decls | ) | [inline, virtual] |
Read the set of dynamic classes known to the external Sema source.
The external source should append its own dynamic classes to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 137 of file ExternalSemaSource.h.
virtual void clang::ExternalSemaSource::ReadExtVectorDecls | ( | SmallVectorImpl< TypedefNameDecl * > & | Decls | ) | [inline, virtual] |
Read the set of ext_vector type declarations known to the external Sema source.
The external source should append its own ext_vector type declarations to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 129 of file ExternalSemaSource.h.
void ExternalSemaSource::ReadKnownNamespaces | ( | SmallVectorImpl< NamespaceDecl * > & | Namespaces | ) | [virtual] |
Load the set of namespaces that are known to the external source, which will be used during typo correction.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
virtual void clang::ExternalSemaSource::ReadLateParsedTemplates | ( | llvm::DenseMap< const FunctionDecl *, LateParsedTemplate * > & | LPTMap | ) | [inline, virtual] |
Read the set of late parsed template functions for this source.
The external source should insert its own late parsed template functions into the map. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same map entries repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 202 of file ExternalSemaSource.h.
Referenced by clang::Sema::InstantiateFunctionDefinition().
virtual void clang::ExternalSemaSource::ReadLocallyScopedExternCDecls | ( | SmallVectorImpl< NamedDecl * > & | Decls | ) | [inline, virtual] |
Read the set of locally-scoped external declarations known to the external Sema source.
The external source should append its own locally-scoped external declarations to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 155 of file ExternalSemaSource.h.
void ExternalSemaSource::ReadMethodPool | ( | Selector | Sel | ) | [virtual] |
Load the contents of the global method pool for a given selector.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 1221 of file Sema.cpp.
Referenced by clang::Sema::ReadMethodPool().
virtual void clang::ExternalSemaSource::ReadPendingInstantiations | ( | SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > & | Pending | ) | [inline, virtual] |
Read the set of pending instantiations known to the external Sema source.
The external source should append its own pending instantiations to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same instantiations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 192 of file ExternalSemaSource.h.
Referenced by clang::Sema::ActOnEndOfTranslationUnit().
virtual void clang::ExternalSemaSource::ReadReferencedSelectors | ( | SmallVectorImpl< std::pair< Selector, SourceLocation > > & | Sels | ) | [inline, virtual] |
Read the set of referenced selectors known to the external Sema source.
The external source should append its own referenced selectors to the given vector of selectors. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same selectors repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 165 of file ExternalSemaSource.h.
Referenced by clang::Sema::DiagnoseUseOfUnimplementedSelectors().
virtual void clang::ExternalSemaSource::ReadTentativeDefinitions | ( | SmallVectorImpl< VarDecl * > & | TentativeDefs | ) | [inline, virtual] |
Read the set of tentative definitions known to the external Sema source.
The external source should append its own tentative definitions to the given vector of tentative definitions. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 99 of file ExternalSemaSource.h.
void ExternalSemaSource::ReadUndefinedButUsed | ( | llvm::DenseMap< NamedDecl *, SourceLocation > & | Undefined | ) | [virtual] |
Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 1227 of file Sema.cpp.
Referenced by clang::Sema::ActOnEndOfTranslationUnit().
virtual void clang::ExternalSemaSource::ReadUnusedFileScopedDecls | ( | SmallVectorImpl< const DeclaratorDecl * > & | Decls | ) | [inline, virtual] |
Read the set of unused file-scope declarations known to the external Sema source.
The external source should append its own unused, filed-scope to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 109 of file ExternalSemaSource.h.
virtual void clang::ExternalSemaSource::ReadUnusedLocalTypedefNameCandidates | ( | llvm::SmallSetVector< const TypedefNameDecl *, 4 > & | Decls | ) | [inline, virtual] |
Read the set of potentially unused typedefs known to the source.
The external source should append its own potentially unused local typedefs to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 145 of file ExternalSemaSource.h.
Referenced by clang::Sema::emitAndClearUnusedLocalTypedefWarnings().
virtual void clang::ExternalSemaSource::ReadUsedVTables | ( | SmallVectorImpl< ExternalVTableUse > & | VTables | ) | [inline, virtual] |
Read the set of used vtables known to the external Sema source.
The external source should append its own used vtables to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same vtables repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 183 of file ExternalSemaSource.h.
Referenced by clang::Sema::LoadExternalVTableUses().
virtual void clang::ExternalSemaSource::ReadWeakUndeclaredIdentifiers | ( | SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > & | WI | ) | [inline, virtual] |
Read the set of weak, undeclared identifiers known to the external Sema source.
The external source should append its own weak, undeclared identifiers to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same identifiers repeatedly.
Reimplemented in clang::ASTReader, and clang::MultiplexExternalSemaSource.
Definition at line 175 of file ExternalSemaSource.h.
Referenced by clang::Sema::LoadExternalWeakUndeclaredIdentifiers().