//===- Interpreter.cpp - Top-Level LLVM Interpreter Implementation --------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements the top-level functionality for the LLVM interpreter. // This interpreter is designed to be a very simple, portable, inefficient // interpreter. // //===----------------------------------------------------------------------===// #include "Interpreter.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Module.h" #include <cstring> usingnamespacellvm; namespace { static struct RegisterInterp { … } InterpRegistrator; } extern "C" void LLVMLinkInInterpreter() { … } /// Create a new interpreter object. /// ExecutionEngine *Interpreter::create(std::unique_ptr<Module> M, std::string *ErrStr) { … } //===----------------------------------------------------------------------===// // Interpreter ctor - Initialize stuff // Interpreter::Interpreter(std::unique_ptr<Module> M) : … { … } Interpreter::~Interpreter() { … } void Interpreter::runAtExitHandlers () { … } /// run - Start execution with the specified function and arguments. /// GenericValue Interpreter::runFunction(Function *F, ArrayRef<GenericValue> ArgValues) { … }