[Lldb-commits] [lldb] [lldb][NFC] Remove ModuleChild::SetModule (PR #223661)
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 15 04:30:22 PDT 2026
https://github.com/Teemperor created https://github.com/llvm/llvm-project/pull/223661
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.
>From 4f1ca0dfbaa18edab3021fa43a53c7cf0c66fe25 Mon Sep 17 00:00:00 2001
From: Raphael Isemann <rise at apple.com>
Date: Tue, 15 Sep 2026 12:28:42 +0100
Subject: [PATCH] [lldb][NFC] Remove ModuleChild::SetModule
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.
---
lldb/include/lldb/Core/ModuleChild.h | 7 -------
lldb/source/Core/ModuleChild.cpp | 4 ----
2 files changed, 11 deletions(-)
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;
-}
More information about the lldb-commits
mailing list