[Lldb-commits] [lldb] [lldb] Drop unused IRExecutionUnit methods: WriteNow, FreeNow (PR #229667)

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 6 23:10:45 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Lang Hames (lhames)

<details>
<summary>Changes</summary>

These methods aren't used or tested. Drop them for now to simplify the expression evaluation APIs. They can be restored in the future if needed.

---
Full diff: https://github.com/llvm/llvm-project/pull/229667.diff


2 Files Affected:

- (modified) lldb/include/lldb/Expression/IRExecutionUnit.h (-8) 
- (modified) lldb/source/Expression/IRExecutionUnit.cpp (-47) 


``````````diff
diff --git a/lldb/include/lldb/Expression/IRExecutionUnit.h b/lldb/include/lldb/Expression/IRExecutionUnit.h
index 5832029cd2ffb1..6ba0dc52d3db16 100644
--- a/lldb/include/lldb/Expression/IRExecutionUnit.h
+++ b/lldb/include/lldb/Expression/IRExecutionUnit.h
@@ -79,14 +79,6 @@ class IRExecutionUnit : public std::enable_shared_from_this<IRExecutionUnit>,
   void GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
                        lldb::addr_t &func_end);
 
-  /// Accessors for IRForTarget and other clients that may want binary data
-  /// placed on their behalf.  The binary data is owned by the IRExecutionUnit
-  /// unless the client explicitly chooses to free it.
-
-  lldb::addr_t WriteNow(const uint8_t *bytes, size_t size, Status &error);
-
-  void FreeNow(lldb::addr_t allocation);
-
   /// ObjectFileJITDelegate overrides
   lldb::ByteOrder GetByteOrder() const override;
 
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index bcec26cafd29f8..17e131512ef0f6 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -60,53 +60,6 @@ IRExecutionUnit::IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_up,
                       : false),
       m_reported_allocations(false), m_preferred_modules() {}
 
-lldb::addr_t IRExecutionUnit::WriteNow(const uint8_t *bytes, size_t size,
-                                       Status &error) {
-  const bool zero_memory = false;
-  auto address_or_error =
-      Malloc(size, 8, lldb::ePermissionsWritable | lldb::ePermissionsReadable,
-             eAllocationPolicyMirror, zero_memory);
-  if (!address_or_error) {
-    error = Status::FromError(address_or_error.takeError());
-    return LLDB_INVALID_ADDRESS;
-  }
-  lldb::addr_t allocation_process_addr = *address_or_error;
-
-  WriteMemory(allocation_process_addr, bytes, size, error);
-
-  if (!error.Success()) {
-    Status err;
-    Free(allocation_process_addr, err);
-
-    return LLDB_INVALID_ADDRESS;
-  }
-
-  if (Log *log = GetLog(LLDBLog::Expressions)) {
-    DataBufferHeap my_buffer(size, 0);
-    Status err;
-    ReadMemory(my_buffer.GetBytes(), allocation_process_addr, size, err);
-
-    if (err.Success()) {
-      DataExtractor my_extractor(my_buffer.GetBytes(), my_buffer.GetByteSize(),
-                                 lldb::eByteOrderBig, 8);
-      my_extractor.PutToLog(log, 0, my_buffer.GetByteSize(),
-                            allocation_process_addr, 16,
-                            DataExtractor::TypeUInt8);
-    }
-  }
-
-  return allocation_process_addr;
-}
-
-void IRExecutionUnit::FreeNow(lldb::addr_t allocation) {
-  if (allocation == LLDB_INVALID_ADDRESS)
-    return;
-
-  Status err;
-
-  Free(allocation, err);
-}
-
 Status IRExecutionUnit::DisassembleFunction(Stream &stream,
                                             lldb::ProcessSP &process_wp) {
   Log *log = GetLog(LLDBLog::Expressions);

``````````

</details>


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


More information about the lldb-commits mailing list