25 static struct RegisterInterp {
36 std::string *ErrStr) {
38 if (
Error Err = M->materializeAll()) {
60 initializeExecutionEngine();
61 initializeExternalFunctions();
72 while (!AtExitHandlers.empty()) {
74 AtExitHandlers.pop_back();
83 assert (F &&
"Function *F was null at entry to run()");
94 ArgValues.
slice(0, std::min(ArgValues.
size(), ArgCount));
static ExecutionEngine * create(std::unique_ptr< Module > M, std::string *ErrorStr=nullptr)
Create an interpreter ExecutionEngine.
Interpreter(std::unique_ptr< Module > M)
This class represents lattice values for constants.
virtual std::string message() const
Return the error message as a string.
const DataLayout & getDataLayout() const
Base class for error info classes.
void callFunction(Function *F, ArrayRef< GenericValue > ArgVals)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void emitGlobals()
EmitGlobals - Emit all of the global variables to memory, storing their addresses into GlobalAddress...
size_t size() const
size - Get the array size.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
Abstract interface for implementation execution of LLVM modules, designed to support both interpreter...
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
Module.h This file contains the declarations for the Module class.
GenericValue runFunction(Function *F, ArrayRef< GenericValue > ArgValues) override
run - Start execution with the specified function and arguments.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
void runAtExitHandlers()
runAtExitHandlers - Run any functions registered by the program's calls to atexit(3), which we intercept and store in AtExitHandlers.
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...
void LLVMLinkInInterpreter()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.