LLDB  mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::SemaSourceWithPriorities Class Reference

A ExternalSemaSource multiplexer that prioritizes its sources. More...

#include <ASTUtils.h>

Inheritance diagram for lldb_private::SemaSourceWithPriorities:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::SemaSourceWithPriorities:
Collaboration graph
[legend]

Public Member Functions

 SemaSourceWithPriorities (clang::ExternalSemaSource &high_quality_source, clang::ExternalSemaSource &low_quality_source)
 Construct a SemaSourceWithPriorities with a 'high quality' source that has the higher priority and a 'low quality' source that will be used as a fallback. More...
 
 ~SemaSourceWithPriorities () override
 
void addSource (clang::ExternalSemaSource &source)
 
clang::Decl * GetExternalDecl (uint32_t ID) override
 
void CompleteRedeclChain (const clang::Decl *D) override
 
clang::Selector GetExternalSelector (uint32_t ID) override
 
uint32_t GetNumExternalSelectors () override
 
clang::Stmt * GetExternalDeclStmt (uint64_t Offset) override
 
clang::CXXBaseSpecifier * GetExternalCXXBaseSpecifiers (uint64_t Offset) override
 
clang::CXXCtorInitializer ** GetExternalCXXCtorInitializers (uint64_t Offset) override
 
ExtKind hasExternalDefinitions (const clang::Decl *D) override
 
bool FindExternalVisibleDeclsByName (const clang::DeclContext *DC, clang::DeclarationName Name) override
 
void completeVisibleDeclsMap (const clang::DeclContext *DC) override
 
void FindExternalLexicalDecls (const clang::DeclContext *DC, llvm::function_ref< bool(clang::Decl::Kind)> IsKindWeWant, llvm::SmallVectorImpl< clang::Decl * > &Result) override
 
void FindFileRegionDecls (clang::FileID File, unsigned Offset, unsigned Length, llvm::SmallVectorImpl< clang::Decl * > &Decls) override
 
void CompleteType (clang::TagDecl *Tag) override
 
void CompleteType (clang::ObjCInterfaceDecl *Class) override
 
void ReadComments () override
 
void StartedDeserializing () override
 
void FinishedDeserializing () override
 
void StartTranslationUnit (clang::ASTConsumer *Consumer) override
 
void PrintStats () override
 
clang::Module * getModule (unsigned ID) override
 
bool layoutRecordType (const clang::RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap< const clang::FieldDecl *, uint64_t > &FieldOffsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &BaseOffsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &VirtualBaseOffsets) override
 
void getMemoryBufferSizes (MemoryBufferSizes &sizes) const override
 
void InitializeSema (clang::Sema &S) override
 
void ForgetSema () override
 
void ReadMethodPool (clang::Selector Sel) override
 
void updateOutOfDateSelector (clang::Selector Sel) override
 
void ReadKnownNamespaces (llvm::SmallVectorImpl< clang::NamespaceDecl * > &Namespaces) override
 
void ReadUndefinedButUsed (llvm::MapVector< clang::NamedDecl *, clang::SourceLocation > &Undefined) override
 
void ReadMismatchingDeleteExpressions (llvm::MapVector< clang::FieldDecl *, llvm::SmallVector< std::pair< clang::SourceLocation, bool >, 4 >> &Exprs) override
 
bool LookupUnqualified (clang::LookupResult &R, clang::Scope *S) override
 
void ReadTentativeDefinitions (llvm::SmallVectorImpl< clang::VarDecl * > &Defs) override
 
void ReadUnusedFileScopedDecls (llvm::SmallVectorImpl< const clang::DeclaratorDecl * > &Decls) override
 
void ReadDelegatingConstructors (llvm::SmallVectorImpl< clang::CXXConstructorDecl * > &Decls) override
 
void ReadExtVectorDecls (llvm::SmallVectorImpl< clang::TypedefNameDecl * > &Decls) override
 
void ReadUnusedLocalTypedefNameCandidates (llvm::SmallSetVector< const clang::TypedefNameDecl *, 4 > &Decls) override
 
void ReadReferencedSelectors (llvm::SmallVectorImpl< std::pair< clang::Selector, clang::SourceLocation >> &Sels) override
 
