Skip to content

Commit 0fd328d

Browse files
committed
[lldb] Remove unused portion of GetFunctionMethodInfo signature (NFC)
This applies to IsClassMethod as well. (cherry picked from commit 77d2f26)
1 parent 3ef617c commit 0fd328d

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
@@ -131,9 +131,9 @@ class TypeSystem : public PluginInterface,
131131
virtual ConstString
132132
DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
133133

134-
virtual bool DeclContextIsClassMethod(
135-
void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
136-
bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
134+
virtual bool
135+
DeclContextIsClassMethod(void *opaque_decl_ctx,
136+
ConstString *language_object_name_ptr) = 0;
137137

138138
virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
139139
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
@@ -1173,8 +1173,7 @@ SymbolContextList ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(
11731173
// class/instance methods, since they'll be skipped in the code that
11741174
// follows anyway.
11751175
CompilerDeclContext func_decl_context = function->GetDeclContext();
1176-
if (!func_decl_context ||
1177-
func_decl_context.IsClassMethod(nullptr, nullptr, nullptr))
1176+
if (!func_decl_context || func_decl_context.IsClassMethod())
11781177
continue;
11791178
// We can only prune functions for which we can copy the type.
11801179
CompilerType func_clang_type = function->GetType()->GetFullCompilerType();
@@ -1308,7 +1307,7 @@ void ClangExpressionDeclMap::LookupFunction(
13081307
continue;
13091308

13101309
// Filter out class/instance methods.
1311-
if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
1310+
if (decl_ctx.IsClassMethod())
13121311
continue;
13131312

13141313
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
@@ -9722,36 +9722,25 @@ TypeSystemClang::DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) {
97229722
}
97239723

97249724
bool TypeSystemClang::DeclContextIsClassMethod(
9725-
void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
9726-
bool *is_instance_method_ptr, ConstString *language_object_name_ptr) {
9725+
void *opaque_decl_ctx, ConstString *language_object_name_ptr) {
97279726
if (opaque_decl_ctx) {
97289727
clang::DeclContext *decl_ctx = (clang::DeclContext *)opaque_decl_ctx;
97299728
if (ObjCMethodDecl *objc_method =
97309729
llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx)) {
9731-
if (is_instance_method_ptr)
9732-
*is_instance_method_ptr = objc_method->isInstanceMethod();
9733-
if (language_ptr)
9734-
*language_ptr = eLanguageTypeObjC;
9735-
if (language_object_name_ptr)
9736-
language_object_name_ptr->SetCString("self");
9730+
if (objc_method->isInstanceMethod())
9731+
if (language_object_name_ptr)
9732+
language_object_name_ptr->SetCString("self");
97379733
return true;
97389734
} else if (CXXMethodDecl *cxx_method =
97399735
llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx)) {
9740-
if (is_instance_method_ptr)
9741-
*is_instance_method_ptr = cxx_method->isInstance();
9742-
if (language_ptr)
9743-
*language_ptr = eLanguageTypeC_plus_plus;
9744-
if (language_object_name_ptr)
9745-
language_object_name_ptr->SetCString("this");
9736+
if (cxx_method->isInstance())
9737+
if (language_object_name_ptr)
9738+
language_object_name_ptr->SetCString("this");
97469739
return true;
97479740
} else if (clang::FunctionDecl *function_decl =
97489741
llvm::dyn_cast<clang::FunctionDecl>(decl_ctx)) {
97499742
ClangASTMetadata *metadata = GetMetadata(function_decl);
97509743
if (metadata && metadata->HasObjectPtr()) {
9751-
if (is_instance_method_ptr)
9752-
*is_instance_method_ptr = true;
9753-
if (language_ptr)
9754-
*language_ptr = eLanguageTypeObjC;
97559744
if (language_object_name_ptr)
97569745
language_object_name_ptr->SetCString(metadata->GetObjectPtrName());
97579746
return true;

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

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

573573
bool DeclContextIsClassMethod(void *opaque_decl_ctx,
574-
lldb::LanguageType *language_ptr,
575-
bool *is_instance_method_ptr,
576574
ConstString *language_object_name_ptr) override;
577575

578576
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)