24static struct RegisterInterp {
35 std::string *ErrStr) {
37 if (
Error Err = M->materializeAll()) {
59 initializeExecutionEngine();
60 initializeExternalFunctions();
71 while (!AtExitHandlers.empty()) {
73 AtExitHandlers.pop_back();
82 assert (
F &&
"Function *F was null at entry to run()");
91 const size_t ArgCount =
F->getFunctionType()->getNumParams();
93 ArgValues.
slice(0, std::min(ArgValues.
size(), ArgCount));
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Module.h This file contains the declarations for the Module class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
Base class for error info classes.
virtual std::string message() const
Return the error message as a string.
Lightweight error class with error context and mandatory checking.
Abstract interface for implementation execution of LLVM modules, designed to support both interpreter...
const DataLayout & getDataLayout() const
void emitGlobals()
EmitGlobals - Emit all of the global variables to memory, storing their addresses into GlobalAddress.
void runAtExitHandlers()
runAtExitHandlers - Run any functions registered by the program's calls to atexit(3),...
Interpreter(std::unique_ptr< Module > M)
void callFunction(Function *F, ArrayRef< GenericValue > ArgVals)
GenericValue runFunction(Function *F, ArrayRef< GenericValue > ArgValues) override
run - Start execution with the specified function and arguments.
static ExecutionEngine * create(std::unique_ptr< Module > M, std::string *ErrorStr=nullptr)
Create an interpreter ExecutionEngine.
void LLVMLinkInInterpreter()
Empty function used to force the linker to link the LLVM interpreter.
This is an optimization pass for GlobalISel generic memory operations.
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.