void ReadWeakUndeclaredIdentifiers (llvm::SmallVectorImpl< std::pair< clang::IdentifierInfo *, clang::WeakInfo >> &WI) override
 
void ReadUsedVTables (llvm::SmallVectorImpl< clang::ExternalVTableUse > &VTables) override
 
void ReadPendingInstantiations (llvm::SmallVectorImpl< std::pair< clang::ValueDecl *, clang::SourceLocation >> &Pending) override
 
void ReadLateParsedTemplates (llvm::MapVector< const clang::FunctionDecl *, std::unique_ptr< clang::LateParsedTemplate >> &LPTMap) override
 
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) override
 
bool MaybeDiagnoseMissingCompleteType (clang::SourceLocation Loc, clang::QualType T) override
 

Private Attributes

llvm::SmallVector< clang::ExternalSemaSource *, 2 > Sources
 The sources ordered in decreasing priority. More...
 

Detailed Description

A ExternalSemaSource multiplexer that prioritizes its sources.

This ExternalSemaSource will forward all requests to its attached sources. However, unlike a normal multiplexer it will not forward a request to all sources, but instead give priority to certain sources. If a source with a higher priority can fulfill a request, all sources with a lower priority will not receive the request.

This class is mostly use to multiplex between sources of different 'quality', e.g. a C++ modules and debug information. The C++ module will provide more accurate replies to the requests, but might not be able to answer all requests. The debug information will be used as a fallback then to provide information that is not in the C++ module.

Definition at line 242 of file ASTUtils.h.

Constructor & Destructor Documentation

◆ SemaSourceWithPriorities()

lldb_private::SemaSourceWithPriorities::SemaSourceWithPriorities ( clang::ExternalSemaSource &  high_quality_source,
clang::ExternalSemaSource &  low_quality_source 
)
inline

Construct a SemaSourceWithPriorities with a 'high quality' source that has the higher priority and a 'low quality' source that will be used as a fallback.

Definition at line 252 of file ASTUtils.h.

References Sources.

◆ ~SemaSourceWithPriorities()

lldb_private::SemaSourceWithPriorities::~SemaSourceWithPriorities ( )
overridedefault

Member Function Documentation

◆ addSource()

void lldb_private::SemaSourceWithPriorities::addSource ( clang::ExternalSemaSource &  source)
inline

Definition at line 260 of file ASTUtils.h.

References Sources.

◆ CompleteRedeclChain()

void lldb_private::SemaSourceWithPriorities::CompleteRedeclChain ( const clang::Decl *  D)
inlineoverride

Definition at line 275 of file ASTUtils.h.

References Sources.

◆ CompleteType() [1/2]

void lldb_private::SemaSourceWithPriorities::CompleteType ( clang::ObjCInterfaceDecl *  Class)
inlineoverride

Definition at line 370 of file ASTUtils.h.

References lldb_private::Class, CompleteType(), and Sources.

◆ CompleteType() [2/2]

void lldb_private::SemaSourceWithPriorities::CompleteType ( clang::TagDecl *  Tag)
inlineoverride

Definition at line 361 of file ASTUtils.h.

References Sources.

Referenced by CompleteType().

◆ completeVisibleDeclsMap()

void lldb_private::SemaSourceWithPriorities::completeVisibleDeclsMap ( const clang::DeclContext *  DC)
inlineoverride

Definition at line 337 of file ASTUtils.h.

References Sources.

◆ CorrectTypo()

clang::TypoCorrection lldb_private::SemaSourceWithPriorities::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 
)
inlineoverride

Definition at line 545 of file ASTUtils.h.

References Sources.

◆ FindExternalLexicalDecls()

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

Definition at line 343 of file ASTUtils.h.

References Sources.

◆ FindExternalVisibleDeclsByName()

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

Definition at line 329 of file ASTUtils.h.

References Sources.

◆ FindFileRegionDecls()

void lldb_private::SemaSourceWithPriorities::FindFileRegionDecls ( clang::FileID  File,
unsigned  Offset,
unsigned  Length,
llvm::SmallVectorImpl< clang::Decl * > &  Decls 
)
inlineoverride

