LLDB mainline
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 370 of file ClangASTImporter.h.

Member Typedef Documentation

◆ OriginMap

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

Definition at line 371 of file ClangASTImporter.h.

Constructor & Destructor Documentation

◆ ASTContextMetadata()

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

Definition at line 374 of file ClangASTImporter.h.

References m_dst_ctx.

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 413 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 421 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 396 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 401 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 384 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 377 of file ClangASTImporter.h.

◆ m_dst_ctx

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

Definition at line 376 of file ClangASTImporter.h.

Referenced by ASTContextMetadata().

◆ m_map_completer

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

Definition at line 380 of file ClangASTImporter.h.

◆ m_namespace_maps

NamespaceMetaMap lldb_private::ClangASTImporter::ASTContextMetadata::m_namespace_maps

Definition at line 379 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 431 of file ClangASTImporter.h.

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


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