This applies to IsClassMethod as well.
/// Checks if this decl context represents a method of a class.
///
- /// \param[out] language_ptr
- /// If non NULL and \b true is returned from this function,
- /// this will indicate if the language that respresents the method.
- ///
- /// \param[out] is_instance_method_ptr
- /// If non NULL and \b true is returned from this function,
- /// this will indicate if the method is an instance function (true)
- /// or a class method (false indicating the function is static, or
- /// doesn't require an instance of the class to be called).
- ///
/// \param[out] language_object_name_ptr
/// If non NULL and \b true is returned from this function,
/// this will indicate if implicit object name for the language
/// \return
/// Returns true if this is a decl context that represents a method
/// in a struct, union or class.
- bool IsClassMethod(lldb::LanguageType *language_ptr,
- bool *is_instance_method_ptr,
- ConstString *language_object_name_ptr);
+ bool IsClassMethod(ConstString *language_object_name_ptr = nullptr);
/// Check if the given other decl context is contained in the lookup
/// of this decl context (for example because the other context is a nested
/// If this symbol context represents a function that is a method, return
/// true and provide information about the method.
///
- /// \param[out] language
- /// If \b true is returned, the language for the method.
- ///
- /// \param[out] is_instance_method
- /// If \b true is returned, \b true if this is a instance method,
- /// \b false if this is a static/class function.
- ///
/// \param[out] language_object_name
/// If \b true is returned, the name of the artificial variable
/// for the language ("this" for C++, "self" for ObjC).
/// \return
/// \b True if this symbol context represents a function that
/// is a method of a class, \b false otherwise.
- bool GetFunctionMethodInfo(lldb::LanguageType &language,
- bool &is_instance_method,
- ConstString &language_object_name);
+ bool GetFunctionMethodInfo(ConstString &language_object_name);
/// Sorts the types in TypeMap according to SymbolContext to TypeList
///
virtual ConstString
DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
- virtual bool DeclContextIsClassMethod(
- void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
- bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
+ virtual bool
+ DeclContextIsClassMethod(void *opaque_decl_ctx,
+ ConstString *language_object_name_ptr) = 0;
virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
void *other_opaque_decl_ctx) = 0;
// class/instance methods, since they'll be skipped in the code that
// follows anyway.
CompilerDeclContext func_decl_context = function->GetDeclContext();
- if (!func_decl_context ||
- func_decl_context.IsClassMethod(nullptr, nullptr, nullptr))
+ if (!func_decl_context || func_decl_context.IsClassMethod())
continue;
// We can only prune functions for which we can copy the type.
CompilerType func_clang_type = function->GetType()->GetFullCompilerType();
continue;
// Filter out class/instance methods.
- if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
+ if (decl_ctx.IsClassMethod())
continue;
AddOneFunction(context, sym_ctx.function, nullptr);
}
bool TypeSystemClang::DeclContextIsClassMethod(
- void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
- bool *is_instance_method_ptr, ConstString *language_object_name_ptr) {
+ void *opaque_decl_ctx, ConstString *language_object_name_ptr) {
if (opaque_decl_ctx) {
clang::DeclContext *decl_ctx = (clang::DeclContext *)opaque_decl_ctx;
if (ObjCMethodDecl *objc_method =
llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx)) {
- if (is_instance_method_ptr)
- *is_instance_method_ptr = objc_method->isInstanceMethod();
- if (language_ptr)
- *language_ptr = eLanguageTypeObjC;
- if (language_object_name_ptr)
- language_object_name_ptr->SetCString("self");
+ if (objc_method->isInstanceMethod())
+ if (language_object_name_ptr)
+ language_object_name_ptr->SetCString("self");
return true;
} else if (CXXMethodDecl *cxx_method =
llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx)) {
- if (is_instance_method_ptr)
- *is_instance_method_ptr = cxx_method->isInstance();
- if (language_ptr)
- *language_ptr = eLanguageTypeC_plus_plus;
- if (language_object_name_ptr)
- language_object_name_ptr->SetCString("this");
+ if (cxx_method->isInstance())
+ if (language_object_name_ptr)
+ language_object_name_ptr->SetCString("this");
return true;
} else if (clang::FunctionDecl *function_decl =
llvm::dyn_cast<clang::FunctionDecl>(decl_ctx)) {
ClangASTMetadata *metadata = GetMetadata(function_decl);
if (metadata && metadata->HasObjectPtr()) {
- if (is_instance_method_ptr)
- *is_instance_method_ptr = true;
- if (language_ptr)
- *language_ptr = eLanguageTypeObjC;
if (language_object_name_ptr)
language_object_name_ptr->SetCString(metadata->GetObjectPtrName());
return true;
ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override;
bool DeclContextIsClassMethod(void *opaque_decl_ctx,
- lldb::LanguageType *language_ptr,
- bool *is_instance_method_ptr,
ConstString *language_object_name_ptr) override;
bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
return ConstString();
}
-bool CompilerDeclContext::IsClassMethod(lldb::LanguageType *language_ptr,
- bool *is_instance_method_ptr,
- ConstString *language_object_name_ptr) {
+bool CompilerDeclContext::IsClassMethod(ConstString *language_object_name_ptr) {
if (IsValid())
- return m_type_system->DeclContextIsClassMethod(
- m_opaque_decl_ctx, language_ptr, is_instance_method_ptr,
- language_object_name_ptr);
+ return m_type_system->DeclContextIsClassMethod(m_opaque_decl_ctx,
+ language_object_name_ptr);
return false;
}
return nullptr;
}
-bool SymbolContext::GetFunctionMethodInfo(lldb::LanguageType &language,
- bool &is_instance_method,
- ConstString &language_object_name)
-
-{
+bool SymbolContext::GetFunctionMethodInfo(ConstString &language_object_name) {
Block *function_block = GetFunctionBlock();
if (function_block) {
CompilerDeclContext decl_ctx = function_block->GetDeclContext();
if (decl_ctx)
- return decl_ctx.IsClassMethod(&language, &is_instance_method,
- &language_object_name);
+ return decl_ctx.IsClassMethod(&language_object_name);
}
return false;
}
// Check for direct ivars access which helps us with implicit access to
// ivars using "this" or "self".
GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);
- lldb::LanguageType method_language = eLanguageTypeUnknown;
- bool is_instance_method = false;
ConstString method_object_name;
- if (m_sc.GetFunctionMethodInfo(method_language, is_instance_method,
- method_object_name)) {
- if (is_instance_method && method_object_name) {
+ if (m_sc.GetFunctionMethodInfo(method_object_name)) {
+ if (method_object_name) {
var_sp = variable_list->FindVariable(method_object_name);
if (var_sp) {
separator_idx = 0;