Implemented a feature where the expression parser

can avoid running the code in the target if the
expression's result is known and the expression
has no side effects.

Right now this feature is quite conservative in
its guess about side effects, and it only computes
integer results, but the machinery to make it more
sophisticated is there.

llvm-svn: 121952
This commit is contained in:
Sean Callanan
2010-12-16 03:17:46 +00:00
parent 4c1386add9
commit e4ec90e990
9 changed files with 287 additions and 66 deletions

View File

@@ -409,7 +409,8 @@ ClangExpressionParser::MakeDWARF ()
Error
ClangExpressionParser::MakeJIT (lldb::addr_t &func_addr,
lldb::addr_t &func_end,
ExecutionContext &exe_ctx)
ExecutionContext &exe_ctx,
lldb::ClangExpressionVariableSP *const_result)
{
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -446,6 +447,7 @@ ClangExpressionParser::MakeJIT (lldb::addr_t &func_addr,
{
IRForTarget ir_for_target(decl_map,
m_expr.NeedsVariableResolution(),
const_result,
function_name.c_str());
if (!ir_for_target.runOnModule(*module))