#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ExecutionEngine/JITLink/EHFrameSupport.h"
#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
#include "llvm/ExecutionEngine/Orc/COFFPlatform.h"
#include "llvm/ExecutionEngine/Orc/ELFNixPlatform.h"
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
#include "llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h"
#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
#include "llvm/ExecutionEngine/Orc/MachOPlatform.h"
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h"
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcError.h"
#include "llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Mangler.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/DynamicLibrary.h"
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacellvm::orc;
namespace {
Function *addHelperAndWrapper(Module &M, StringRef WrapperName,
FunctionType *WrapperFnType,
GlobalValue::VisibilityTypes WrapperVisibility,
StringRef HelperName,
ArrayRef<Value *> HelperPrefixArgs) { … }
class GenericLLVMIRPlatformSupport;
class GenericLLVMIRPlatform : public Platform { … };
class GlobalCtorDtorScraper { … };
class GenericLLVMIRPlatformSupport : public LLJIT::PlatformSupport { … };
Error GenericLLVMIRPlatform::setupJITDylib(JITDylib &JD) { … }
Error GenericLLVMIRPlatform::teardownJITDylib(JITDylib &JD) { … }
Error GenericLLVMIRPlatform::notifyAdding(ResourceTracker &RT,
const MaterializationUnit &MU) { … }
Expected<ThreadSafeModule>
GlobalCtorDtorScraper::operator()(ThreadSafeModule TSM,
MaterializationResponsibility &R) { … }
class InactivePlatformSupport : public LLJIT::PlatformSupport { … };
}
namespace llvm {
namespace orc {
Error ORCPlatformSupport::initialize(orc::JITDylib &JD) { … }
Error ORCPlatformSupport::deinitialize(orc::JITDylib &JD) { … }
void LLJIT::PlatformSupport::setInitTransform(
LLJIT &J, IRTransformLayer::TransformFunction T) { … }
LLJIT::PlatformSupport::~PlatformSupport() = default;
Error LLJITBuilderState::prepareForConstruction() { … }
LLJIT::~LLJIT() { … }
JITDylibSP LLJIT::getProcessSymbolsJITDylib() { … }
JITDylibSP LLJIT::getPlatformJITDylib() { … }
Expected<JITDylib &> LLJIT::createJITDylib(std::string Name) { … }
Expected<JITDylib &> LLJIT::loadPlatformDynamicLibrary(const char *Path) { … }
Error LLJIT::linkStaticLibraryInto(JITDylib &JD,
std::unique_ptr<MemoryBuffer> LibBuffer) { … }
Error LLJIT::linkStaticLibraryInto(JITDylib &JD, const char *Path) { … }
Error LLJIT::addIRModule(ResourceTrackerSP RT, ThreadSafeModule TSM) { … }
Error LLJIT::addIRModule(JITDylib &JD, ThreadSafeModule TSM) { … }
Error LLJIT::addObjectFile(ResourceTrackerSP RT,
std::unique_ptr<MemoryBuffer> Obj) { … }
Error LLJIT::addObjectFile(JITDylib &JD, std::unique_ptr<MemoryBuffer> Obj) { … }
Expected<ExecutorAddr> LLJIT::lookupLinkerMangled(JITDylib &JD,
SymbolStringPtr Name) { … }
Expected<std::unique_ptr<ObjectLayer>>
LLJIT::createObjectLinkingLayer(LLJITBuilderState &S, ExecutionSession &ES) { … }
Expected<std::unique_ptr<IRCompileLayer::IRCompiler>>
LLJIT::createCompileFunction(LLJITBuilderState &S,
JITTargetMachineBuilder JTMB) { … }
LLJIT::LLJIT(LLJITBuilderState &S, Error &Err)
: … { … }
std::string LLJIT::mangle(StringRef UnmangledName) const { … }
Error LLJIT::applyDataLayout(Module &M) { … }
Error setUpOrcPlatformManually(LLJIT &J) { … }
class LoadAndLinkDynLibrary { … };
Expected<JITDylibSP> ExecutorNativePlatform::operator()(LLJIT &J) { … }
Expected<JITDylibSP> setUpGenericLLVMIRPlatform(LLJIT &J) { … }
Expected<JITDylibSP> setUpInactivePlatform(LLJIT &J) { … }
Error LLLazyJITBuilderState::prepareForConstruction() { … }
Error LLLazyJIT::addLazyIRModule(JITDylib &JD, ThreadSafeModule TSM) { … }
LLLazyJIT::LLLazyJIT(LLLazyJITBuilderState &S, Error &Err) : … { … }
LLVM_ATTRIBUTE_USED void linkComponents() { … }
}
}