1 //===-- IRInterpreter.h -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_IRInterpreter_h_
11 #define liblldb_IRInterpreter_h_
13 #include "lldb/Core/ConstString.h"
14 #include "lldb/Core/Stream.h"
15 #include "lldb/lldb-public.h"
16 #include "llvm/ADT/ArrayRef.h"
17 #include "llvm/Pass.h"
24 namespace lldb_private {
26 class ClangExpressionDeclMap;
30 //----------------------------------------------------------------------
31 /// @class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h"
32 /// @brief Attempt to interpret the function's code if it does not require
33 /// running the target.
35 /// In some cases, the IR for an expression can be evaluated entirely
36 /// in the debugger, manipulating variables but not executing any code
37 /// in the target. The IRInterpreter attempts to do this.
38 //----------------------------------------------------------------------
41 static bool CanInterpret(llvm::Module &module, llvm::Function &function,
42 lldb_private::Error &error,
43 const bool support_function_calls);
45 static bool Interpret(llvm::Module &module, llvm::Function &function,
46 llvm::ArrayRef<lldb::addr_t> args,
47 lldb_private::IRExecutionUnit &execution_unit,
48 lldb_private::Error &error,
49 lldb::addr_t stack_frame_bottom,
50 lldb::addr_t stack_frame_top,
51 lldb_private::ExecutionContext &exe_ctx);
54 static bool supportsFunction(llvm::Function &llvm_function,
55 lldb_private::Error &err);