Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:47

0001 //===-- IRInterpreter.h -----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_EXPRESSION_IRINTERPRETER_H
0010 #define LLDB_EXPRESSION_IRINTERPRETER_H
0011 
0012 #include "lldb/Utility/ConstString.h"
0013 #include "lldb/Utility/Stream.h"
0014 #include "lldb/Utility/Timeout.h"
0015 #include "lldb/lldb-public.h"
0016 #include "llvm/ADT/ArrayRef.h"
0017 #include "llvm/Pass.h"
0018 
0019 namespace llvm {
0020 class Function;
0021 class Module;
0022 }
0023 
0024 namespace lldb_private {
0025 
0026 class IRMemoryMap;
0027 }
0028 
0029 /// \class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h"
0030 /// Attempt to interpret the function's code if it does not require
0031 ///        running the target.
0032 ///
0033 /// In some cases, the IR for an expression can be evaluated entirely in the
0034 /// debugger, manipulating variables but not executing any code in the target.
0035 /// The IRInterpreter attempts to do this.
0036 class IRInterpreter {
0037 public:
0038   static bool CanInterpret(llvm::Module &module, llvm::Function &function,
0039                            lldb_private::Status &error,
0040                            const bool support_function_calls);
0041 
0042   static bool Interpret(llvm::Module &module, llvm::Function &function,
0043                         llvm::ArrayRef<lldb::addr_t> args,
0044                         lldb_private::IRExecutionUnit &execution_unit,
0045                         lldb_private::Status &error,
0046                         lldb::addr_t stack_frame_bottom,
0047                         lldb::addr_t stack_frame_top,
0048                         lldb_private::ExecutionContext &exe_ctx,
0049                         lldb_private::Timeout<std::micro> timeout);
0050 
0051 private:
0052   static bool supportsFunction(llvm::Function &llvm_function,
0053                                lldb_private::Status &err);
0054 };
0055 
0056 #endif