Skip to content

Commit 4d26faa

Browse files
committed
[LLDB][ClangExpression] Remove unused StructVars::m_object_pointer_type
This member variable was removed a while ago in 4434273. It was previously used in materialization code paths that have since been removed. Nowadays, `m_object_pointer_type` gets set but not used anywhere. This patch simply removes all remaining instances of it and any supporting code. **Testing** * API tests pass Differential Revision: https://reviews.llvm.org/D129367
1 parent 80e1735 commit 4d26faa

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp

-48
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,6 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) {
772772
return;
773773

774774
AddContextClassType(context, TypeFromUser(m_ctx_obj->GetCompilerType()));
775-
776-
m_struct_vars->m_object_pointer_type =
777-
TypeFromUser(ctx_obj_ptr->GetCompilerType());
778-
779775
return;
780776
}
781777

@@ -810,18 +806,6 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) {
810806
class_qual_type.getAsString());
811807

812808
AddContextClassType(context, class_user_type);
813-
814-
if (method_decl->isInstance()) {
815-
// self is a pointer to the object
816-
817-
QualType class_pointer_type =
818-
method_decl->getASTContext().getPointerType(class_qual_type);
819-
820-
TypeFromUser self_user_type(class_pointer_type.getAsOpaquePtr(),
821-
function_decl_ctx.GetTypeSystem());
822-
823-
m_struct_vars->m_object_pointer_type = self_user_type;
824-
}
825809
return;
826810
}
827811

@@ -852,8 +836,6 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) {
852836
ClangUtil::GetQualType(pointee_type).getAsString());
853837

854838
AddContextClassType(context, pointee_type);
855-
TypeFromUser this_user_type(this_type->GetFullCompilerType());
856-
m_struct_vars->m_object_pointer_type = this_user_type;
857839
}
858840
}
859841

@@ -869,10 +851,6 @@ void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
869851
return;
870852

871853
AddOneType(context, TypeFromUser(m_ctx_obj->GetCompilerType()));
872-
873-
m_struct_vars->m_object_pointer_type =
874-
TypeFromUser(ctx_obj_ptr->GetCompilerType());
875-
876854
return;
877855
}
878856

@@ -917,28 +895,6 @@ void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
917895
ClangUtil::ToString(interface_type));
918896

919897
AddOneType(context, class_user_type);
920-
921-
if (method_decl->isInstanceMethod()) {
922-
// self is a pointer to the object
923-
924-
QualType class_pointer_type =
925-
method_decl->getASTContext().getObjCObjectPointerType(
926-
QualType(interface_type, 0));
927-
928-
TypeFromUser self_user_type(class_pointer_type.getAsOpaquePtr(),
929-
function_decl_ctx.GetTypeSystem());
930-
931-
m_struct_vars->m_object_pointer_type = self_user_type;
932-
} else {
933-
// self is a Class pointer
934-
QualType class_type = method_decl->getASTContext().getObjCClassType();
935-
936-
TypeFromUser self_user_type(class_type.getAsOpaquePtr(),
937-
function_decl_ctx.GetTypeSystem());
938-
939-
m_struct_vars->m_object_pointer_type = self_user_type;
940-
}
941-
942898
return;
943899
}
944900
// This branch will get hit if we are executing code in the context of
@@ -981,10 +937,6 @@ void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
981937
TypeFromUser class_user_type(self_clang_type);
982938

983939
AddOneType(context, class_user_type);
984-
985-
TypeFromUser self_user_type(self_type->GetFullCompilerType());
986-
987-
m_struct_vars->m_object_pointer_type = self_user_type;
988940
}
989941

990942
void ClangExpressionDeclMap::LookupLocalVarNamespace(

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class ClangExpressionDeclMap : public ClangASTSource {
353353
/// The following values contain layout information for the materialized
354354
/// struct, but are not specific to a single materialization
355355
struct StructVars {
356-
StructVars() : m_result_name(), m_object_pointer_type(nullptr, nullptr) {}
356+
StructVars() = default;
357357

358358
lldb::offset_t m_struct_alignment =
359359
0; ///< The alignment of the struct in bytes.
@@ -364,8 +364,6 @@ class ClangExpressionDeclMap : public ClangASTSource {
364364
/// added since).
365365
ConstString
366366
m_result_name; ///< The name of the result variable ($1, for example)
367-
TypeFromUser m_object_pointer_type; ///< The type of the "this" variable, if
368-
///one exists
369367
};
370368

371369
std::unique_ptr<StructVars> m_struct_vars;

0 commit comments

Comments
 (0)