1 //===-- IRInterpreter.h -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_IRInterpreter_h_
10 #define liblldb_IRInterpreter_h_
12 #include "lldb/Utility/ConstString.h"
13 #include "lldb/Utility/Stream.h"
14 #include "lldb/lldb-public.h"
15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/Pass.h"
23 namespace lldb_private {
25 class ClangExpressionDeclMap;
29 /// \class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h"
30 /// Attempt to interpret the function's code if it does not require
31 /// running the target.
33 /// In some cases, the IR for an expression can be evaluated entirely in the
34 /// debugger, manipulating variables but not executing any code in the target.
35 /// The IRInterpreter attempts to do this.
38 static bool CanInterpret(llvm::Module &module, llvm::Function &function,
39 lldb_private::Status &error,
40 const bool support_function_calls);
42 static bool Interpret(llvm::Module &module, llvm::Function &function,
43 llvm::ArrayRef<lldb::addr_t> args,
44 lldb_private::IRExecutionUnit &execution_unit,
45 lldb_private::Status &error,
46 lldb::addr_t stack_frame_bottom,
47 lldb::addr_t stack_frame_top,
48 lldb_private::ExecutionContext &exe_ctx);
51 static bool supportsFunction(llvm::Function &llvm_function,
52 lldb_private::Status &err);