LLDB mainline
|
#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>
Go to the source code of this file.
Classes | |
class | DeclContextOverride |
struct | DeclContextOverride::Backup |
Functions | |
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) |
Copy layout information from source_map to the destination_map. | |
template<bool IsVirtual> | |
bool | ExtractBaseOffsets (const ASTRecordLayout &record_layout, DeclFromUser< const CXXRecordDecl > &record, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &base_offsets) |
Given a CXXRecordDecl, will calculate and populate base_offsets with the integral offsets of any of its (possibly virtual) base classes. | |
static void | MaybeCompleteReturnType (ClangASTImporter &importer, CXXMethodDecl *to_method) |
Takes a CXXMethodDecl and completes the return type if necessary. | |
static OptionalClangModuleID | RemapModule (OptionalClangModuleID from_id, ClangExternalASTSourceCallbacks &from_source, ClangExternalASTSourceCallbacks &to_source) |
Recreate a module with its parents in to_source and return its id. | |
bool ExtractBaseOffsets | ( | const ASTRecordLayout & | record_layout, |
DeclFromUser< const CXXRecordDecl > & | record, | ||
llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > & | base_offsets | ||
) |
Given a CXXRecordDecl, will calculate and populate base_offsets with the integral offsets of any of its (possibly virtual) base classes.
[in] | record_layout | ASTRecordLayout of record. |
[in] | record | The record that we're calculating the base layouts of. |
[out] | base_offsets | Map of base-class decl to integral offset which this function will fill in. |
Definition at line 581 of file ClangASTImporter.cpp.
References lldb_private::TaggedASTDecl< D >::decl, and lldb_private::TaggedASTDecl< D >::IsInvalid().
|
static |
Copy layout information from source_map to the destination_map.
In the process of copying over layout info, we may need to import decls from the source_map. This function will use the supplied importer to import the necessary decls into dest_ctx.
[in,out] | dest_ctx | Destination ASTContext into which we import decls from the source_map. |
[out] | destination_map | A map from decls in dest_ctx to an integral offest, which will be copies of the decl/offest pairs in source_map if successful. |
[in] | source_map | A map from decls to integral offests. These will be copied into destination_map. |
[in,out] | importer | Used to import decls into dest_ctx. |
Definition at line 542 of file ClangASTImporter.cpp.
References lldb_private::TaggedASTDecl< D >::decl, lldb_private::DeclFromUser< D >::Import(), and lldb_private::TaggedASTDecl< D >::IsInvalid().
Referenced by lldb_private::ClangASTImporter::importRecordLayoutFromOrigin().
|
static |
Takes a CXXMethodDecl and completes the return type if necessary.
This is currently only necessary for virtual functions with covariant return types where Clang's CodeGen expects that the underlying records are already completed.
Definition at line 1246 of file ClangASTImporter.cpp.
References lldb_private::ClangASTImporter::CompleteTagDecl().
Referenced by lldb_private::ClangASTImporter::ASTImporterDelegate::Imported().
|
static |
Recreate a module with its parents in to_source
and return its id.
Definition at line 1265 of file ClangASTImporter.cpp.
References lldb_private::ClangExternalASTSourceCallbacks::GetIDForModule(), lldb_private::ClangExternalASTSourceCallbacks::getModule(), lldb_private::TypeSystemClang::GetOrCreateClangModule(), lldb_private::ClangExternalASTSourceCallbacks::GetTypeSystem(), lldb_private::OptionalClangModuleID::GetValue(), lldb_private::OptionalClangModuleID::HasValue(), and RemapModule().
Referenced by lldb_private::ClangASTImporter::ASTImporterDelegate::Imported(), and RemapModule().