[Lldb-commits] [lldb] [lldb] Make sure Blocks always have a parent (PR #117683)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 26 02:46:19 PST 2024


================
@@ -399,11 +392,9 @@ size_t Block::MemorySize() const {
   return mem_size;
 }
 
-void Block::AddChild(const BlockSP &child_block_sp) {
-  if (child_block_sp) {
-    child_block_sp->SetParentScope(this);
-    m_children.push_back(child_block_sp);
-  }
+BlockSP Block::CreateChild(user_id_t uid) {
+  m_children.push_back(std::shared_ptr<Block>(new Block(uid, *this)));
----------------
DavidSpickett wrote:

Understood.

https://github.com/llvm/llvm-project/pull/117683


More information about the lldb-commits mailing list