class MultiplexExternalSemaSource

Declaration

class MultiplexExternalSemaSource : public ExternalSemaSource { /* full declaration omitted */ };

Description

An abstract interface that should be implemented by external AST sources that also provide information for semantic analysis.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:38

Inherits from: ExternalSemaSource

Member Variables

private SmallVector<clang::ExternalSemaSource*, 2> Sources
private static char ID
LLVM-style RTTI.

Method Overview

Inherited from ExternalSemaSource:

Inherited from ExternalASTSource:

Methods

void CompleteRedeclChain(const clang::Decl* D)

Description

Complete the redeclaration chain if it's been extended since the previous generation of the AST source.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:73

Parameters

const clang::Decl* D

void CompleteType(clang::ObjCInterfaceDecl* Class)

Description

Gives the external AST source an opportunity to complete an incomplete Objective-C class. This routine will only be invoked if the "externally completed" bit is set on the ObjCInterfaceDecl via the function\c ObjCInterfaceDecl::setExternallyCompleted().

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:131

Parameters

clang::ObjCInterfaceDecl* Class

void CompleteType(clang::TagDecl* Tag)

Description

Gives the external AST source an opportunity to complete an incomplete type.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:123

Parameters

clang::TagDecl* Tag

clang::TypoCorrection CorrectTypo(
    const clang::DeclarationNameInfo& Typo,
    int LookupKind,
    clang::Scope* S,
    clang::CXXScopeSpec* SS,
    clang::CorrectionCandidateCallback& CCC,
    clang::DeclContext* MemberContext,
    bool EnteringContext,
    const clang::ObjCObjectPointerType* OPT)

Description

\copydoc ExternalSemaSource::CorrectTypo

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:344

Parameters

const clang::DeclarationNameInfo& Typo
int LookupKind
clang::Scope* S
clang::CXXScopeSpec* SS
clang::CorrectionCandidateCallback& CCC
clang::DeclContext* MemberContext
bool EnteringContext
const clang::ObjCObjectPointerType* OPT

void FindExternalLexicalDecls(
    const clang::DeclContext* DC,
    llvm::function_ref<bool(Decl::Kind)>
        IsKindWeWant,
    SmallVectorImpl<clang::Decl*>& Result)

Description

Finds all declarations lexically contained within the given DeclContext, after applying an optional filter predicate.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:111

Parameters

const clang::DeclContext* DC
llvm::function_ref<bool(Decl::Kind)> IsKindWeWant
a predicate function that returns true if the passed declaration kind is one we are looking for.
SmallVectorImpl<clang::Decl*>& Result

bool FindExternalVisibleDeclsByName(
    const clang::DeclContext* DC,
    clang::DeclarationName Name)

Description

Find all declarations with the given name in the given context.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:98

Parameters

const clang::DeclContext* DC
clang::DeclarationName Name

void FindFileRegionDecls(
    clang::FileID File,
    unsigned int Offset,
    unsigned int Length,
    SmallVectorImpl<clang::Decl*>& Decls)

Description

Get the decls that are contained in a file in the Offset/Length range. \p Length can be 0 to indicate a point at \p Offset instead of a range.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:118

Parameters

clang::FileID File
unsigned int Offset
unsigned int Length
SmallVectorImpl<clang::Decl*>& Decls

void FinishedDeserializing()

Description

Notify ExternalASTSource that we finished the deserialization of a decl or type. Must be paired with StartedDeserializing.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:143

void ForgetSema()

Description

Inform the semantic consumer that Sema is no longer available.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:205

clang::CXXBaseSpecifier*
GetExternalCXXBaseSpecifiers(uint64_t Offset)

Description

Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:88

Parameters

uint64_t Offset

clang::CXXCtorInitializer**
GetExternalCXXCtorInitializers(uint64_t Offset)

Description

Resolve a handle to a list of ctor initializers into the list of initializers themselves.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:92

Parameters

uint64_t Offset

clang::Decl* GetExternalDecl(uint32_t ID)

Description

Resolve a declaration ID into a declaration, potentially building a new declaration.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:69

Parameters

uint32_t ID

clang::Stmt* GetExternalDeclStmt(uint64_t Offset)

Description

Resolve the offset of a statement in the decl stream into a statement.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:84

Parameters

uint64_t Offset

clang::Selector GetExternalSelector(uint32_t ID)

Description

Resolve a selector ID into a selector.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:76

Parameters

