LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lldb_private::ScratchTypeSystemClang Class Reference

The TypeSystemClang instance used for the scratch ASTContext in a lldb::Target. More...

#include <TypeSystemClang.h>

Inheritance diagram for lldb_private::ScratchTypeSystemClang:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::ScratchTypeSystemClang:
Collaboration graph
[legend]

Public Types

enum  IsolatedASTKind { CppModules }
 The different kinds of isolated ASTs within the scratch TypeSystem. More...
 
- Public Types inherited from lldb_private::TypeSystemClang
typedef void(* CompleteTagDeclCallback) (void *baton, clang::TagDecl *)
 
typedef void(* CompleteObjCInterfaceDeclCallback) (void *baton, clang::ObjCInterfaceDecl *)
 

Public Member Functions

 ScratchTypeSystemClang (Target &target, llvm::Triple triple)
 
 ~ScratchTypeSystemClang () override=default
 
void Finalize () override
 
void Dump (llvm::raw_ostream &output) override
 
UserExpressionGetUserExpression (llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj) override
 
FunctionCallerGetFunctionCaller (const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name) override
 
std::unique_ptr< UtilityFunctionCreateUtilityFunction (std::string text, std::string name) override
 
PersistentExpressionStateGetPersistentExpressionState () override
 
void ForgetSource (clang::ASTContext *src_ctx, ClangASTImporter &importer)
 Unregisters the given ASTContext as a source from the scratch AST (and all sub-ASTs). More...
 
bool isA (const void *ClassID) const override
 
- Public Member Functions inherited from lldb_private::TypeSystemClang
 TypeSystemClang (llvm::StringRef name, llvm::Triple triple)
 Constructs a TypeSystemClang with an ASTContext using the given triple. More...
 
 TypeSystemClang (llvm::StringRef name, clang::ASTContext &existing_ctxt)
 Constructs a TypeSystemClang that uses an existing ASTContext internally. More...
 
 ~TypeSystemClang () override
 
llvm::StringRef GetPluginName () override
 
llvm::StringRef getDisplayName () const
 Returns the display name of this TypeSystemClang that indicates what purpose it serves in LLDB. More...
 
clang::ASTContext & getASTContext ()
 Returns the clang::ASTContext instance managed by this TypeSystemClang. More...
 
clang::MangleContext * getMangleContext ()
 
std::shared_ptr< clang::TargetOptions > & getTargetOptions ()
 
clang::TargetInfo * getTargetInfo ()
 
void setSema (clang::Sema *s)
 
clang::Sema * getSema ()
 
const char * GetTargetTriple ()
 
void SetExternalSource (llvm::IntrusiveRefCntPtr< clang::ExternalASTSource > &ast_source_up)
 
bool GetCompleteDecl (clang::Decl *decl)
 
void SetMetadataAsUserID (const clang::Decl *decl, lldb::user_id_t user_id)
 
void SetMetadataAsUserID (const clang::Type *type, lldb::user_id_t user_id)
 
void SetMetadata (const clang::Decl *object, ClangASTMetadata &meta_data)
 
void SetMetadata (const clang::Type *object, ClangASTMetadata &meta_data)
 
ClangASTMetadataGetMetadata (const clang::Decl *object)
 
ClangASTMetadataGetMetadata (const clang::Type *object)
 
CompilerType GetBuiltinTypeForEncodingAndBitSize (lldb::Encoding encoding, size_t bit_size) override
 
CompilerType GetBasicType (lldb::BasicType type)
 
CompilerType GetBuiltinTypeForDWARFEncodingAndBitSize (llvm::StringRef type_name, uint32_t dw_ate, uint32_t bit_size)
 
CompilerType GetCStringType (bool is_const)
 
uint32_t GetPointerByteSize () override
 
clang::TranslationUnitDecl * GetTranslationUnitDecl ()
 
CompilerType GetType (clang::QualType qt)
 Creates a CompilerType form the given QualType with the current TypeSystemClang instance as the CompilerType's typesystem. More...
 
CompilerType GetTypeForDecl (clang::NamedDecl *decl)
 
CompilerType GetTypeForDecl (clang::TagDecl *decl)
 
CompilerType GetTypeForDecl (clang::ObjCInterfaceDecl *objc_decl)
 
template<typename RecordDeclType >
CompilerType GetTypeForIdentifier (ConstString type_name, clang::DeclContext *decl_context=nullptr)
 
CompilerType CreateStructForIdentifier (ConstString type_name, const std::initializer_list< std::pair< const char *, CompilerType >> &type_fields, bool packed=false)
 
CompilerType GetOrCreateStructForIdentifier (ConstString type_name, const std::initializer_list< std::pair< const char *, CompilerType >> &type_fields, bool packed=false)
 
OptionalClangModuleID GetOrCreateClangModule (llvm::StringRef name, OptionalClangModuleID parent, bool is_framework=false, bool is_explicit=false)
 Synthesize a clang::Module and return its ID or a default-constructed ID. More...
 
