LLDB mainline
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:
[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 &main, 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 Member Functions

void MarkDeclImported (clang::Decl *from, clang::Decl *to)

Private Attributes

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

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 285 of file ClangASTImporter.h.

Constructor & Destructor Documentation

◆ ASTImporterDelegate()

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

Member Function Documentation

◆ GetOriginalDecl()

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

Definition at line 1438 of file ClangASTImporter.cpp.

References m_main.

◆ ImportDefinitionTo()

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

◆ Imported()

◆ ImportImpl()

◆ MarkDeclImported()

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

◆ RemoveImportListener()

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

Definition at line 345 of file ClangASTImporter.h.

References m_new_decl_listener.

◆ SetImportListener()

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

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

Referenced by Imported(), and ImportImpl().

◆ m_main

ClangASTImporter& lldb_private::ClangASTImporter::ASTImporterDelegate::m_main
private

◆ m_new_decl_listener

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

The currently attached listener.

Definition at line 362 of file ClangASTImporter.h.

Referenced by Imported(), RemoveImportListener(), and SetImportListener().

◆ m_source_ctx

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

Definition at line 359 of file ClangASTImporter.h.

Referenced by ASTImporterDelegate(), ImportDefinitionTo(), and Imported().

◆ m_std_handler

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

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