LLDB  mainline
IRInterpreter.h
Go to the documentation of this file.
1 //===-- IRInterpreter.h -----------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_EXPRESSION_IRINTERPRETER_H
10 #define LLDB_EXPRESSION_IRINTERPRETER_H
11 
13 #include "lldb/Utility/Stream.h"
14 #include "lldb/lldb-public.h"
15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/Pass.h"
17 
18 namespace llvm {
19 class Function;
20 class Module;
21 }
22 
23 namespace lldb_private {
24 
25 class IRMemoryMap;
26 }
27 
28 /// \class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h"
29 /// Attempt to interpret the function's code if it does not require
30 /// running the target.
31 ///
32 /// In some cases, the IR for an expression can be evaluated entirely in the
33 /// debugger, manipulating variables but not executing any code in the target.
34 /// The IRInterpreter attempts to do this.
36 public:
37  static bool CanInterpret(llvm::Module &module, llvm::Function &function,
39  const bool support_function_calls);
40 
41  static bool Interpret(llvm::Module &module, llvm::Function &function,
42  llvm::ArrayRef<lldb::addr_t> args,
43  lldb_private::IRExecutionUnit &execution_unit,
45  lldb::addr_t stack_frame_bottom,
46  lldb::addr_t stack_frame_top,
48 
49 private:
50  static bool supportsFunction(llvm::Function &llvm_function,
52 };
53 
54 #endif
lldb_private::IRExecutionUnit
Definition: IRExecutionUnit.h:56
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb-public.h
llvm
Definition: Debugger.h:49
lldb_private::CompilerContextKind::Module
@ Module
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
IRInterpreter::CanInterpret
static bool CanInterpret(llvm::Module &module, llvm::Function &function, lldb_private::Status &error, const bool support_function_calls)
Definition: IRInterpreter.cpp:484
IRInterpreter
Definition: IRInterpreter.h:35
IRInterpreter::Interpret
static bool Interpret(llvm::Module &module, llvm::Function &function, llvm::ArrayRef< lldb::addr_t > args, lldb_private::IRExecutionUnit &execution_unit, lldb_private::Status &error, lldb::addr_t stack_frame_bottom, lldb::addr_t stack_frame_top, lldb_private::ExecutionContext &exe_ctx)
Definition: IRInterpreter.cpp:633
lldb_private::Status
Definition: Status.h:44
IRInterpreter::supportsFunction
static bool supportsFunction(llvm::Function &llvm_function, lldb_private::Status &err)
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
ConstString.h
Stream.h
lldb_private::CompilerContextKind::Function
@ Function