CompilerType CreateRecordType (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, llvm::StringRef name, int kind, lldb::LanguageType language, ClangASTMetadata *metadata=nullptr, bool exports_symbols=false)
 
clang::FunctionTemplateDecl * CreateFunctionTemplateDecl (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::FunctionDecl *func_decl, const TemplateParameterInfos &infos)
 
void CreateFunctionTemplateSpecializationInfo (clang::FunctionDecl *func_decl, clang::FunctionTemplateDecl *Template, const TemplateParameterInfos &infos)
 
clang::ClassTemplateDecl * CreateClassTemplateDecl (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, const char *class_name, int kind, const TemplateParameterInfos &infos)
 
clang::TemplateTemplateParmDecl * CreateTemplateTemplateParmDecl (const char *template_name)
 
clang::ClassTemplateSpecializationDecl * CreateClassTemplateSpecializationDecl (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::ClassTemplateDecl *class_template_decl, int kind, const TemplateParameterInfos &infos)
 
CompilerType CreateClassTemplateSpecializationType (clang::ClassTemplateSpecializationDecl *class_template_specialization_decl)
 
bool FieldIsBitfield (clang::FieldDecl *field, uint32_t &bitfield_bit_size)
 
CompilerType CreateObjCClass (llvm::StringRef name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, bool isForwardDecl, bool isInternal, ClangASTMetadata *metadata=nullptr)
 
clang::NamespaceDecl * GetUniqueNamespaceDeclaration (const char *name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, bool is_inline=false)
 
clang::FunctionDecl * CreateFunctionDeclaration (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, llvm::StringRef name, const CompilerType &function_Type, clang::StorageClass storage, bool is_inline)
 
CompilerType CreateFunctionType (const CompilerType &result_type, const CompilerType *args, unsigned num_args, bool is_variadic, unsigned type_quals, clang::CallingConv cc=clang::CC_C)
 
clang::ParmVarDecl * CreateParameterDeclaration (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, const char *name, const CompilerType &param_type, int storage, bool add_decl=false)
 
void SetFunctionParameters (clang::FunctionDecl *function_decl, llvm::ArrayRef< clang::ParmVarDecl * > params)
 
CompilerType CreateBlockPointerType (const CompilerType &function_type)
 
CompilerType CreateArrayType (const CompilerType &element_type, size_t element_count, bool is_vector)
 
CompilerType CreateEnumerationType (const char *name, clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, const Declaration &decl, const CompilerType &integer_qual_type, bool is_scoped)
 
CompilerType GetIntTypeFromBitSize (size_t bit_size, bool is_signed)
 
CompilerType GetPointerSizedIntType (bool is_signed)
 
DWARFASTParserGetDWARFParser () override
 
PDBASTParserGetPDBParser () override
 
void CompleteTagDecl (clang::TagDecl *)
 
void CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *)
 
bool LayoutRecordType (const clang::RecordDecl *record_decl, 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)
 
CompilerDecl GetCompilerDecl (clang::Decl *decl)
 Creates a CompilerDecl from the given Decl with the current TypeSystemClang instance as its typesystem. More...
 
ConstString DeclGetName (void *opaque_decl) override
 
ConstString DeclGetMangledName (void *opaque_decl) override
 
CompilerDeclContext DeclGetDeclContext (void *opaque_decl) override
 
CompilerType DeclGetFunctionReturnType (void *opaque_decl) override
 
size_t DeclGetFunctionNumArguments (void *opaque_decl) override
 
CompilerType DeclGetFunctionArgumentType (void *opaque_decl, size_t arg_idx) override
 
CompilerType GetTypeForDecl (void *opaque_decl) override
 
CompilerDeclContext CreateDeclContext (clang::DeclContext *ctx)
 Creates a CompilerDeclContext from the given DeclContext with the current TypeSystemClang instance as its typesystem. More...
 
std::vector< CompilerDeclDeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name, const bool ignore_using_decls) override
 
ConstString DeclContextGetName (void *opaque_decl_ctx) override
 
ConstString DeclContextGetScopeQualifiedName (void *opaque_decl_ctx) override
 
bool DeclContextIsClassMethod (void *opaque_decl_ctx, lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr) override
 
bool DeclContextIsContainedInLookup (void *opaque_decl_ctx, void *other_opaque_decl_ctx) override
 
bool Verify (lldb::opaque_compiler_type_t type) override
 Verify the integrity of the type to catch CompilerTypes that mix and match invalid TypeSystem/Opaque type pairs. More...
 
bool IsArrayType (lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, bool *is_incomplete) override
 
bool IsVectorType (lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size) override
 
bool IsAggregateType (lldb::opaque_compiler_type_t type) override
 
bool IsAnonymousType (lldb::opaque_compiler_type_t type) override
 
bool IsBeingDefined (lldb::opaque_compiler_type_t type) override
 
bool IsCharType (lldb::opaque_compiler_type_t type) override
 
bool IsCompleteType (lldb::opaque_compiler_type_t type) override
 
bool IsConst (lldb::opaque_compiler_type_t type) override
 
