This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6bd46e713c6d: [lldb][TypeSystemClang] Use the CXXFunctionPointerSummaryProvider for member… (authored by Michael137).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145242/new/ https://reviews.llvm.org/D145242 Files: lldb/include/lldb/Symbol/CompilerType.h lldb/include/lldb/Symbol/TypeSystem.h lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h lldb/source/Symbol/CompilerType.cpp lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
Index: lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py =================================================================== --- lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -292,7 +292,9 @@ substrs=['member_ptr = 0x']) self.expect( "frame variable member_func_ptr", - substrs=['member_func_ptr = 0x']) + substrs=['member_func_ptr = 0x', + '(a.out`IUseCharStar::member_func(int) at main.cpp:61)']) self.expect( "frame variable ref_to_member_func_ptr", - substrs=['ref_to_member_func_ptr = 0x']) + substrs=['ref_to_member_func_ptr = 0x', + '(a.out`IUseCharStar::member_func(int) at main.cpp:61)']) Index: lldb/source/Symbol/CompilerType.cpp =================================================================== --- lldb/source/Symbol/CompilerType.cpp +++ lldb/source/Symbol/CompilerType.cpp @@ -154,6 +154,13 @@ return false; } +bool CompilerType::IsMemberFunctionPointerType() const { + if (IsValid()) + if (auto type_system_sp = GetTypeSystem()) + return type_system_sp->IsMemberFunctionPointerType(m_type); + return false; +} + bool CompilerType::IsBlockPointerType( CompilerType *function_pointer_type_ptr) const { if (IsValid()) Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h @@ -658,6 +658,8 @@ bool IsFunctionPointerType(lldb::opaque_compiler_type_t type) override; + bool IsMemberFunctionPointerType(lldb::opaque_compiler_type_t type) override; + bool IsBlockPointerType(lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override; Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -3194,6 +3194,15 @@ return false; } +bool TypeSystemClang::IsMemberFunctionPointerType( + lldb::opaque_compiler_type_t type) { + auto isMemberFunctionPointerType = [](clang::QualType qual_type) { + return qual_type->isMemberFunctionPointerType(); + }; + + return IsTypeImpl(type, isMemberFunctionPointerType); +} + bool TypeSystemClang::IsFunctionPointerType(lldb::opaque_compiler_type_t type) { auto isFunctionPointerType = [](clang::QualType qual_type) { return qual_type->isFunctionPointerType(); Index: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1390,7 +1390,8 @@ TypeSummaryImpl::Flags(), lldb_private::formatters::CXXFunctionPointerSummaryProvider, "Function pointer summary provider")); - if (valobj.GetCompilerType().IsFunctionPointerType()) { + if (CompilerType CT = valobj.GetCompilerType(); + CT.IsFunctionPointerType() || CT.IsMemberFunctionPointerType()) { return formatter_sp; } return nullptr; Index: lldb/include/lldb/Symbol/TypeSystem.h =================================================================== --- lldb/include/lldb/Symbol/TypeSystem.h +++ lldb/include/lldb/Symbol/TypeSystem.h @@ -169,6 +169,9 @@ virtual bool IsFunctionPointerType(lldb::opaque_compiler_type_t type) = 0; + virtual bool + IsMemberFunctionPointerType(lldb::opaque_compiler_type_t type) = 0; + virtual bool IsBlockPointerType(lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) = 0; Index: lldb/include/lldb/Symbol/CompilerType.h =================================================================== --- lldb/include/lldb/Symbol/CompilerType.h +++ lldb/include/lldb/Symbol/CompilerType.h @@ -164,6 +164,8 @@ bool IsFunctionPointerType() const; + bool IsMemberFunctionPointerType() const; + bool IsBlockPointerType(CompilerType *function_pointer_type_ptr = nullptr) const;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits