bool IsFunctionPointerType() const;
+ bool IsMemberFunctionPointerType() const;
+
bool
IsBlockPointerType(CompilerType *function_pointer_type_ptr = nullptr) const;
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;
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;
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();
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;
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())
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)'])