bool IsCStringType (lldb::opaque_compiler_type_t type, uint32_t &length) override
 
bool IsDefined (lldb::opaque_compiler_type_t type) override
 
bool IsFloatingPointType (lldb::opaque_compiler_type_t type, uint32_t &count, bool &is_complex) override
 
bool IsFunctionType (lldb::opaque_compiler_type_t type) override
 
uint32_t IsHomogeneousAggregate (lldb::opaque_compiler_type_t type, CompilerType *base_type_ptr) override
 
size_t GetNumberOfFunctionArguments (lldb::opaque_compiler_type_t type) override
 
CompilerType GetFunctionArgumentAtIndex (lldb::opaque_compiler_type_t type, const size_t index) override
 
bool IsFunctionPointerType (lldb::opaque_compiler_type_t type) override
 
bool IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override
 
bool IsIntegerType (lldb::opaque_compiler_type_t type, bool &is_signed) override
 
bool IsEnumerationType (lldb::opaque_compiler_type_t type, bool &is_signed) override
 
bool IsScopedEnumerationType (lldb::opaque_compiler_type_t type) override
 
bool IsPolymorphicClass (lldb::opaque_compiler_type_t type) override
 
bool IsPossibleDynamicType (lldb::opaque_compiler_type_t type, CompilerType *target_type, bool check_cplusplus, bool check_objc) override
 
bool IsRuntimeGeneratedType (lldb::opaque_compiler_type_t type) override
 
bool IsPointerType (lldb::opaque_compiler_type_t type, CompilerType *pointee_type) override
 
bool IsPointerOrReferenceType (lldb::opaque_compiler_type_t type, CompilerType *pointee_type) override
 
bool IsReferenceType (lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool *is_rvalue) override
 
bool IsScalarType (lldb::opaque_compiler_type_t type) override
 
bool IsTypedefType (lldb::opaque_compiler_type_t type) override
 
bool IsVoidType (lldb::opaque_compiler_type_t type) override
 
bool CanPassInRegisters (const CompilerType &type) override
 
bool SupportsLanguage (lldb::LanguageType language) override
 
bool GetCompleteType (lldb::opaque_compiler_type_t type) override
 
ConstString GetTypeName (lldb::opaque_compiler_type_t type) override
 
ConstString GetDisplayTypeName (lldb::opaque_compiler_type_t type) override
 
uint32_t GetTypeInfo (lldb::opaque_compiler_type_t type, CompilerType *pointee_or_element_compiler_type) override
 
lldb::LanguageType GetMinimumLanguage (lldb::opaque_compiler_type_t type) override
 
lldb::TypeClass GetTypeClass (lldb::opaque_compiler_type_t type) override
 
unsigned GetTypeQualifiers (lldb::opaque_compiler_type_t type) override
 
