summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangUtilityFunction.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2013-03-19 00:10:07 +0000
committerSean Callanan <scallanan@apple.com>2013-03-19 00:10:07 +0000
commit8dfb68e0398ef48d41dc8ea058e9aa750b5fc85f (patch)
treef3cc669add590ceef9c2f27cae111a4fc6832d5f /lldb/source/Expression/ClangUtilityFunction.cpp
parent807e4dced5419437b7965da8fea34e8d0227d49a (diff)
downloadbcm5719-llvm-8dfb68e0398ef48d41dc8ea058e9aa750b5fc85f.tar.gz
bcm5719-llvm-8dfb68e0398ef48d41dc8ea058e9aa750b5fc85f.zip
Refactored the expression parser so that the IR
and the JITted code are managed by a standalone class that handles memory management itself. I have removed RecordingMemoryManager and ProcessDataAllocator, which filled similar roles and had confusing ownership, with a common class called IRExecutionUnit. The IRExecutionUnit manages all allocations ever made for an expression and frees them when it goes away. It also contains the code generator and can vend the Module for an expression to other clases. The end goal here is to make the output of the expression parser re-usable; that is, to avoid re-parsing when re-parsing isn't necessary. I've also cleaned up some code and used weak pointers in more places. Please let me know if you see any leaks; I checked myself as well but I might have missed a case. llvm-svn: 177364
Diffstat (limited to 'lldb/source/Expression/ClangUtilityFunction.cpp')
-rw-r--r--lldb/source/Expression/ClangUtilityFunction.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/lldb/source/Expression/ClangUtilityFunction.cpp b/lldb/source/Expression/ClangUtilityFunction.cpp
index 2f41ae9a2f3..e457bb94655 100644
--- a/lldb/source/Expression/ClangUtilityFunction.cpp
+++ b/lldb/source/Expression/ClangUtilityFunction.cpp
@@ -104,8 +104,6 @@ ClangUtilityFunction::Install (Stream &error_stream,
m_expr_decl_map.reset(new ClangExpressionDeclMap(keep_result_in_memory, exe_ctx));
- m_data_allocator.reset(new ProcessDataAllocator(*process));
-
if (!m_expr_decl_map->WillParse(exe_ctx))
{
error_stream.PutCString ("error: current process state is unsuitable for expression parsing\n");
@@ -133,23 +131,13 @@ ClangUtilityFunction::Install (Stream &error_stream,
bool evaluated_statically = false; // should stay that way
- Error jit_error = parser.PrepareForExecution (m_jit_alloc,
- m_jit_start_addr,
+ Error jit_error = parser.PrepareForExecution (m_jit_start_addr,
m_jit_end_addr,
exe_ctx,
- m_data_allocator.get(),
evaluated_statically,
const_result,
eExecutionPolicyAlways);
- if (log)
- {
- StreamString dump_string;
- m_data_allocator->Dump(dump_string);
-
- log->Printf("Data buffer contents:\n%s", dump_string.GetString().c_str());
- }
-
if (m_jit_start_addr != LLDB_INVALID_ADDRESS)
m_jit_process_wp = lldb::ProcessWP(process->shared_from_this());
OpenPOWER on IntegriCloud