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.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121952 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index 80ce515..9fff48d 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -409,7 +409,8 @@
 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 @@
     {
         IRForTarget ir_for_target(decl_map, 
                                   m_expr.NeedsVariableResolution(),
+                                  const_result,
                                   function_name.c_str());
         
         if (!ir_for_target.runOnModule(*module))