From: Raphael Isemann Date: Wed, 10 Jun 2020 10:22:55 +0000 (+0200) Subject: [lldb][NFC] Rename ClangExpressionDeclMap::AddThisType and clarify documentation X-Git-Tag: llvmorg-12-init~3508 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=834708a6a0d04935d79bfa54c7a1bf9ab7a2ba8f;p=platform%2Fupstream%2Fllvm.git [lldb][NFC] Rename ClangExpressionDeclMap::AddThisType and clarify documentation --- diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index 7d40cd0..d71036f 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -759,7 +759,7 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) { if (!ctx_obj_ptr || status.Fail()) return; - AddThisType(context, TypeFromUser(m_ctx_obj->GetCompilerType())); + AddContextClassType(context, TypeFromUser(m_ctx_obj->GetCompilerType())); m_struct_vars->m_object_pointer_type = TypeFromUser(ctx_obj_ptr->GetCompilerType()); @@ -797,7 +797,7 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) { LLDB_LOG(log, " CEDM::FEVD Adding type for $__lldb_class: {1}", class_qual_type.getAsString()); - AddThisType(context, class_user_type); + AddContextClassType(context, class_user_type); if (method_decl->isInstance()) { // self is a pointer to the object @@ -839,7 +839,7 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) { LLDB_LOG(log, " FEVD Adding type for $__lldb_class: {1}", ClangUtil::GetQualType(pointee_type).getAsString()); - AddThisType(context, pointee_type); + AddContextClassType(context, pointee_type); TypeFromUser this_user_type(this_type->GetFullCompilerType()); m_struct_vars->m_object_pointer_type = this_user_type; } @@ -1876,8 +1876,8 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context, } } -void ClangExpressionDeclMap::AddThisType(NameSearchContext &context, - const TypeFromUser &ut) { +void ClangExpressionDeclMap::AddContextClassType(NameSearchContext &context, + const TypeFromUser &ut) { CompilerType copied_clang_type = GuardedCopyType(ut); Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h index 2dc9216..6974535 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -588,15 +588,19 @@ private: /// The type that needs to be created. void AddOneType(NameSearchContext &context, const TypeFromUser &type); - /// Generate a Decl for "*this" and add a member function declaration to it - /// for the expression, then report it. + /// Adds the class in which the expression is evaluated to the lookup and + /// prepares the class to be used as a context for expression evaluation (for + /// example, it creates a fake member function that will contain the + /// expression LLDB is trying to evaluate). /// /// \param[in] context - /// The NameSearchContext to use when constructing the Decl. + /// The NameSearchContext to which the class should be added as a lookup + /// result. /// /// \param[in] type - /// The type for *this. - void AddThisType(NameSearchContext &context, const TypeFromUser &type); + /// The type of the class that serves as the evaluation context. + void AddContextClassType(NameSearchContext &context, + const TypeFromUser &type); /// Move a type out of the current ASTContext into another, but make sure to /// export all components of the type also.