From 3a878af29c92123977f394df6d142b6ecdb00e0f Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Sat, 27 Aug 2016 00:35:37 +0000 Subject: [PATCH] Fixed the location of a conditional to make the following code clearer. llvm-svn: 279896 --- .../ExpressionParser/Clang/ClangExpressionParser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index b222048..6a27cd3 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -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"); -- 2.7.4