Skip to content

Commit 77d2f26

Browse files
committed
[lldb] Remove unused portion of GetFunctionMethodInfo signature (NFC)
This applies to IsClassMethod as well.
1 parent ab07fd9 commit 77d2f26

File tree

9 files changed

+21
-67
lines changed

9 files changed

+21
-67
lines changed

lldb/include/lldb/Symbol/CompilerDeclContext.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ class CompilerDeclContext {
6161

6262
/// Checks if this decl context represents a method of a class.
6363
///
64-
/// \param[out] language_ptr
65-
/// If non NULL and \b true is returned from this function,
66-
/// this will indicate if the language that respresents the method.
67-
///
68-
/// \param[out] is_instance_method_ptr
69-
/// If non NULL and \b true is returned from this function,
70-
/// this will indicate if the method is an instance function (true)
71-
/// or a class method (false indicating the function is static, or
72-
/// doesn't require an instance of the class to be called).
73-
///
7464
/// \param[out] language_object_name_ptr
7565
/// If non NULL and \b true is returned from this function,
7666
/// this will indicate if implicit object name for the language
@@ -79,9 +69,7 @@ class CompilerDeclContext {
7969
/// \return
8070
/// Returns true if this is a decl context that represents a method
8171
/// in a struct, union or class.
82-
bool IsClassMethod(lldb::LanguageType *language_ptr,
83-
bool *is_instance_method_ptr,
84-
ConstString *language_object_name_ptr);
72+
bool IsClassMethod(ConstString *language_object_name_ptr = nullptr);
8573

8674
/// Check if the given other decl context is contained in the lookup
8775
/// of this decl context (for example because the other context is a nested

lldb/include/lldb/Symbol/SymbolContext.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,23 +248,14 @@ class SymbolContext {
248248
/// If this symbol context represents a function that is a method, return
249249
/// true and provide information about the method.
250250
///
251-
/// \param[out] language
252-
/// If \b true is returned, the language for the method.
253-
///
254-
/// \param[out] is_instance_method
255-
/// If \b true is returned, \b true if this is a instance method,
256-
/// \b false if this is a static/class function.
257-
///
258251
/// \param[out] language_object_name
259252
/// If \b true is returned, the name of the artificial variable
260253
/// for the language ("this" for C++, "self" for ObjC).
261254
///
262255
/// \return
263256
/// \b True if this symbol context represents a function that
264257
/// is a method of a class, \b false otherwise.
265-
bool GetFunctionMethodInfo(lldb::LanguageType &language,
266-
bool &is_instance_method,
267-
ConstString &language_object_name);
258+
bool GetFunctionMethodInfo(ConstString &language_object_name);
268259

269260
/// Sorts the types in TypeMap according to SymbolContext to TypeList
270261
///

lldb/include/lldb/Symbol/TypeSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ class TypeSystem : public PluginInterface,
127127
virtual ConstString
128128
DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
129129

130-
virtual bool DeclContextIsClassMethod(
131-
void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
132-
bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
130+
virtual bool
131+
DeclContextIsClassMethod(void *opaque_decl_ctx,
132+
ConstString *language_object_name_ptr) = 0;
133133

134134
virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
135135
void *other_opaque_decl_ctx) = 0;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,7 @@ SymbolContextList ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(
11721172
// class/instance methods, since they'll be skipped in the code that
11731173
// follows anyway.
11741174
CompilerDeclContext func_decl_context = function->GetDeclContext();
1175-
if (!func_decl_context ||
1176-
func_decl_context.IsClassMethod(nullptr, nullptr, nullptr))
1175+
if (!func_decl_context || func_decl_context.IsClassMethod())
11771176
continue;
11781177
// We can only prune functions for which we can copy the type.
11791178
CompilerType func_clang_type = function->GetType()->GetFullCompilerType();
@@ -1307,7 +1306,7 @@ void ClangExpressionDeclMap::LookupFunction(
13071306
continue;
13081307

13091308
// Filter out class/instance methods.
1310-
if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
1309+
if (decl_ctx.IsClassMethod())
13111310
continue;
13121311

13131312
AddOneFunction(context, sym_ctx.function, nullptr);

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

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9751,36 +9751,25 @@ TypeSystemClang::DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) {
97519751
}
97529752

97539753
bool TypeSystemClang::DeclContextIsClassMethod(
9754-
void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
9755-
bool *is_instance_method_ptr, ConstString *language_object_name_ptr) {
9754+
void *opaque_decl_ctx, ConstString *language_object_name_ptr) {
97569755
if (opaque_decl_ctx) {
97579756
clang::DeclContext *decl_ctx = (clang::DeclContext *)opaque_decl_ctx;
97589757
if (ObjCMethodDecl *objc_method =
97599758
llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx)) {
9760-
if (is_instance_method_ptr)
9761-
*is_instance_method_ptr = objc_method->isInstanceMethod();
9762-
if (language_ptr)
9763-
*language_ptr = eLanguageTypeObjC;
9764-
if (language_object_name_ptr)
9765-
language_object_name_ptr->SetCString("self");
9759+
if (objc_method->isInstanceMethod())
9760+
if (language_object_name_ptr)
9761+
language_object_name_ptr->SetCString("self");
97669762
return true;
97679763
} else if (CXXMethodDecl *cxx_method =
97689764
llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx)) {
9769-
if (is_instance_method_ptr)
9770-
*is_instance_method_ptr = cxx_method->isInstance();
9771-
if (language_ptr)
9772-
*language_ptr = eLanguageTypeC_plus_plus;
9773-
if (language_object_name_ptr)
9774-
language_object_name_ptr->SetCString("this");
9765+
if (cxx_method->isInstance())
9766+
if (language_object_name_ptr)
9767+
language_object_name_ptr->SetCString("this");
97759768
return true;
97769769
} else if (clang::FunctionDecl *function_decl =
97779770
llvm::dyn_cast<clang::FunctionDecl>(decl_ctx)) {
97789771
ClangASTMetadata *metadata = GetMetadata(function_decl);
97799772
if (metadata && metadata->HasObjectPtr()) {
9780-
if (is_instance_method_ptr)
9781-
*is_instance_method_ptr = true;
9782-
if (language_ptr)
9783-
*language_ptr = eLanguageTypeObjC;
97849773
if (language_object_name_ptr)
97859774
language_object_name_ptr->SetCString(metadata->GetObjectPtrName());
97869775
return true;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,6 @@ class TypeSystemClang : public TypeSystem {
580580
ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override;
581581

582582
bool DeclContextIsClassMethod(void *opaque_decl_ctx,
583-
lldb::LanguageType *language_ptr,
584-
bool *is_instance_method_ptr,
585583
ConstString *language_object_name_ptr) override;
586584

587585
bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,

lldb/source/Symbol/CompilerDeclContext.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ ConstString CompilerDeclContext::GetScopeQualifiedName() const {
3434
return ConstString();
3535
}
3636

37-
bool CompilerDeclContext::IsClassMethod(lldb::LanguageType *language_ptr,
38-
bool *is_instance_method_ptr,
39-
ConstString *language_object_name_ptr) {
37+
bool CompilerDeclContext::IsClassMethod(ConstString *language_object_name_ptr) {
4038
if (IsValid())
41-
return m_type_system->DeclContextIsClassMethod(
42-
m_opaque_decl_ctx, language_ptr, is_instance_method_ptr,
43-
language_object_name_ptr);
39+
return m_type_system->DeclContextIsClassMethod(m_opaque_decl_ctx,
40+
language_object_name_ptr);
4441
return false;
4542
}
4643

lldb/source/Symbol/SymbolContext.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -539,17 +539,12 @@ Block *SymbolContext::GetFunctionBlock() {
539539
return nullptr;
540540
}
541541

542-
bool SymbolContext::GetFunctionMethodInfo(lldb::LanguageType &language,
543-
bool &is_instance_method,
544-
ConstString &language_object_name)
545-
546-
{
542+
bool SymbolContext::GetFunctionMethodInfo(ConstString &language_object_name) {
547543
Block *function_block = GetFunctionBlock();
548544
if (function_block) {
549545
CompilerDeclContext decl_ctx = function_block->GetDeclContext();
550546
if (decl_ctx)
551-
return decl_ctx.IsClassMethod(&language, &is_instance_method,
552-
&language_object_name);
547+
return decl_ctx.IsClassMethod(&language_object_name);
553548
}
554549
return false;
555550
}

lldb/source/Target/StackFrame.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,9 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
567567
// Check for direct ivars access which helps us with implicit access to
568568
// ivars using "this" or "self".
569569
GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);
570-
lldb::LanguageType method_language = eLanguageTypeUnknown;
571-
bool is_instance_method = false;
572570
ConstString method_object_name;
573-
if (m_sc.GetFunctionMethodInfo(method_language, is_instance_method,
574-
method_object_name)) {
575-
if (is_instance_method && method_object_name) {
571+
if (m_sc.GetFunctionMethodInfo(method_object_name)) {
572+
if (method_object_name) {
576573
var_sp = variable_list->FindVariable(method_object_name);
577574
if (var_sp) {
578575
separator_idx = 0;

0 commit comments

Comments
 (0)