1254721Semaste//===-- IRInterpreter.h -----------------------------------------*- C++ -*-===// 2254721Semaste// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6254721Semaste// 7254721Semaste//===----------------------------------------------------------------------===// 8254721Semaste 9254721Semaste#ifndef liblldb_IRInterpreter_h_ 10254721Semaste#define liblldb_IRInterpreter_h_ 11254721Semaste 12321369Sdim#include "lldb/Utility/ConstString.h" 13321369Sdim#include "lldb/Utility/Stream.h" 14314564Sdim#include "lldb/lldb-public.h" 15254721Semaste#include "llvm/ADT/ArrayRef.h" 16254721Semaste#include "llvm/Pass.h" 17254721Semaste 18254721Semastenamespace llvm { 19314564Sdimclass Function; 20314564Sdimclass Module; 21254721Semaste} 22254721Semaste 23254721Semastenamespace lldb_private { 24254721Semaste 25254721Semasteclass ClangExpressionDeclMap; 26254721Semasteclass IRMemoryMap; 27254721Semaste} 28254721Semaste 29353358Sdim/// \class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h" 30341825Sdim/// Attempt to interpret the function's code if it does not require 31254721Semaste/// running the target. 32254721Semaste/// 33341825Sdim/// In some cases, the IR for an expression can be evaluated entirely in the 34341825Sdim/// debugger, manipulating variables but not executing any code in the target. 35341825Sdim/// The IRInterpreter attempts to do this. 36314564Sdimclass IRInterpreter { 37254721Semastepublic: 38314564Sdim static bool CanInterpret(llvm::Module &module, llvm::Function &function, 39321369Sdim lldb_private::Status &error, 40314564Sdim const bool support_function_calls); 41314564Sdim 42314564Sdim static bool Interpret(llvm::Module &module, llvm::Function &function, 43314564Sdim llvm::ArrayRef<lldb::addr_t> args, 44314564Sdim lldb_private::IRExecutionUnit &execution_unit, 45321369Sdim lldb_private::Status &error, 46314564Sdim lldb::addr_t stack_frame_bottom, 47314564Sdim lldb::addr_t stack_frame_top, 48314564Sdim lldb_private::ExecutionContext &exe_ctx); 49314564Sdim 50314564Sdimprivate: 51314564Sdim static bool supportsFunction(llvm::Function &llvm_function, 52321369Sdim lldb_private::Status &err); 53254721Semaste}; 54254721Semaste 55254721Semaste#endif 56