uint32_t ID

uint32_t GetNumExternalSelectors()

Description

Returns the number of selectors known to the external AST source.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:80

void InitializeSema(clang::Sema& S)

Description

Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:202

Parameters

clang::Sema& S

bool LookupUnqualified(clang::LookupResult& R,
                       clang::Scope* S)

Description

Do last resort, unqualified lookup on a LookupResult that Sema cannot find.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:237

Parameters

clang::LookupResult& R
a LookupResult that is being recovered.
clang::Scope* S
the Scope of the identifier occurrence.

Returns

true to tell Sema to recover using the LookupResult.

bool MaybeDiagnoseMissingCompleteType(
    clang::SourceLocation Loc,
    clang::QualType T)

Description

Produces a diagnostic note if one of the attached sources contains a complete definition for \p T. Queries the sources in list order until the first one claims that a diagnostic was produced.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:361

Parameters

clang::SourceLocation Loc
the location at which a complete type was required but not provided
clang::QualType T
the \c QualType that should have been complete at \p Loc

Returns

true if a diagnostic was produced, false otherwise.

MultiplexExternalSemaSource(
    clang::ExternalSemaSource& s1,
    clang::ExternalSemaSource& s2)

Description

Constructs a new multiplexing external sema source and appends the given element to it.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:53

Parameters

clang::ExternalSemaSource& s1
- A non-null (old) ExternalSemaSource.
clang::ExternalSemaSource& s2
- A non-null (new) ExternalSemaSource.

void PrintStats()

Description

Print any statistics that have been gathered regarding the external AST source.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:151

void ReadComments()

Description

Loads comment ranges.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:134

void ReadDeclsToCheckForDeferredDiags(
    llvm::SmallSetVector<Decl*, 4>& Decls)

Description

Read the set of decls to be checked for deferred diags. The external source should append its own potentially emitted function and variable decls which may cause deferred diags. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:339

Parameters

llvm::SmallSetVector<Decl*, 4>& Decls

void ReadDelegatingConstructors(
    SmallVectorImpl<clang::CXXConstructorDecl*>&
        Decls)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:265

Parameters

SmallVectorImpl<clang::CXXConstructorDecl*>& Decls

void ReadExtVectorDecls(
    SmallVectorImpl<clang::TypedefNameDecl*>&
        Decls)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:275

Parameters

SmallVectorImpl<clang::TypedefNameDecl*>& Decls

void ReadKnownNamespaces(
    SmallVectorImpl<clang::NamespaceDecl*>&
        Namespaces)

Description

Load the set of namespaces that are known to the external source, which will be used during typo correction.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:218

Parameters

SmallVectorImpl<clang::NamespaceDecl*>& Namespaces

void ReadLateParsedTemplates(
    llvm::MapVector<
        const FunctionDecl*,
        std::unique_ptr<LateParsedTemplate>>&
        LPTMap)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:329

Parameters

llvm::MapVector< const FunctionDecl*, std::unique_ptr<LateParsedTemplate>>& LPTMap

void ReadMethodPool(clang::Selector Sel)

Description

Load the contents of the global method pool for a given selector.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:209

Parameters

clang::Selector Sel

void ReadMismatchingDeleteExpressions(
    llvm::MapVector<
        FieldDecl*,
        llvm::SmallVector<
            std::pair<SourceLocation, bool>,
            4>>& Exprs)

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:225

Parameters

llvm::MapVector< FieldDecl*, llvm::SmallVector< std::pair<SourceLocation, bool>, 4>>& Exprs

void ReadPendingInstantiations(
    SmallVectorImpl<
        std::pair<ValueDecl*, SourceLocation>>&
        Pending)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:320

Parameters

SmallVectorImpl< std::pair<ValueDecl*, SourceLocation>>& Pending

void ReadReferencedSelectors(
    SmallVectorImpl<
        std::pair<Selector, SourceLocation>>&
        Sels)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:293

Parameters

SmallVectorImpl< std::pair<Selector, SourceLocation>>& Sels

void ReadTentativeDefinitions(
    SmallVectorImpl<clang::VarDecl*>& Defs)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:246

Parameters

SmallVectorImpl<clang::VarDecl*>& Defs

void ReadUndefinedButUsed(
    llvm::MapVector<NamedDecl*, SourceLocation>&
        Undefined)

Description

Load the set of used but not defined functions or variables with internal linkage, or used but not defined inline functions.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:222

