Added the skeleton of an IR transformer that will
prepare IR for execution in the target.  Wired the
expression command to use this IR transformer when
conversion to DWARF fails, and wired conversion to
DWARF to always fail (well, we don't generate any
DWARF...)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107559 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectExpression.cpp b/source/Commands/CommandObjectExpression.cpp
index 64106ed..37659f5 100644
--- a/source/Commands/CommandObjectExpression.cpp
+++ b/source/Commands/CommandObjectExpression.cpp
@@ -252,11 +252,29 @@
     ClangExpressionVariableList expr_local_vars;
 
     bool success;
+    bool canInterpret = false;
     
     if (m_options.use_ir)
-        success = (clang_expr.ConvertIRToDWARF (expr_local_vars, dwarf_opcodes) == 0);
+    {
+        canInterpret = clang_expr.ConvertIRToDWARF (expr_local_vars, dwarf_opcodes);
+        
+        if (canInterpret)
+        {
+            if (log)
+                log->Printf("Code can be interpreted.");
+            success = true;
+        }
+        else
+        {
+            if (log)
+                log->Printf("Code cannot be interpreted and must be run in the target.");
+            success = clang_expr.PrepareIRForTarget (expr_local_vars);
+        }
+    }
     else
+    {
         success = (clang_expr.ConvertExpressionToDWARF (expr_local_vars, dwarf_opcodes) == 0);
+    }
     
     if (!success)
     {