CompilerType GetArrayElementType (lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
 
CompilerType GetArrayType (lldb::opaque_compiler_type_t type, uint64_t size) override
 
CompilerType GetCanonicalType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetFullyUnqualifiedType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetEnumerationIntegerType (lldb::opaque_compiler_type_t type) override
 
int GetFunctionArgumentCount (lldb::opaque_compiler_type_t type) override
 
CompilerType GetFunctionArgumentTypeAtIndex (lldb::opaque_compiler_type_t type, size_t idx) override
 
CompilerType GetFunctionReturnType (lldb::opaque_compiler_type_t type) override
 
size_t GetNumMemberFunctions (lldb::opaque_compiler_type_t type) override
 
TypeMemberFunctionImpl GetMemberFunctionAtIndex (lldb::opaque_compiler_type_t type, size_t idx) override
 
CompilerType GetNonReferenceType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetPointeeType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetPointerType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetLValueReferenceType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetRValueReferenceType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetAtomicType (lldb::opaque_compiler_type_t type) override
 
CompilerType AddConstModifier (lldb::opaque_compiler_type_t type) override
 
CompilerType AddVolatileModifier (lldb::opaque_compiler_type_t type) override
 
CompilerType AddRestrictModifier (lldb::opaque_compiler_type_t type) override
 
CompilerType CreateTypedef (lldb::opaque_compiler_type_t type, const char *name, const CompilerDeclContext &decl_ctx, uint32_t opaque_payload) override
 Using the current type, create a new typedef to that type using "typedef_name" as the name and "decl_ctx" as the decl context. More...
 
CompilerType GetTypedefedType (lldb::opaque_compiler_type_t type) override
 
CompilerType GetBasicTypeFromAST (lldb::BasicType basic_type) override
 
const llvm::fltSemantics & GetFloatTypeSemantics (size_t byte_size) override
 
llvm::Optional< uint64_t > GetByteSize (lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope)
 
llvm::Optional< uint64_t > GetBitSize (lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
 
lldb::Encoding GetEncoding (lldb::opaque_compiler_type_t type, uint64_t &count) override
 
lldb::Format GetFormat (lldb::opaque_compiler_type_t type) override
 
llvm::Optional< size_t > GetTypeBitAlign (lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
 
uint32_t GetNumChildren (lldb::opaque_compiler_type_t type, bool omit_empty_base_classes, const ExecutionContext *exe_ctx) override
 
CompilerType GetBuiltinTypeByName (ConstString name) override
 
lldb::BasicType GetBasicTypeEnumeration (lldb::opaque_compiler_type_t type) override
 
void ForEachEnumerator (lldb::opaque_compiler_type_t type, std::function< bool(const CompilerType &integer_type, ConstString name, const llvm::APSInt &value)> const &callback) override
 
uint32_t GetNumFields (lldb::opaque_compiler_type_t type) override
 
CompilerType GetFieldAtIndex (lldb::opaque_compiler_type_t type, size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) override
 
uint32_t GetNumDirectBaseClasses (lldb::opaque_compiler_type_t type) override
 
uint32_t GetNumVirtualBaseClasses (lldb::opaque_compiler_type_t type) override
 
CompilerType GetDirectBaseClassAtIndex (lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) override
 
CompilerType GetVirtualBaseClassAtIndex (lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) override
 
CompilerType GetChildCompilerTypeAtIndex (lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds, std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset, uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset, bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj, uint64_t &language_flags) override
 
uint32_t GetIndexOfChildWithName (lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes) override
 
size_t GetIndexOfChildMemberWithName (lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes, std::vector< uint32_t > &child_indexes) override
 
size_t GetNumTemplateArguments (lldb::opaque_compiler_type_t type) override
 
lldb::TemplateArgumentKind GetTemplateArgumentKind (lldb::opaque_compiler_type_t type, size_t idx) override
 
CompilerType GetTypeTemplateArgument (lldb::opaque_compiler_type_t type, size_t idx) override
 
llvm::Optional< CompilerType::IntegralTemplateArgumentGetIntegralTemplateArgument (lldb::opaque_compiler_type_t type, size_t idx) override
 
CompilerType GetTypeForFormatters (void *type) override
 
uint32_t CountDeclLevels (clang::DeclContext *frame_decl_ctx, clang::DeclContext *child_decl_ctx, ConstString *child_name=nullptr, CompilerType *child_type=nullptr)
 
clang::CXXMethodDecl * AddMethodToCXXRecordType (lldb::opaque_compiler_type_t type, llvm::StringRef name, const char *mangled_name, const CompilerType &method_type, lldb::AccessType access, bool is_virtual, bool is_static, bool is_inline, bool is_explicit, bool is_attr_used, bool is_artificial)
 
void AddMethodOverridesForCXXRecordType (lldb::opaque_compiler_type_t type)
 
std::unique_ptr< clang::CXXBaseSpecifier > CreateBaseClassSpecifier (lldb::opaque_compiler_type_t type, lldb::AccessType access, bool is_virtual, bool base_of_class)
 
bool TransferBaseClasses (lldb::opaque_compiler_type_t type, std::vector< std::unique_ptr< clang::CXXBaseSpecifier >> bases)
 
clang::EnumConstantDecl * AddEnumerationValueToEnumerationType (const CompilerType &enum_type, const Declaration &decl, const char *name, int64_t enum_value, uint32_t enum_value_bit_size)
 
clang::EnumConstantDecl * AddEnumerationValueToEnumerationType (const CompilerType &enum_type, const Declaration &decl, const char *name, const llvm::APSInt &value)
 
CompilerType GetEnumerationIntegerType (CompilerType type)
 Returns the underlying integer type for an enum type. More...
 
LLVM_DUMP_METHOD void dump (lldb::opaque_compiler_type_t type) const override
 Convenience LLVM-style dump method for use in the debugger only. More...
 
void DumpFromSymbolFile (Stream &s, llvm::StringRef symbol_name)
 Dump clang AST types from the symbol file. More...
 
void DumpValue (lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) override
 
bool DumpTypeValue (lldb::opaque_compiler_type_t type, Stream *s, lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope) override
 
void DumpSummary (lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size) override
 
void DumpTypeDescription (lldb::opaque_compiler_type_t type, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) override
 Dump the type to stdout. More...
 
void DumpTypeDescription (lldb::opaque_compiler_type_t type, Stream *s, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) override
 Print a description of the type to a stream. More...
 
clang::ClassTemplateDecl * ParseClassTemplateDecl (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, lldb::AccessType access_type, const char *parent_name, int tag_decl_kind, const TypeSystemClang::TemplateParameterInfos &template_param_infos)
 
clang::BlockDecl * CreateBlockDeclaration (clang::DeclContext *ctx, OptionalClangModuleID owning_module)
 
clang::UsingDirectiveDecl * CreateUsingDirectiveDeclaration (clang::DeclContext *decl_ctx, OptionalClangModuleID owning_module, clang::NamespaceDecl *ns_decl)
 
clang::UsingDecl * CreateUsingDeclaration (clang::DeclContext *current_decl_ctx, OptionalClangModuleID owning_module, clang::NamedDecl *target)
 
clang::VarDecl * CreateVariableDeclaration (clang::DeclContext *decl_context, OptionalClangModuleID owning_module, const char *name, clang::QualType type)
 
clang::DeclarationName GetDeclarationName (llvm::StringRef name, const CompilerType &function_clang_type)
 
clang::LangOptions * GetLangOpts () const
 
clang::SourceManager * GetSourceMgr () const
 
- Public Member Functions inherited from lldb_private::TypeSystem
 ~TypeSystem () override
 
virtual SymbolFileGetSymbolFile () const
 
virtual void SetSymbolFile (SymbolFile *sym_file)
 
virtual bool ShouldTreatScalarValueAsAddress (lldb::opaque_compiler_type_t type)
 
virtual LazyBool ShouldPrintAsOneLiner (void *type, ValueObject *valobj)
 
virtual bool IsMeaninglessWithoutDynamicResolution (void *type)
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static llvm::Optional< IsolatedASTKindInferIsolatedASTKindFromLangOpts (const clang::LangOptions &l)
 Infers the appropriate sub-AST from Clang's LangOptions. More...
 
static TypeSystemClangGetForTarget (Target &target, llvm::Optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
 Returns the scratch TypeSystemClang for the given target. More...
 
static TypeSystemClangGetForTarget (Target &target, const clang::LangOptions &lang_opts)
 Returns the scratch TypeSystemClang for the given target. More...
 
static bool classof (const TypeSystem *ts)
 
- Static Public Member Functions inherited from lldb_private::TypeSystemClang
static bool classof (const TypeSystem *ts)
 
static ConstString GetPluginNameStatic ()
 
static lldb::TypeSystemSP CreateInstance (lldb::LanguageType language, Module *module, Target *target)
 
static LanguageSet GetSupportedLanguagesForTypes ()
 
static LanguageSet GetSupportedLanguagesForExpressions ()
 
static void Initialize ()
 
static void Terminate ()
 
static TypeSystemClangGetASTContext (clang::ASTContext *ast_ctx)
 
static void DumpDeclHiearchy (clang::Decl *decl)
 
static void DumpDeclContextHiearchy (clang::DeclContext *decl_ctx)
 
static bool DeclsAreEquivalent (clang::Decl *lhs_decl, clang::Decl *rhs_decl)
 
static bool GetCompleteDecl (clang::ASTContext *ast, clang::Decl *decl)
 
static lldb::BasicType GetBasicTypeEnumeration (ConstString name)
 
static clang::DeclContext * GetDeclContextForType (clang::QualType type)
 
static clang::DeclContext * GetDeclContextForType (const CompilerType &type)
 
static bool AreTypesSame (CompilerType type1, CompilerType type2, bool ignore_qualifiers=false)
 
static bool IsOperator (llvm::StringRef name, clang::OverloadedOperatorKind &op_kind)
 
static clang::AccessSpecifier ConvertAccessTypeToAccessSpecifier (lldb::AccessType access)
 
static clang::AccessSpecifier UnifyAccessSpecifiers (clang::AccessSpecifier lhs, clang::AccessSpecifier rhs)
 
static uint32_t GetNumBaseClasses (const clang::CXXRecordDecl *cxx_record_decl, bool omit_empty_base_classes)
 
static clang::DeclContext * GetAsDeclContext (clang::FunctionDecl *function_decl)
 
static bool CheckOverloadedOperatorKindParameterCount (bool is_method, clang::OverloadedOperatorKind op_kind, uint32_t num_params)
 
static bool RecordHasFields (const clang::RecordDecl *record_decl)
 
static CompilerType GetFloatTypeFromBitSize (clang::ASTContext *ast, size_t bit_size)
 
static void SetOwningModule (clang::Decl *decl, OptionalClangModuleID owning_module)
 Set the owning module for decl. More...
 
static clang::DeclContext * DeclContextGetAsDeclContext (const CompilerDeclContext &dc)
 
static clang::ObjCMethodDecl * DeclContextGetAsObjCMethodDecl (const CompilerDeclContext &dc)
 
static clang::CXXMethodDecl * DeclContextGetAsCXXMethodDecl (const CompilerDeclContext &dc)
 
static clang::FunctionDecl * DeclContextGetAsFunctionDecl (const CompilerDeclContext &dc)
 
static clang::NamespaceDecl * DeclContextGetAsNamespaceDecl (const CompilerDeclContext &dc)
 
static ClangASTMetadataDeclContextGetMetaData (const CompilerDeclContext &dc, const clang::Decl *object)
 
static clang::ASTContext * DeclContextGetTypeSystemClang (const CompilerDeclContext &dc)
 
static bool IsCXXClassType (const CompilerType &type)
 
static bool IsObjCClassType (const CompilerType &type)
 
static bool IsObjCClassTypeAndHasIVars (const CompilerType &type, bool check_superclass)
 
static bool IsObjCObjectOrInterfaceType (const CompilerType &type)
 
static bool IsObjCObjectPointerType (const CompilerType &type, CompilerType *target_type=nullptr)
 
static bool IsClassType (lldb::opaque_compiler_type_t type)
 
static bool IsEnumType (lldb::opaque_compiler_type_t type)
 
static llvm::Optional< std::stringGetCXXClassName (const CompilerType &type)
 
static lldb::BasicType GetBasicTypeEnumeration (lldb::opaque_compiler_type_t type, ConstString name)
 
static uint32_t GetNumPointeeChildren (clang::QualType type)
 
static clang::FieldDecl * AddFieldToRecordType (const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, lldb::AccessType access, uint32_t bitfield_bit_size)
 
static void BuildIndirectFields (const CompilerType &type)
 
static void SetIsPacked (const CompilerType &type)
 
static clang::VarDecl * AddVariableToRecordType (const CompilerType &type, llvm::StringRef name, const CompilerType &var_type, lldb::AccessType access)
 
static void SetIntegerInitializerForVariable (clang::VarDecl *var, const llvm::APInt &init_value)
 Initializes a variable with an integer value. More...
 
static void SetFloatingInitializerForVariable (clang::VarDecl *var, const llvm::APFloat &init_value)
 Initializes a variable with a floating point value. More...
 
static bool SetObjCSuperClass (const CompilerType &type, const CompilerType &superclass_compiler_type)
 
static bool AddObjCClassProperty (const CompilerType &type, const char *property_name, const CompilerType &property_compiler_type, clang::ObjCIvarDecl *ivar_decl, const char *property_setter_name, const char *property_getter_name, uint32_t property_attributes, ClangASTMetadata *metadata)
 
static clang::ObjCMethodDecl * AddMethodToObjCObjectType (const CompilerType &type, const char *name, const CompilerType &method_compiler_type, lldb::AccessType access, bool is_artificial, bool is_variadic, bool is_objc_direct_call)
 
static bool SetHasExternalStorage (lldb::opaque_compiler_type_t type, bool has_extern)
 
static bool StartTagDeclarationDefinition (const CompilerType &type)
 
static bool CompleteTagDeclarationDefinition (const CompilerType &type)
 
static CompilerType CreateMemberPointerType (const CompilerType &type, const CompilerType &pointee_type)
 
static void DumpTypeName (const CompilerType &type)
 
static clang::EnumDecl * GetAsEnumDecl (const CompilerType &type)
 
static clang::RecordDecl * GetAsRecordDecl (const CompilerType &type)
 
static clang::TagDecl * GetAsTagDecl (const CompilerType &type)
 
static clang::TypedefNameDecl * GetAsTypedefDecl (const CompilerType &type)
 
static clang::CXXRecordDecl * GetAsCXXRecordDecl (lldb::opaque_compiler_type_t type)
 
static clang::ObjCInterfaceDecl * GetAsObjCInterfaceDecl (const CompilerType &type)
 
static lldb::opaque_compiler_type_t GetOpaqueCompilerType (clang::ASTContext *ast, lldb::BasicType basic_type)
 
static clang::QualType GetQualType (lldb::opaque_compiler_type_t type)
 
static clang::QualType GetCanonicalQualType (lldb::opaque_compiler_type_t type)
 
- Static Public Member Functions inherited from lldb_private::TypeSystem
static lldb::TypeSystemSP CreateInstance (lldb::LanguageType language, Module *module)
 
static lldb::TypeSystemSP CreateInstance (lldb::LanguageType language, Target *target)
 

Static Public Attributes

static const llvm::NoneType DefaultAST = llvm::None
 Alias for requesting the default scratch TypeSystemClang in GetForTarget. More...
 

Private Types

typedef int IsolatedASTKey
 

Private Member Functions

std::unique_ptr< ClangASTSourceCreateASTSource ()
 
TypeSystemClangGetIsolatedAST (IsolatedASTKind feature)
 Returns the requested sub-AST. More...
 

Private Attributes

llvm::Triple m_triple
 The target triple. More...
 
lldb::TargetWP m_target_wp
 
std::unique_ptr< ClangPersistentVariablesm_persistent_variables
 The persistent variables associated with this process for the expression parser. More...
 
std::unique_ptr< ClangASTSourcem_scratch_ast_source_up
 The ExternalASTSource that performs lookups and completes minimally imported types. More...
 
std::unordered_map< IsolatedASTKey, std::unique_ptr< TypeSystemClang > > m_isolated_asts
 Map from IsolatedASTKind to their actual TypeSystemClang instance. More...
 

Static Private Attributes

static char ID
 LLVM RTTI support. More...
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::TypeSystem
SymbolFilem_sym_file = nullptr
 

Detailed Description

The TypeSystemClang instance used for the scratch ASTContext in a lldb::Target.

Definition at line 1101 of file TypeSystemClang.h.

Member Typedef Documentation

◆ IsolatedASTKey

Definition at line 1216 of file TypeSystemClang.h.

Member Enumeration Documentation

◆ IsolatedASTKind

The different kinds of isolated ASTs within the scratch TypeSystem.

These ASTs are isolated from the main scratch AST and are each dedicated to a special language option/feature that makes the contained AST nodes incompatible with other AST nodes.

Enumerator
CppModules 

The isolated AST for declarations/types from expressions that imported type information from a C++ module.

The templates from a C++ module often conflict with the templates we generate from debug information, so we put these types in their own AST.

Definition at line 1117 of file TypeSystemClang.h.

Constructor & Destructor Documentation

◆ ScratchTypeSystemClang()

ScratchTypeSystemClang::ScratchTypeSystemClang ( Target target,
llvm::Triple  triple 
)

◆ ~ScratchTypeSystemClang()

lldb_private::ScratchTypeSystemClang::~ScratchTypeSystemClang ( )
overridedefault

Member Function Documentation

◆ classof()

static bool lldb_private::ScratchTypeSystemClang::classof ( const TypeSystem ts)
inlinestatic

Definition at line 1195 of file TypeSystemClang.h.

References ID, and lldb_private::TypeSystem::isA().

◆ CreateASTSource()

std::unique_ptr< ClangASTSource > ScratchTypeSystemClang::CreateASTSource ( )
private

Definition at line 9836 of file TypeSystemClang.cpp.

References m_persistent_variables, and m_target_wp.

Referenced by GetIsolatedAST(), and ScratchTypeSystemClang().

◆ CreateUtilityFunction()

std::unique_ptr< UtilityFunction > ScratchTypeSystemClang::CreateUtilityFunction ( std::string  text,
std::string  name 
)
overridevirtual

Reimplemented from lldb_private::TypeSystem.

Definition at line 9811 of file TypeSystemClang.cpp.

References m_target_wp.

◆ Dump()

void ScratchTypeSystemClang::Dump ( llvm::raw_ostream &  output)
overridevirtual

◆ Finalize()

void ScratchTypeSystemClang::Finalize ( )
overridevirtual

◆ ForgetSource()

void ScratchTypeSystemClang::ForgetSource ( clang::ASTContext *  src_ctx,
ClangASTImporter importer 
)

Unregisters the given ASTContext as a source from the scratch AST (and all sub-ASTs).

See also
ClangASTImporter::ForgetSource

Definition at line 9827 of file TypeSystemClang.cpp.

References lldb_private::ClangASTImporter::ForgetSource(), lldb_private::TypeSystemClang::getASTContext(), and m_isolated_asts.

Referenced by lldb_private::ClangASTSource::~ClangASTSource().

◆ GetForTarget() [1/2]

static TypeSystemClang* lldb_private::ScratchTypeSystemClang::GetForTarget ( Target target,
const clang::LangOptions &  lang_opts 
)
inlinestatic

Returns the scratch TypeSystemClang for the given target.

The returned TypeSystemClang will be the scratch AST or a sub-AST, depending on which fits best to the passed LangOptions.

Parameters
targetThe Target which scratch TypeSystemClang should be returned.
lang_optsThe LangOptions of a clang ASTContext that the caller wants to export type information from. This is used to find the best matching sub-AST that will be returned.

Definition at line 1161 of file TypeSystemClang.h.

References GetForTarget(), and InferIsolatedASTKindFromLangOpts().

◆ GetForTarget() [2/2]

TypeSystemClang * ScratchTypeSystemClang::GetForTarget ( Target target,
llvm::Optional< IsolatedASTKind ast_kind = DefaultAST,
bool  create_on_demand = true 
)
static

Returns the scratch TypeSystemClang for the given target.

Parameters
targetThe Target which scratch TypeSystemClang should be returned.
ast_kindAllows requesting a specific sub-AST instead of the default scratch AST. See also IsolatedASTKind.
create_on_demandIf the scratch TypeSystemClang instance can be created by this call if it doesn't exist yet. If it doesn't exist yet and this parameter is false, this function returns a nullptr.
Returns
The scratch type system of the target or a nullptr in case an error occurred.

Definition at line 9729 of file TypeSystemClang.cpp.

References DefaultAST, lldb::eLanguageTypeC, GetIsolatedAST(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::Target::GetScratchTypeSystemForLanguage(), LIBLLDB_LOG_TARGET, and LLDB_LOG_ERROR.

Referenced by lldb_private::ASTResultSynthesizer::CommitPersistentDecls(), lldb_private::formatters::GenericNSArrayISyntheticFrontEnd< D32, D64, Inline >::GenericNSArrayISyntheticFrontEnd(), lldb_private::AppleObjCRuntime::GetBacktraceThreadFromException(), lldb_private::formatters::NSArray1SyntheticFrontEnd::GetChildAtIndex(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::GetClassInfoUtilityFunctionImpl(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::GetClassInfoUtilityFunctionImpl(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), GetForTarget(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), GetLLDBNSPairType(), lldb_private::AppleObjCRuntime::GetObjectDescription(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), lldb_private::ClangExpressionDeclMap::GetPersistentDecl(), lldb_private::ClangExpressionDeclMap::GetScratchContext(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), lldb_private::DynamicLoaderDarwin::GetThreadLocalData(), lldb_private::formatters::LibcxxWStringSummaryProvider(), lldb_private::formatters::NSArrayMSyntheticFrontEndBase::NSArrayMSyntheticFrontEndBase(), ObjCExceptionRecognizedStackFrame::ObjCExceptionRecognizedStackFrame(), lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines(), lldb_private::AppleObjCTrampolineHandler::SetupDispatchFunction(), lldb_private::AppleGetPendingItemsHandler::SetupGetPendingItemsFunction(), lldb_private::AppleGetQueuesHandler::SetupGetQueuesFunction(), lldb_private::AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::ClangExpressionDeclMap::WillParse(), and lldb_private::ClangASTSource::~ClangASTSource().

◆ GetFunctionCaller()

FunctionCaller * ScratchTypeSystemClang::GetFunctionCaller ( const CompilerType return_type,
const Address function_address,
const ValueList arg_value_list,
const char *  name 
)
overridevirtual

Reimplemented from lldb_private::TypeSystem.

Definition at line 9795 of file TypeSystemClang.cpp.

References m_target_wp.

◆ GetIsolatedAST()

TypeSystemClang & ScratchTypeSystemClang::GetIsolatedAST ( ScratchTypeSystemClang::IsolatedASTKind  feature)
private

Returns the requested sub-AST.

Will lazily create the sub-AST if it hasn't been created before.

Definition at line 9851 of file TypeSystemClang.cpp.

References CreateASTSource(), GetSpecializedASTName(), m_isolated_asts, and m_triple.

Referenced by GetForTarget().

◆ GetPersistentExpressionState()

PersistentExpressionState * ScratchTypeSystemClang::GetPersistentExpressionState ( )
overridevirtual

Reimplemented from lldb_private::TypeSystem.

Definition at line 9823 of file TypeSystemClang.cpp.

References m_persistent_variables.

◆ GetUserExpression()

UserExpression * ScratchTypeSystemClang::GetUserExpression ( llvm::StringRef  expr,
llvm::StringRef  prefix,
lldb::LanguageType  language,
Expression::ResultType  desired_type,
const EvaluateExpressionOptions options,
ValueObject ctx_obj 
)
overridevirtual

Reimplemented from lldb_private::TypeSystem.

Definition at line 9783 of file TypeSystemClang.cpp.

References m_target_wp.

◆ InferIsolatedASTKindFromLangOpts()

static llvm::Optional<IsolatedASTKind> lldb_private::ScratchTypeSystemClang::InferIsolatedASTKindFromLangOpts ( const clang::LangOptions &  l)
inlinestatic

Infers the appropriate sub-AST from Clang's LangOptions.

Definition at line 1132 of file TypeSystemClang.h.

References DefaultAST.

Referenced by GetForTarget().

◆ isA()

bool lldb_private::ScratchTypeSystemClang::isA ( const void *  ClassID) const
inlineoverridevirtual

Reimplemented from lldb_private::TypeSystemClang.

Definition at line 1192 of file TypeSystemClang.h.

References ID, and lldb_private::TypeSystemClang::isA().

Member Data Documentation

◆ DefaultAST

const llvm::NoneType ScratchTypeSystemClang::DefaultAST = llvm::None
static

Alias for requesting the default scratch TypeSystemClang in GetForTarget.

Definition at line 1128 of file TypeSystemClang.h.

Referenced by GetForTarget(), InferIsolatedASTKindFromLangOpts(), and lldb_private::ClangASTSource::~ClangASTSource().

◆ ID

char ScratchTypeSystemClang::ID
staticprivate

LLVM RTTI support.

Definition at line 1103 of file TypeSystemClang.h.

Referenced by classof(), and isA().

◆ m_isolated_asts

std::unordered_map<IsolatedASTKey, std::unique_ptr<TypeSystemClang> > lldb_private::ScratchTypeSystemClang::m_isolated_asts
private

Map from IsolatedASTKind to their actual TypeSystemClang instance.

This map is lazily filled with sub-ASTs and should be accessed via GetSubAST (which lazily fills this map).

Definition at line 1222 of file TypeSystemClang.h.

Referenced by Dump(), ForgetSource(), and GetIsolatedAST().

◆ m_persistent_variables

std::unique_ptr<ClangPersistentVariables> lldb_private::ScratchTypeSystemClang::m_persistent_variables
private

The persistent variables associated with this process for the expression parser.

Definition at line 1210 of file TypeSystemClang.h.

Referenced by CreateASTSource(), and GetPersistentExpressionState().

◆ m_scratch_ast_source_up

std::unique_ptr<ClangASTSource> lldb_private::ScratchTypeSystemClang::m_scratch_ast_source_up
private

The ExternalASTSource that performs lookups and completes minimally imported types.

Definition at line 1213 of file TypeSystemClang.h.

Referenced by Finalize(), and ScratchTypeSystemClang().

◆ m_target_wp

lldb::TargetWP lldb_private::ScratchTypeSystemClang::m_target_wp
private

◆ m_triple

llvm::Triple lldb_private::ScratchTypeSystemClang::m_triple
private

The target triple.

This was potentially adjusted and might not be identical to the triple of m_target_wp.

Definition at line 1206 of file TypeSystemClang.h.

Referenced by GetIsolatedAST().


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