Definition at line 355 of file ASTUtils.h.

References Sources.

◆ FinishedDeserializing()

void lldb_private::SemaSourceWithPriorities::FinishedDeserializing ( )
inlineoverride

Definition at line 385 of file ASTUtils.h.

References Sources.

◆ ForgetSema()

void lldb_private::SemaSourceWithPriorities::ForgetSema ( )
inlineoverride

Definition at line 432 of file ASTUtils.h.

References Sources.

◆ GetExternalCXXBaseSpecifiers()

clang::CXXBaseSpecifier* lldb_private::SemaSourceWithPriorities::GetExternalCXXBaseSpecifiers ( uint64_t  Offset)
inlineoverride

Definition at line 305 of file ASTUtils.h.

References Sources.

◆ GetExternalCXXCtorInitializers()

clang::CXXCtorInitializer** lldb_private::SemaSourceWithPriorities::GetExternalCXXCtorInitializers ( uint64_t  Offset)
inlineoverride

Definition at line 314 of file ASTUtils.h.

References Sources.

◆ GetExternalDecl()

clang::Decl* lldb_private::SemaSourceWithPriorities::GetExternalDecl ( uint32_t  ID)
inlineoverride

Definition at line 268 of file ASTUtils.h.

References ID, and Sources.

◆ GetExternalDeclStmt()

clang::Stmt* lldb_private::SemaSourceWithPriorities::GetExternalDeclStmt ( uint64_t  Offset)
inlineoverride

Definition at line 297 of file ASTUtils.h.

References Sources.

◆ GetExternalSelector()

clang::Selector lldb_private::SemaSourceWithPriorities::GetExternalSelector ( uint32_t  ID)
inlineoverride

Definition at line 280 of file ASTUtils.h.

References ID, and Sources.

◆ getMemoryBufferSizes()

void lldb_private::SemaSourceWithPriorities::getMemoryBufferSizes ( MemoryBufferSizes &  sizes) const
inlineoverride

Definition at line 418 of file ASTUtils.h.

References Sources.

◆ getModule()

clang::Module* lldb_private::SemaSourceWithPriorities::getModule ( unsigned  ID)
inlineoverride

Definition at line 397 of file ASTUtils.h.

References ID, and Sources.

◆ GetNumExternalSelectors()

uint32_t lldb_private::SemaSourceWithPriorities::GetNumExternalSelectors ( )
inlineoverride

Definition at line 290 of file ASTUtils.h.

References Sources.

◆ hasExternalDefinitions()

ExtKind lldb_private::SemaSourceWithPriorities::hasExternalDefinitions ( const clang::Decl *  D)
inlineoverride

Definition at line 321 of file ASTUtils.h.

References Sources.

◆ InitializeSema()

void lldb_private::SemaSourceWithPriorities::InitializeSema ( clang::Sema &  S)
inlineoverride

Definition at line 427 of file ASTUtils.h.

References Sources.

◆ layoutRecordType()

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

Definition at line 404 of file ASTUtils.h.

References Sources.

◆ LookupUnqualified()

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

Definition at line 468 of file ASTUtils.h.

References Sources.

◆ MaybeDiagnoseMissingCompleteType()

bool lldb_private::SemaSourceWithPriorities::MaybeDiagnoseMissingCompleteType ( clang::SourceLocation  Loc,
clang::QualType  T 
)
inlineoverride

Definition at line 559 of file ASTUtils.h.

References Sources.

◆ PrintStats()

void lldb_private::SemaSourceWithPriorities::PrintStats ( )
override

Definition at line 23 of file ASTUtils.cpp.

◆ ReadComments()

void lldb_private::SemaSourceWithPriorities::ReadComments ( )
inlineoverride

Definition at line 375 of file ASTUtils.h.

References Sources.

◆ ReadDelegatingConstructors()

void lldb_private::SemaSourceWithPriorities::ReadDelegatingConstructors ( llvm::SmallVectorImpl< clang::CXXConstructorDecl * > &  Decls)
inlineoverride

Definition at line 490 of file ASTUtils.h.

References Sources.

◆ ReadExtVectorDecls()

