[Lldb-commits] [lldb] [lldb][NFC] Remove ModuleChild::SetModule (PR #223661)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 15 04:31:05 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Raphael Isemann (Teemperor)
<details>
<summary>Changes</summary>
This function isn't used by anyone. Furthermore, we shouldn't use it as some ModuleChild use their module's lock to synchronize accesses to their memory. If this function was actually called by anyone, it would introduce race conditions into classes that use the module's lock for synchronization.
---
Full diff: https://github.com/llvm/llvm-project/pull/223661.diff
2 Files Affected:
- (modified) lldb/include/lldb/Core/ModuleChild.h (-7)
- (modified) lldb/source/Core/ModuleChild.cpp (-4)
``````````diff
diff --git a/lldb/include/lldb/Core/ModuleChild.h b/lldb/include/lldb/Core/ModuleChild.h
index 63eb1372ff683..5bff60f84d68d 100644
--- a/lldb/include/lldb/Core/ModuleChild.h
+++ b/lldb/include/lldb/Core/ModuleChild.h
@@ -44,13 +44,6 @@ class ModuleChild {
/// inherits from this class.
lldb::ModuleSP GetModule() const;
- /// Set accessor for the module pointer.
- ///
- /// \param[in] module_sp
- /// A new module that owns the object that inherits from this
- /// class.
- void SetModule(const lldb::ModuleSP &module_sp);
-
protected:
/// The Module that owns the object that inherits from this class.
lldb::ModuleWP m_module_wp;
diff --git a/lldb/source/Core/ModuleChild.cpp b/lldb/source/Core/ModuleChild.cpp
index 7aaa8f2ac2508..edc26c8e81ede 100644
--- a/lldb/source/Core/ModuleChild.cpp
+++ b/lldb/source/Core/ModuleChild.cpp
@@ -22,7 +22,3 @@ const ModuleChild &ModuleChild::operator=(const ModuleChild &rhs) {
}
lldb::ModuleSP ModuleChild::GetModule() const { return m_module_wp.lock(); }
-
-void ModuleChild::SetModule(const lldb::ModuleSP &module_sp) {
- m_module_wp = module_sp;
-}
``````````
</details>
https://github.com/llvm/llvm-project/pull/223661
More information about the lldb-commits
mailing list