#include "lldb/Core/Module.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Sema.h"
#include "llvm/Support/raw_ostream.h"
#include "Plugins/ExpressionParser/Clang/ClangASTImporter.h"
#include "Plugins/ExpressionParser/Clang/ClangASTMetadata.h"
#include "Plugins/ExpressionParser/Clang/ClangASTSource.h"
#include "Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h"
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include <memory>
#include <optional>
#include <type_traits>
usingnamespacelldb_private;
usingnamespaceclang;
CompilerType ClangASTImporter::CopyType(TypeSystemClang &dst_ast,
const CompilerType &src_type) { … }
clang::Decl *ClangASTImporter::CopyDecl(clang::ASTContext *dst_ast,
clang::Decl *decl) { … }
class DeclContextOverride { … };
namespace {
class CompleteTagDeclsScope : public ClangASTImporter::NewDeclListener { … };
}
CompilerType ClangASTImporter::DeportType(TypeSystemClang &dst,
const CompilerType &src_type) { … }
clang::Decl *ClangASTImporter::DeportDecl(clang::ASTContext *dst_ctx,
clang::Decl *decl) { … }
bool ClangASTImporter::CanImport(const CompilerType &type) { … }
bool ClangASTImporter::Import(const CompilerType &type) { … }
bool ClangASTImporter::CompleteType(const CompilerType &compiler_type) { … }
template <class D, class O>
static bool ImportOffsetMap(clang::ASTContext *dest_ctx,
llvm::DenseMap<const D *, O> &destination_map,
llvm::DenseMap<const D *, O> &source_map,
ClangASTImporter &importer) { … }
template <bool IsVirtual>
bool ExtractBaseOffsets(const ASTRecordLayout &record_layout,
DeclFromUser<const CXXRecordDecl> &record,
llvm::DenseMap<const clang::CXXRecordDecl *,
clang::CharUnits> &base_offsets) { … }
bool ClangASTImporter::importRecordLayoutFromOrigin(
const RecordDecl *record, uint64_t &size, uint64_t &alignment,
llvm::DenseMap<const clang::FieldDecl *, uint64_t> &field_offsets,
llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits>
&base_offsets,
llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits>
&vbase_offsets) { … }
bool ClangASTImporter::LayoutRecordType(
const clang::RecordDecl *record_decl, uint64_t &bit_size,
uint64_t &alignment,
llvm::DenseMap<const clang::FieldDecl *, uint64_t> &field_offsets,
llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits>
&base_offsets,
llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits>
&vbase_offsets) { … }
void ClangASTImporter::SetRecordLayout(clang::RecordDecl *decl,
const LayoutInfo &layout) { … }
bool ClangASTImporter::CompleteTagDecl(clang::TagDecl *decl) { … }
bool ClangASTImporter::CompleteTagDeclWithOrigin(clang::TagDecl *decl,
clang::TagDecl *origin_decl) { … }
bool ClangASTImporter::CompleteObjCInterfaceDecl(
clang::ObjCInterfaceDecl *interface_decl) { … }
bool ClangASTImporter::CompleteAndFetchChildren(clang::QualType type) { … }
bool ClangASTImporter::RequireCompleteType(clang::QualType type) { … }
std::optional<ClangASTMetadata>
ClangASTImporter::GetDeclMetadata(const clang::Decl *decl) { … }
ClangASTImporter::DeclOrigin
ClangASTImporter::GetDeclOrigin(const clang::Decl *decl) { … }
void ClangASTImporter::SetDeclOrigin(const clang::Decl *decl,
clang::Decl *original_decl) { … }
void ClangASTImporter::RegisterNamespaceMap(const clang::NamespaceDecl *decl,
NamespaceMapSP &namespace_map) { … }
ClangASTImporter::NamespaceMapSP
ClangASTImporter::GetNamespaceMap(const clang::NamespaceDecl *decl) { … }
void ClangASTImporter::BuildNamespaceMap(const clang::NamespaceDecl *decl) { … }
void ClangASTImporter::ForgetDestination(clang::ASTContext *dst_ast) { … }
void ClangASTImporter::ForgetSource(clang::ASTContext *dst_ast,
clang::ASTContext *src_ast) { … }
ClangASTImporter::MapCompleter::~MapCompleter() = default;
llvm::Expected<Decl *>
ClangASTImporter::ASTImporterDelegate::ImportImpl(Decl *From) { … }
void ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(
clang::Decl *to, clang::Decl *from) { … }
static void MaybeCompleteReturnType(ClangASTImporter &importer,
CXXMethodDecl *to_method) { … }
static OptionalClangModuleID
RemapModule(OptionalClangModuleID from_id,
ClangExternalASTSourceCallbacks &from_source,
ClangExternalASTSourceCallbacks &to_source) { … }
void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from,
clang::Decl *to) { … }
clang::Decl *
ClangASTImporter::ASTImporterDelegate::GetOriginalDecl(clang::Decl *To) { … }