void lldb_private::SemaSourceWithPriorities::ReadExtVectorDecls ( llvm::SmallVectorImpl< clang::TypedefNameDecl * > &  Decls)
inlineoverride

Definition at line 496 of file ASTUtils.h.

References Sources.

◆ ReadKnownNamespaces()

void lldb_private::SemaSourceWithPriorities::ReadKnownNamespaces ( llvm::SmallVectorImpl< clang::NamespaceDecl * > &  Namespaces)
inlineoverride

Definition at line 447 of file ASTUtils.h.

References Sources.

◆ ReadLateParsedTemplates()

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

Definition at line 536 of file ASTUtils.h.

References Sources.

◆ ReadMethodPool()

void lldb_private::SemaSourceWithPriorities::ReadMethodPool ( clang::Selector  Sel)
inlineoverride

Definition at line 437 of file ASTUtils.h.

References Sources.

◆ ReadMismatchingDeleteExpressions()

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

Definition at line 460 of file ASTUtils.h.

References Sources.

◆ ReadPendingInstantiations()

void lldb_private::SemaSourceWithPriorities::ReadPendingInstantiations ( llvm::SmallVectorImpl< std::pair< clang::ValueDecl *, clang::SourceLocation >> &  Pending)
inlineoverride

Definition at line 528 of file ASTUtils.h.

References Sources.

◆ ReadReferencedSelectors()

void lldb_private::SemaSourceWithPriorities::ReadReferencedSelectors ( llvm::SmallVectorImpl< std::pair< clang::Selector, clang::SourceLocation >> &  Sels)
inlineoverride

Definition at line 508 of file ASTUtils.h.

References Sources.

◆ ReadTentativeDefinitions()

void lldb_private::SemaSourceWithPriorities::ReadTentativeDefinitions ( llvm::SmallVectorImpl< clang::VarDecl * > &  Defs)
inlineoverride

Definition at line 478 of file ASTUtils.h.

References Sources.

◆ ReadUndefinedButUsed()

void lldb_private::SemaSourceWithPriorities::ReadUndefinedButUsed ( llvm::MapVector< clang::NamedDecl *, clang::SourceLocation > &  Undefined)
inlineoverride

Definition at line 453 of file ASTUtils.h.

References Sources.

◆ ReadUnusedFileScopedDecls()

void lldb_private::SemaSourceWithPriorities::ReadUnusedFileScopedDecls ( llvm::SmallVectorImpl< const clang::DeclaratorDecl * > &  Decls)
inlineoverride

Definition at line 484 of file ASTUtils.h.

References Sources.

◆ ReadUnusedLocalTypedefNameCandidates()

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

Definition at line 502 of file ASTUtils.h.

References Sources.

◆ ReadUsedVTables()

void lldb_private::SemaSourceWithPriorities::ReadUsedVTables ( llvm::SmallVectorImpl< clang::ExternalVTableUse > &  VTables)
inlineoverride

Definition at line 522 of file ASTUtils.h.

References Sources.

◆ ReadWeakUndeclaredIdentifiers()

void lldb_private::SemaSourceWithPriorities::ReadWeakUndeclaredIdentifiers ( llvm::SmallVectorImpl< std::pair< clang::IdentifierInfo *, clang::WeakInfo >> &  WI)
inlineoverride

Definition at line 515 of file ASTUtils.h.

References Sources.

◆ StartedDeserializing()

void lldb_private::SemaSourceWithPriorities::StartedDeserializing ( )
inlineoverride

Definition at line 380 of file ASTUtils.h.

References Sources.

◆ StartTranslationUnit()

void lldb_private::SemaSourceWithPriorities::StartTranslationUnit ( clang::ASTConsumer *  Consumer)
inlineoverride

Definition at line 390 of file ASTUtils.h.

References Sources.

◆ updateOutOfDateSelector()

void lldb_private::SemaSourceWithPriorities::updateOutOfDateSelector ( clang::Selector  Sel)
inlineoverride

Definition at line 442 of file ASTUtils.h.

References Sources.

Member Data Documentation

◆ Sources

llvm::SmallVector<clang::ExternalSemaSource *, 2> lldb_private::SemaSourceWithPriorities::Sources
private

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