Skip to content

Commit ac813b4

Browse files
committed
Add and use ShouldIgnoreArtificialField API to ignore the indeed artificial
members we should ignore.
1 parent 2ff56f1 commit ac813b4

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,10 +3059,8 @@ void DWARFASTParserClang::ParseSingleMember(
30593059
// This needs to be done after updating FieldInfo which keeps track of where
30603060
// field start/end so we don't later try to fill the space of this
30613061
// artificial member with (unnamed bitfield) padding.
3062-
// FIXME: This check should verify that this is indeed an artificial member
3063-
// we are supposed to ignore.
30643062
if (attrs.is_artificial &&
3065-
!TypeSystemClang::IsCoroutineFrameType(class_clang_type)) {
3063+
TypeSystemClang::ShouldIgnoreArtificialField(attrs.name)) {
30663064
last_field_info.SetIsArtificial(true);
30673065
return;
30683066
}

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,8 @@ TypeSystemClang *TypeSystemClang::GetASTContext(clang::ASTContext *ast) {
771771
return clang_ast;
772772
}
773773

774-
bool TypeSystemClang::IsCoroutineFrameType(const CompilerType &Type) {
775-
return Type.GetTypeName().GetStringRef().ends_with(".coro_frame_ty");
774+
bool TypeSystemClang::ShouldIgnoreArtificialField(llvm::StringRef Name) {
775+
return Name.starts_with("_vptr$");
776776
}
777777

778778
clang::MangleContext *TypeSystemClang::getMangleContext() {

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ class TypeSystemClang : public TypeSystem {
154154

155155
static TypeSystemClang *GetASTContext(clang::ASTContext *ast_ctx);
156156

157-
// Returns true if the given type is a coroutine frame debug type.
158-
static bool IsCoroutineFrameType(const CompilerType &Type);
157+
// Returns true if the given artificial field name should be ignored when
158+
// parsing the DWARF.
159+
static bool ShouldIgnoreArtificialField(llvm::StringRef FieldName);
159160

160161
/// Returns the display name of this TypeSystemClang that indicates what
161162
/// purpose it serves in LLDB. Used for example in logs.

0 commit comments

Comments
 (0)