[Lldb-commits] [PATCH] D100977: [lldb] Use forward type in pointer-to-member
Emre Kultursay via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 21 23:31:03 PDT 2021
emrekultursay updated this revision to Diff 339485.
emrekultursay added a comment.
Fix formatting.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100977/new/
https://reviews.llvm.org/D100977
Files:
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py
lldb/test/API/functionalities/lazy-loading/main.cpp
Index: lldb/test/API/functionalities/lazy-loading/main.cpp
===================================================================
--- lldb/test/API/functionalities/lazy-loading/main.cpp
+++ lldb/test/API/functionalities/lazy-loading/main.cpp
@@ -26,6 +26,7 @@
struct StaticClassMember { int i; };
struct UnusedClassMember { int i; };
struct UnusedClassMemberPtr { int i; };
+struct PointerToMember { int i; };
namespace NS {
class ClassInNamespace {
@@ -36,6 +37,7 @@
int dummy; // Prevent bug where LLDB always completes first member.
ClassMember member;
static StaticClassMember static_member;
+ int (PointerToMember::*ptr_to_member);
UnusedClassMember unused_member;
UnusedClassMemberPtr *unused_member_ptr;
int enteredFunction() {
Index: lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py
===================================================================
--- lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py
+++ lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py
@@ -41,6 +41,7 @@
class_we_enter_decl = [class_decl_kind, "ClassWeEnter"]
class_member_decl = [struct_decl_kind, "ClassMember"]
class_static_member_decl = [struct_decl_kind, "StaticClassMember"]
+ class_pointer_to_member_decl = [struct_decl_kind, "PointerToMember"]
unused_class_member_decl = [struct_decl_kind, "UnusedClassMember"]
unused_class_member_ptr_decl = [struct_decl_kind, "UnusedClassMemberPtr"]
@@ -58,6 +59,7 @@
self.assert_decl_not_loaded(self.class_in_namespace_decl)
self.assert_decl_not_loaded(self.class_member_decl)
self.assert_decl_not_loaded(self.class_static_member_decl)
+ self.assert_decl_not_loaded(self.class_pointer_to_member_decl)
self.assert_decl_not_loaded(self.unused_class_member_decl)
def get_ast_dump(self):
@@ -232,6 +234,8 @@
self.assert_decl_loaded(self.class_member_decl)
# We didn't load the type of the unused static member.
self.assert_decl_not_completed(self.class_static_member_decl)
+ # We didn't load the type of the unused pointer-to-member member.
+ self.assert_decl_not_completed(self.class_pointer_to_member_decl)
# This should not have loaded anything else.
self.assert_decl_not_loaded(self.other_struct_decl)
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1357,7 +1357,7 @@
dwarf->ResolveTypeUID(attrs.containing_type.Reference(), true);
CompilerType pointee_clang_type = pointee_type->GetForwardCompilerType();
- CompilerType class_clang_type = class_type->GetLayoutCompilerType();
+ CompilerType class_clang_type = class_type->GetForwardCompilerType();
CompilerType clang_type = TypeSystemClang::CreateMemberPointerType(
class_clang_type, pointee_clang_type);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100977.339485.patch
Type: text/x-patch
Size: 3030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210422/747e6f6d/attachment-0001.bin>
More information about the lldb-commits
mailing list