[Lldb-commits] [lldb] [lldb][ClangExpressionDeclMap][NFC] Remove unused NameSearchContext::m_found_function (PR #88724)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 15 13:45:30 PDT 2024


https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/88724

>From e85bf75077dec2d6aa7d6983bbde222d1c2b3f29 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Mon, 15 Apr 2024 10:37:05 +0100
Subject: [PATCH 1/2] [lldb][ClangExpressionDeclMap][NFC] Remove unused
 NameSearchContext::m_found_function

This member was never actually used, ever since its introduction
in `ca4e0fd7e63b90e6f68044af47248c64f250ee8f`.
---
 .../ExpressionParser/Clang/ClangExpressionDeclMap.cpp    | 9 ++-------
 .../Plugins/ExpressionParser/Clang/NameSearchContext.h   | 1 -
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
index 2d306b42760b18..bf310cfcd4c8af 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -1049,7 +1049,6 @@ void ClangExpressionDeclMap::LookupInModulesDeclVendor(
     context.AddNamedDecl(copied_function);
 
     context.m_found_function_with_type_info = true;
-    context.m_found_function = true;
   } else if (auto copied_var = dyn_cast<clang::VarDecl>(copied_decl)) {
     context.AddNamedDecl(copied_var);
     context.m_found_variable = true;
@@ -1299,7 +1298,6 @@ void ClangExpressionDeclMap::LookupFunction(
 
         AddOneFunction(context, sym_ctx.function, nullptr);
         context.m_found_function_with_type_info = true;
-        context.m_found_function = true;
       } else if (sym_ctx.symbol) {
         Symbol *symbol = sym_ctx.symbol;
         if (target && symbol->GetType() == eSymbolTypeReExported) {
@@ -1329,13 +1327,10 @@ void ClangExpressionDeclMap::LookupFunction(
     }
 
     if (!context.m_found_function_with_type_info) {
-      if (extern_symbol) {
+      if (extern_symbol)
         AddOneFunction(context, nullptr, extern_symbol);
-        context.m_found_function = true;
-      } else if (non_extern_symbol) {
+      else if (non_extern_symbol)
         AddOneFunction(context, nullptr, non_extern_symbol);
-        context.m_found_function = true;
-      }
     }
   }
 }
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.h b/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.h
index dc8621dd6aba52..9a3320636081be 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.h
@@ -41,7 +41,6 @@ struct NameSearchContext {
 
   bool m_found_variable = false;
   bool m_found_function_with_type_info = false;
-  bool m_found_function = false;
   bool m_found_local_vars_nsp = false;
   bool m_found_type = false;
 

>From 86314daa00da7be807a14f81ae98816dc7172b29 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Mon, 15 Apr 2024 13:40:55 +0100
Subject: [PATCH 2/2] fixup! revert noisy formatting change

---
 .../ExpressionParser/Clang/ClangExpressionDeclMap.cpp        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
index bf310cfcd4c8af..31f6447d66f642 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -1327,10 +1327,11 @@ void ClangExpressionDeclMap::LookupFunction(
     }
 
     if (!context.m_found_function_with_type_info) {
-      if (extern_symbol)
+      if (extern_symbol) {
         AddOneFunction(context, nullptr, extern_symbol);
-      else if (non_extern_symbol)
+      } else if (non_extern_symbol) {
         AddOneFunction(context, nullptr, non_extern_symbol);
+      }
     }
   }
 }



More information about the lldb-commits mailing list