[Lldb-commits] [lldb] [lldb] Avoid tautological copying of a newly created object (PR #204998)
Sergei Barannikov via lldb-commits
lldb-commits at lists.llvm.org
Sun Jun 21 11:13:47 PDT 2026
https://github.com/s-barannikov created https://github.com/llvm/llvm-project/pull/204998
None
>From f95db99ac2d0df09df439b4f982160c8898b1aa9 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov <barannikov88 at gmail.com>
Date: Sun, 21 Jun 2026 21:12:36 +0300
Subject: [PATCH] [lldb] Avoid tautological copying of the newly created object
---
lldb/source/Target/Memory.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lldb/source/Target/Memory.cpp b/lldb/source/Target/Memory.cpp
index 3684d9410b64a..f70da27ec058b 100644
--- a/lldb/source/Target/Memory.cpp
+++ b/lldb/source/Target/Memory.cpp
@@ -42,8 +42,7 @@ void MemoryCache::Clear(bool clear_invalid_ranges) {
void MemoryCache::AddL1CacheData(lldb::addr_t addr, const void *src,
size_t src_len) {
- AddL1CacheData(
- addr, DataBufferSP(new DataBufferHeap(DataBufferHeap(src, src_len))));
+ AddL1CacheData(addr, std::make_shared<DataBufferHeap>(src, src_len));
}
void MemoryCache::AddL1CacheData(lldb::addr_t addr,
More information about the lldb-commits
mailing list