forked from OSchip/llvm-project
[lldb][NFCI] Remove UserExpression::GetJITModule
UserExpression::GetJITModule was used to support an option in UserExpression::Evaluate that let you hold onto the JIT Module used during the expression evaluation. This was only actually used in one spot -- REPL::IOHandlerInputComplete. That method didn't actually take use the JIT module it got back, so this feature was not used in practice. This means that we can delete the support in UserExpression::Evaluate and delete the UserExpression::GetJITModule method entirely.
This commit is contained in:
parent
22b044877d
commit
381e81a048
|
@ -71,8 +71,6 @@ public:
|
||||||
/// translation unit.
|
/// translation unit.
|
||||||
const char *Text() override { return m_transformed_text.c_str(); }
|
const char *Text() override { return m_transformed_text.c_str(); }
|
||||||
|
|
||||||
lldb::ModuleSP GetJITModule() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
lldb::ExpressionResults
|
lldb::ExpressionResults
|
||||||
DoExecute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx,
|
DoExecute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx,
|
||||||
|
|
|
@ -213,8 +213,6 @@ public:
|
||||||
return lldb::ExpressionVariableSP();
|
return lldb::ExpressionVariableSP();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual lldb::ModuleSP GetJITModule() { return lldb::ModuleSP(); }
|
|
||||||
|
|
||||||
/// Evaluate one expression in the scratch context of the target passed in
|
/// Evaluate one expression in the scratch context of the target passed in
|
||||||
/// the exe_ctx and return its result.
|
/// the exe_ctx and return its result.
|
||||||
///
|
///
|
||||||
|
@ -244,9 +242,6 @@ public:
|
||||||
/// If non-nullptr, the fixed expression is copied into the provided
|
/// If non-nullptr, the fixed expression is copied into the provided
|
||||||
/// string.
|
/// string.
|
||||||
///
|
///
|
||||||
/// \param[out] jit_module_sp_ptr
|
|
||||||
/// If non-nullptr, used to persist the generated IR module.
|
|
||||||
///
|
|
||||||
/// \param[in] ctx_obj
|
/// \param[in] ctx_obj
|
||||||
/// If specified, then the expression will be evaluated in the context of
|
/// If specified, then the expression will be evaluated in the context of
|
||||||
/// this object. It means that the context object's address will be
|
/// this object. It means that the context object's address will be
|
||||||
|
@ -265,7 +260,6 @@ public:
|
||||||
llvm::StringRef expr_cstr, llvm::StringRef expr_prefix,
|
llvm::StringRef expr_cstr, llvm::StringRef expr_prefix,
|
||||||
lldb::ValueObjectSP &result_valobj_sp, Status &error,
|
lldb::ValueObjectSP &result_valobj_sp, Status &error,
|
||||||
std::string *fixed_expression = nullptr,
|
std::string *fixed_expression = nullptr,
|
||||||
lldb::ModuleSP *jit_module_sp_ptr = nullptr,
|
|
||||||
ValueObject *ctx_obj = nullptr);
|
ValueObject *ctx_obj = nullptr);
|
||||||
|
|
||||||
static const Status::ValueType kNoResult =
|
static const Status::ValueType kNoResult =
|
||||||
|
|
|
@ -357,8 +357,3 @@ bool LLVMUserExpression::PrepareToExecuteJITExpression(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::ModuleSP LLVMUserExpression::GetJITModule() {
|
|
||||||
if (m_execution_unit_sp)
|
|
||||||
return m_execution_unit_sp->GetJITModule();
|
|
||||||
return lldb::ModuleSP();
|
|
||||||
}
|
|
||||||
|
|
|
@ -291,12 +291,10 @@ void REPL::IOHandlerInputComplete(IOHandler &io_handler, std::string &code) {
|
||||||
const char *expr_prefix = nullptr;
|
const char *expr_prefix = nullptr;
|
||||||
lldb::ValueObjectSP result_valobj_sp;
|
lldb::ValueObjectSP result_valobj_sp;
|
||||||
Status error;
|
Status error;
|
||||||
lldb::ModuleSP jit_module_sp;
|
|
||||||
lldb::ExpressionResults execution_results =
|
lldb::ExpressionResults execution_results =
|
||||||
UserExpression::Evaluate(exe_ctx, expr_options, code.c_str(),
|
UserExpression::Evaluate(exe_ctx, expr_options, code.c_str(),
|
||||||
expr_prefix, result_valobj_sp, error,
|
expr_prefix, result_valobj_sp, error,
|
||||||
nullptr, // Fixed Expression
|
nullptr); // fixed expression
|
||||||
&jit_module_sp);
|
|
||||||
|
|
||||||
// CommandInterpreter &ci = debugger.GetCommandInterpreter();
|
// CommandInterpreter &ci = debugger.GetCommandInterpreter();
|
||||||
|
|
||||||
|
|
|
@ -139,12 +139,12 @@ lldb::addr_t UserExpression::GetObjectPointer(lldb::StackFrameSP frame_sp,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::ExpressionResults UserExpression::Evaluate(
|
lldb::ExpressionResults
|
||||||
ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options,
|
UserExpression::Evaluate(ExecutionContext &exe_ctx,
|
||||||
llvm::StringRef expr, llvm::StringRef prefix,
|
const EvaluateExpressionOptions &options,
|
||||||
lldb::ValueObjectSP &result_valobj_sp, Status &error,
|
llvm::StringRef expr, llvm::StringRef prefix,
|
||||||
std::string *fixed_expression, lldb::ModuleSP *jit_module_sp_ptr,
|
lldb::ValueObjectSP &result_valobj_sp, Status &error,
|
||||||
ValueObject *ctx_obj) {
|
std::string *fixed_expression, ValueObject *ctx_obj) {
|
||||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
||||||
LIBLLDB_LOG_STEP));
|
LIBLLDB_LOG_STEP));
|
||||||
|
|
||||||
|
@ -302,11 +302,6 @@ lldb::ExpressionResults UserExpression::Evaluate(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parse_success) {
|
if (parse_success) {
|
||||||
// If a pointer to a lldb::ModuleSP was passed in, return the JIT'ed module
|
|
||||||
// if one was created
|
|
||||||
if (jit_module_sp_ptr)
|
|
||||||
*jit_module_sp_ptr = user_expression_sp->GetJITModule();
|
|
||||||
|
|
||||||
lldb::ExpressionVariableSP expr_result;
|
lldb::ExpressionVariableSP expr_result;
|
||||||
|
|
||||||
if (execution_policy == eExecutionPolicyNever &&
|
if (execution_policy == eExecutionPolicyNever &&
|
||||||
|
|
|
@ -2356,11 +2356,9 @@ ExpressionResults Target::EvaluateExpression(
|
||||||
} else {
|
} else {
|
||||||
llvm::StringRef prefix = GetExpressionPrefixContents();
|
llvm::StringRef prefix = GetExpressionPrefixContents();
|
||||||
Status error;
|
Status error;
|
||||||
execution_results =
|
execution_results = UserExpression::Evaluate(exe_ctx, options, expr, prefix,
|
||||||
UserExpression::Evaluate(exe_ctx, options, expr, prefix,
|
result_valobj_sp, error,
|
||||||
result_valobj_sp, error, fixed_expression,
|
fixed_expression, ctx_obj);
|
||||||
nullptr, // Module
|
|
||||||
ctx_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return execution_results;
|
return execution_results;
|
||||||
|
|
Loading…
Reference in New Issue