Parameters

llvm::MapVector<NamedDecl*, SourceLocation>& Undefined

void ReadUnusedFileScopedDecls(
    SmallVectorImpl<const clang::DeclaratorDecl*>&
        Decls)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:255

Parameters

SmallVectorImpl<const clang::DeclaratorDecl*>& Decls

void ReadUnusedLocalTypedefNameCandidates(
    llvm::SmallSetVector<const TypedefNameDecl*,
                         4>& Decls)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:283

Parameters

llvm::SmallSetVector<const TypedefNameDecl*, 4>& Decls

void ReadUsedVTables(
    SmallVectorImpl<clang::ExternalVTableUse>&
        VTables)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:311

Parameters

SmallVectorImpl<clang::ExternalVTableUse>& VTables

void ReadWeakUndeclaredIdentifiers(
    SmallVectorImpl<
        std::pair<IdentifierInfo*, WeakInfo>>& WI)

Description

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.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:303

Parameters

SmallVectorImpl< std::pair<IdentifierInfo*, WeakInfo>>& WI

void StartTranslationUnit(
    clang::ASTConsumer* Consumer)

Description

Function that will be invoked when we begin parsing a new translation unit involving this external AST source.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:147

Parameters

clang::ASTConsumer* Consumer

void StartedDeserializing()

Description

Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing. Must be paired with FinishedDeserializing.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:139

void addSource(clang::ExternalSemaSource& source)

Description

Appends new source to the source list.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:61

Parameters

clang::ExternalSemaSource& source
- An ExternalSemaSource.

static bool classof(
    const clang::ExternalASTSource* S)

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:369

Parameters

const clang::ExternalASTSource* S

void completeVisibleDeclsMap(
    const clang::DeclContext* DC)

Description

Ensures that the table of all visible declarations inside this context is up to date.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:103

Parameters

const clang::DeclContext* DC

void getMemoryBufferSizes(
    clang::ExternalASTSource::MemoryBufferSizes&
        sizes) const

Description

Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:193

Parameters

clang::ExternalASTSource::MemoryBufferSizes& sizes

clang::Module* getModule(unsigned int ID)

Description

Retrieve the module that corresponds to the given module ID.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:154

Parameters

unsigned int ID

clang::ExternalASTSource::ExtKind
hasExternalDefinitions(const clang::Decl* D)

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:94

Parameters

const clang::Decl* D

bool isA(const void* ClassID) const

Description

LLVM-style RTTI. \ {

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:366

Parameters

const void* ClassID

bool layoutRecordType(
    const clang::RecordDecl* Record,
    uint64_t& Size,
    uint64_t& Alignment,
    llvm::DenseMap<const FieldDecl*, uint64_t>&
        FieldOffsets,
    llvm::DenseMap<const CXXRecordDecl*,
                   CharUnits>& BaseOffsets,
    llvm::DenseMap<const CXXRecordDecl*,
                   CharUnits>& VirtualBaseOffsets)

Description

Perform layout on the given record. This routine allows the external AST source to provide an specific layout for a record, overriding the layout that would normally be constructed. It is intended for clients who receive specific layout details rather than source code (such as LLDB). The client is expected to fill in the field offsets, base offsets, virtual base offsets, and complete object size.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:184

Parameters

const clang::RecordDecl* Record
The record whose layout is being requested.
uint64_t& Size
The final size of the record, in bits.
uint64_t& Alignment
The final alignment of the record, in bits.
llvm::DenseMap<const FieldDecl*, uint64_t>& FieldOffsets
The offset of each of the fields within the record, expressed in bits. All of the fields must be provided with offsets.
llvm::DenseMap<const CXXRecordDecl*, CharUnits>& BaseOffsets
The offset of each of the direct, non-virtual base classes. If any bases are not given offsets, the bases will be laid out according to the ABI.
llvm::DenseMap<const CXXRecordDecl*, CharUnits>& VirtualBaseOffsets
The offset of each of the virtual base classes (either direct or not). If any bases are not given offsets, the bases will be laid out according to the ABI.

Returns

true if the record layout was provided, false otherwise.

void updateOutOfDateSelector(clang::Selector Sel)

Description

Load the contents of the global method pool for a given selector if necessary.

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:213

Parameters

clang::Selector Sel

~MultiplexExternalSemaSource()

Declared at: clang/include/clang/Sema/MultiplexExternalSemaSource.h:55