Author: spyffe
Date: Fri Aug 26 19:35:37 2016
New Revision: 279896

URL: http://llvm.org/viewvc/llvm-project?rev=279896&view=rev
Log:
Fixed the location of a conditional to make the following code clearer.

Modified:
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=279896&r1=279895&r2=279896&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Fri Aug 26 19:35:37 2016
@@ -882,9 +882,15 @@ ClangExpressionParser::PrepareForExecuti
 
         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::PrepareForExecuti
             }
         }
 
-        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");


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to