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

#include <ClangASTImporter.h>

Public Member Functions

 ASTContextMetadata (clang::ASTContext *dst_ctx)
 
void setOrigin (const clang::Decl *decl, DeclOrigin origin)
 Sets the DeclOrigin for the given Decl and overwrites any existing DeclOrigin.
 
void removeOrigin (const clang::Decl *decl)
 Removes any tracked DeclOrigin for the given decl.
 
void removeOriginsWithContext (clang::ASTContext *ctx)
 Remove all DeclOrigin entries that point to the given ASTContext.
 
DeclOrigin getOrigin (const clang::Decl *decl) const
 Returns the DeclOrigin for the given Decl or an invalid DeclOrigin instance if there no known DeclOrigin for the given Decl.
 
bool hasOrigin (const clang::Decl *decl) const
 Returns true there is a known DeclOrigin for the given Decl.
 

Public Attributes

clang::ASTContext * m_dst_ctx
 
DelegateMap m_delegates
 
NamespaceMetaMap m_namespace_maps
 
MapCompleterm_map_completer = nullptr
 

Private Types

typedef llvm::DenseMap< const clang::Decl *, DeclOriginOriginMap
 

Private Attributes

OriginMap m_origins
 Maps declarations to the ASTContext/Decl from which they were imported from.
 

Detailed Description

Definition at line 366 of file ClangASTImporter.h.

Member Typedef Documentation

◆ OriginMap

typedef llvm::DenseMap<const clang::Decl *, DeclOrigin> lldb_private::ClangASTImporter::ASTContextMetadata::OriginMap
private

Definition at line 367 of file ClangASTImporter.h.

Constructor & Destructor Documentation

◆ ASTContextMetadata()

lldb_private::ClangASTImporter::ASTContextMetadata::ASTContextMetadata ( clang::ASTContext *  dst_ctx)
inline

Definition at line 370 of file ClangASTImporter.h.

Member Function Documentation

◆ getOrigin()

DeclOrigin lldb_private::ClangASTImporter::ASTContextMetadata::getOrigin ( const clang::Decl *  decl) const
inline

Returns the DeclOrigin for the given Decl or an invalid DeclOrigin instance if there no known DeclOrigin for the given Decl.

Definition at line 409 of file ClangASTImporter.h.

References m_origins.

Referenced by hasOrigin().

◆ hasOrigin()

bool lldb_private::ClangASTImporter::ASTContextMetadata::hasOrigin ( const clang::Decl *  decl) const
inline

Returns true there is a known DeclOrigin for the given Decl.

Definition at line 417 of file ClangASTImporter.h.

References getOrigin(), and lldb_private::ClangASTImporter::DeclOrigin::Valid().

◆ removeOrigin()

void lldb_private::ClangASTImporter::ASTContextMetadata::removeOrigin ( const clang::Decl *  decl)
inline

Removes any tracked DeclOrigin for the given decl.

Definition at line 392 of file ClangASTImporter.h.

References m_origins.

◆ removeOriginsWithContext()

void lldb_private::ClangASTImporter::ASTContextMetadata::removeOriginsWithContext ( clang::ASTContext *  ctx)
inline

Remove all DeclOrigin entries that point to the given ASTContext.

Useful when an ASTContext is about to be deleted and all the dangling pointers to it need to be removed.

Definition at line 397 of file ClangASTImporter.h.

References m_origins.

◆ setOrigin()

void lldb_private::ClangASTImporter::ASTContextMetadata::setOrigin ( const clang::Decl *  decl,
DeclOrigin  origin 
)
inline

Sets the DeclOrigin for the given Decl and overwrites any existing DeclOrigin.

Definition at line 380 of file ClangASTImporter.h.

References lldb_private::ClangASTImporter::DeclOrigin::ctx, lldb_private::ClangASTImporter::DeclOrigin::decl, and m_origins.

Member Data Documentation

◆ m_delegates

DelegateMap lldb_private::ClangASTImporter::ASTContextMetadata::m_delegates

Definition at line 373 of file ClangASTImporter.h.

◆ m_dst_ctx

clang::ASTContext* lldb_private::ClangASTImporter::ASTContextMetadata::m_dst_ctx

Definition at line 372 of file ClangASTImporter.h.

◆ m_map_completer

MapCompleter* lldb_private::ClangASTImporter::ASTContextMetadata::m_map_completer = nullptr

Definition at line 376 of file ClangASTImporter.h.

◆ m_namespace_maps

NamespaceMetaMap lldb_private::ClangASTImporter::ASTContextMetadata::m_namespace_maps

Definition at line 375 of file ClangASTImporter.h.

◆ m_origins

OriginMap lldb_private::ClangASTImporter::ASTContextMetadata::m_origins
private

Maps declarations to the ASTContext/Decl from which they were imported from.

If a declaration is from an ASTContext which has been deleted since the declaration was imported or the declaration wasn't created by the ASTImporter, then it doesn't have a DeclOrigin and will not be tracked here.

Definition at line 427 of file ClangASTImporter.h.

Referenced by getOrigin(), removeOrigin(), removeOriginsWithContext(), and setOrigin().


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