Flipped the big switch: LLDB now uses the new
Materializer for all expressions that need to
run in the target. This includes the following
changes:
- Removed a bunch of (de-)materialization code
from ClangExpressionDeclMap and assumed the
presence of a Materializer where we previously
had a fallback.
- Ensured that an IRMemoryMap is passed into
ClangExpressionDeclMap::Materialize().
- Fixed object ownership on LLVMContext; it is
now owned by the IRExecutionUnit, since the
Module and the ExecutionEngine both depend on
its existence.
- Fixed a few bugs in IRMemoryMap and the
Materializer that showed up during testing.
llvm-svn: 179649
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index def49f5..59b00bf 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -501,7 +501,8 @@
log->Printf("Found function %s for %s", function_name.AsCString(), m_expr.FunctionName());
}
- m_execution_unit.reset(new IRExecutionUnit(module_ap, // handed off here
+ m_execution_unit.reset(new IRExecutionUnit(m_llvm_context, // handed off here
+ module_ap, // handed off here
function_name,
exe_ctx.GetTargetSP(),
m_compiler->getTargetOpts().Features));