LLDB  mainline
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
lldb_private::ClangASTImporter::ASTImporterDelegate Struct Reference

ASTImporter that intercepts and records the import process of the underlying ASTImporter. More...

#include <ClangASTImporter.h>

Inheritance diagram for lldb_private::ClangASTImporter::ASTImporterDelegate:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::ClangASTImporter::ASTImporterDelegate:
Collaboration graph
[legend]

Classes

class  CxxModuleScope
 Scope guard that attaches a CxxModuleHandler to an ASTImporterDelegate and deattaches it at the end of the scope. More...
 

Public Member Functions

 ASTImporterDelegate (ClangASTImporter &master, clang::ASTContext *target_ctx, clang::ASTContext *source_ctx)
 
void ImportDefinitionTo (clang::Decl *to, clang::Decl *from)
 
void Imported (clang::Decl *from, clang::Decl *to) override
 
clang::Decl * GetOriginalDecl (clang::Decl *To) override
 
void SetImportListener (NewDeclListener *listener)
 
void RemoveImportListener ()
 

Protected Member Functions

llvm::Expected< clang::Decl * > ImportImpl (clang::Decl *From) override
 

Private Attributes

llvm::SmallPtrSet< clang::Decl *, 16 > m_decls_to_ignore
 Decls we should ignore when mapping decls back to their original ASTContext. More...
 
ClangASTImporterm_master
 
clang::ASTContext * m_source_ctx
 
CxxModuleHandlerm_std_handler = nullptr
 
NewDeclListenerm_new_decl_listener = nullptr
 The currently attached listener. More...
 

Detailed Description

ASTImporter that intercepts and records the import process of the underlying ASTImporter.

This class updates the map from declarations to their original declarations and can record declarations that have been imported in a certain interval.

When intercepting a declaration import, the ASTImporterDelegate uses the CxxModuleHandler to replace any missing or malformed declarations with their counterpart from a C++ module.

Definition at line 261 of file ClangASTImporter.h.

Constructor & Destructor Documentation

◆ ASTImporterDelegate()

lldb_private::ClangASTImporter::ASTImporterDelegate::ASTImporterDelegate ( ClangASTImporter master,
clang::ASTContext *  target_ctx,
clang::ASTContext *  source_ctx 
)
inline

Definition at line 262 of file ClangASTImporter.h.

References lldbassert.

Member Function Documentation

◆ GetOriginalDecl()

clang::Decl * ClangASTImporter::ASTImporterDelegate::GetOriginalDecl ( clang::Decl *  To)
override

Definition at line 1210 of file ClangASTImporter.cpp.

◆ ImportDefinitionTo()

void ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo ( clang::Decl *  to,
clang::Decl *  from 
)

◆ Imported()

void ClangASTImporter::ASTImporterDelegate::Imported ( clang::Decl *  from,
clang::Decl *  to 
)
override

◆ ImportImpl()

llvm::Expected< Decl * > ClangASTImporter::ASTImporterDelegate::ImportImpl ( clang::Decl *  From)
overrideprotected

◆ RemoveImportListener()

void lldb_private::ClangASTImporter::ASTImporterDelegate::RemoveImportListener ( )
inline

Definition at line 321 of file ClangASTImporter.h.

References m_new_decl_listener.

◆ SetImportListener()

void lldb_private::ClangASTImporter::ASTImporterDelegate::SetImportListener ( NewDeclListener listener)
inline

Definition at line 317 of file ClangASTImporter.h.

References m_new_decl_listener.

Member Data Documentation

◆ m_decls_to_ignore

llvm::SmallPtrSet<clang::Decl *, 16> lldb_private::ClangASTImporter::ASTImporterDelegate::m_decls_to_ignore
private

Decls we should ignore when mapping decls back to their original ASTContext.

Used by the CxxModuleHandler to mark declarations that were created from the 'std' C++ module to prevent that the Importer tries to sync them with the broken equivalent in the debug info AST.

Definition at line 331 of file ClangASTImporter.h.

◆ m_master

ClangASTImporter& lldb_private::ClangASTImporter::ASTImporterDelegate::m_master
private

Definition at line 332 of file ClangASTImporter.h.

◆ m_new_decl_listener

NewDeclListener* lldb_private::ClangASTImporter::ASTImporterDelegate::m_new_decl_listener = nullptr
private

The currently attached listener.

Definition at line 336 of file ClangASTImporter.h.

Referenced by RemoveImportListener(), and SetImportListener().

◆ m_source_ctx

clang::ASTContext* lldb_private::ClangASTImporter::ASTImporterDelegate::m_source_ctx
private

Definition at line 333 of file ClangASTImporter.h.

◆ m_std_handler

CxxModuleHandler* lldb_private::ClangASTImporter::ASTImporterDelegate::m_std_handler = nullptr
private

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