Fixed the location of a conditional to make the following code clearer.
authorSean Callanan <scallanan@apple.com>
Sat, 27 Aug 2016 00:35:37 +0000 (00:35 +0000)
committerSean Callanan <scallanan@apple.com>
Sat, 27 Aug 2016 00:35:37 +0000 (00:35 +0000)
llvm-svn: 279896

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

index b222048..6a27cd3 100644 (file)
@@ -882,9 +882,15 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_addr,
 
         bool ir_can_run = ir_for_target.runOnModule(*execution_unit_sp->GetModule());
 
+        if (!ir_can_run)
+        {
+            err.SetErrorString("The expression could not be prepared to run in the target");
+            return err;
+        }
+
         Process *process = exe_ctx.GetProcessPtr();
 
-        if (execution_policy != eExecutionPolicyAlways && execution_policy != eExecutionPolicyTopLevel && ir_can_run)
+        if (execution_policy != eExecutionPolicyAlways && execution_policy != eExecutionPolicyTopLevel)
         {
             lldb_private::Error interpret_error;
 
@@ -900,12 +906,6 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_addr,
             }
         }
 
-        if (!ir_can_run)
-        {
-            err.SetErrorString("The expression could not be prepared to run in the target");
-            return err;
-        }
-
         if (!process && execution_policy == eExecutionPolicyAlways)
         {
             err.SetErrorString("Expression needed to run in the target, but the target can't be run");