[Lldb-commits] [PATCH] D157992: [lldb][CPlusPlus][NFCI] Remove redundant construction of ClangASTImporter

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 15 09:07:22 PDT 2023


Michael137 created this revision.
Michael137 added a reviewer: aprantl.
Herald added a subscriber: martong.
Herald added a reviewer: a.sidorin.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The usage of this variable was removed in `4f14c17df70916913d71914343dd4f6c709e218d`.

This is no longer used inside this file. Since the call to
`GetPersistentExpressionStateForLanguage` has side-effects I marked this
NFCI. But there is no good reason we need this here.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157992

Files:
  lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp


Index: lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
===================================================================
--- lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
@@ -54,18 +54,6 @@
     if (!clang_ast_context)
       return;
 
-    std::shared_ptr<ClangASTImporter> clang_ast_importer;
-    auto *state = target_sp->GetPersistentExpressionStateForLanguage(
-        lldb::eLanguageTypeC_plus_plus);
-    if (state) {
-      auto *persistent_vars = llvm::cast<ClangPersistentVariables>(state);
-      clang_ast_importer = persistent_vars->GetClangASTImporter();
-    }
-
-    if (!clang_ast_importer) {
-      return;
-    }
-
     const char *const isa_name("__isa");
     const CompilerType isa_type =
         clang_ast_context->GetBasicType(lldb::eBasicTypeObjCClass);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157992.550357.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230815/a43c0b0f/attachment.bin>


More information about the lldb-commits mailing list