[Lldb-commits] [PATCH] D152225: [lldb] mark `clang_resource_path` as static

Junchang Liu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 5 21:16:40 PDT 2023


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

The lifetime of `clang_resource_path` should be same as `kResourceDirSuffixes`, because `kResourceDirSuffixes` doesn't own `clang_resource_path`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152225

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp


Index: lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
@@ -52,7 +52,7 @@
   Log *log = GetLog(LLDBLog::Host);
   std::string raw_path = lldb_shlib_spec.GetPath();
   llvm::StringRef parent_dir = llvm::sys::path::parent_path(raw_path);
-  const std::string clang_resource_path =
+  static const std::string clang_resource_path =
       clang::driver::Driver::GetResourcesPath("bin/lldb", CLANG_RESOURCE_DIR);
 
   static const llvm::StringRef kResourceDirSuffixes[] = {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152225.528675.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230606/8bd6da19/attachment.bin>


More information about the lldb-commits mailing list