[Lldb-commits] [lldb] [lldb] Get IRExecutionUnit mangling-mode from llvm::Module. (PR #224595)

via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 18 03:47:17 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Lang Hames (lhames)

<details>
<summary>Changes</summary>

Get the mangling mode (IRExecutionUnit::m_strip_underscore) from the llvm::Module at IRExecutionUnit construction time, rather than getting it from the llvm::ExecutionEngine in GetRunnableInfo.

This is a step towards decoupling IRExecutionUnit from llvm::ExecutionEngine / MCJIT.

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


1 Files Affected:

- (modified) lldb/source/Expression/IRExecutionUnit.cpp (+2-3) 


``````````diff
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index fe0c060184c6d..73874850addcb 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -55,6 +55,8 @@ IRExecutionUnit::IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_up,
       m_cpu_features(cpu_features), m_name(name), m_sym_ctx(sym_ctx),
       m_did_jit(false), m_function_load_addr(LLDB_INVALID_ADDRESS),
       m_function_end_load_addr(LLDB_INVALID_ADDRESS),
+      m_strip_underscore(
+          m_module_up ? m_module_up->getDataLayout().getGlobalPrefix() == '_' : false),
       m_reported_allocations(false), m_preferred_modules() {}
 
 lldb::addr_t IRExecutionUnit::WriteNow(const uint8_t *bytes, size_t size,
@@ -308,9 +310,6 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
     return;
   }
 
-  m_strip_underscore =
-      (m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_');
-
   class ObjectDumper : public llvm::ObjectCache {
   public:
     ObjectDumper(FileSpec output_dir)  : m_out_dir(output_dir) {}

``````````

</details>


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


More information about the lldb-commits mailing list