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


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 Attributes

llvm::SmallPtrSet< clang::Decl *, 16 > m_decls_to_ignore
 Decls we should ignore when mapping decls back to their original ASTContext.
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 283 of file ClangASTImporter.h.

Constructor & Destructor Documentation

◆ ASTImporterDelegate()

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

Definition at line 284 of file ClangASTImporter.h.

References lldbassert.

Member Function Documentation

◆ GetOriginalDecl()

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

Definition at line 1413 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 

◆ ImportImpl()

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

◆ RemoveImportListener()

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

Definition at line 343 of file ClangASTImporter.h.

References m_new_decl_listener.

◆ SetImportListener()

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

Definition at line 339 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

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

Referenced by ImportImpl().

◆ m_main

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

Definition at line 354 of file ClangASTImporter.h.

Referenced by ImportImpl().

◆ m_new_decl_listener

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

The currently attached listener.

Definition at line 358 of file ClangASTImporter.h.

Referenced by RemoveImportListener(), and SetImportListener().

◆ m_source_ctx

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

Definition at line 355 of file ClangASTImporter.h.

◆ m_std_handler

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

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