Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
CompiledLibrary.hpp
Go to the documentation of this file.
1#ifndef PROTEUS_COMPILED_LIBRARY_HPP
2#define PROTEUS_COMPILED_LIBRARY_HPP
3
4#include <llvm/ExecutionEngine/Orc/Core.h>
5#include <llvm/Support/FileSystem.h>
6#include <llvm/Support/MemoryBuffer.h>
7
8namespace proteus {
9
10using namespace llvm;
11
13 // Compiled library holds a relocatable object or a dynamic library, indicated
14 // by IsDynLib.
15 std::unique_ptr<MemoryBuffer> ObjectModule;
16 SmallString<128> DynLibPath;
18 bool IsLoaded = false;
19 // JitDyLib holds a pointer to the ORC JIT dynamic library context for the
20 // host JIT engine.
21 llvm::orc::JITDylib *JitDyLib = nullptr;
22
23 CompiledLibrary(std::unique_ptr<MemoryBuffer> ObjectModule)
24 : ObjectModule(std::move(ObjectModule)), IsDynLib(false) {}
25
26 CompiledLibrary(const SmallString<128> &Path)
27 : DynLibPath{Path}, IsDynLib(true) {}
28
29 bool isDynLib() const { return IsDynLib; }
30
31 bool isObject() const { return !IsDynLib; }
32};
33
34} // namespace proteus
35
36#endif
Definition Helpers.h:76
Definition BuiltinsCUDA.cpp:4
Definition Hashing.hpp:147
Definition CompiledLibrary.hpp:12
std::unique_ptr< MemoryBuffer > ObjectModule
Definition CompiledLibrary.hpp:15
bool IsDynLib
Definition CompiledLibrary.hpp:17
bool isDynLib() const
Definition CompiledLibrary.hpp:29
llvm::orc::JITDylib * JitDyLib
Definition CompiledLibrary.hpp:21
CompiledLibrary(std::unique_ptr< MemoryBuffer > ObjectModule)
Definition CompiledLibrary.hpp:23
SmallString< 128 > DynLibPath
Definition CompiledLibrary.hpp:16
CompiledLibrary(const SmallString< 128 > &Path)
Definition CompiledLibrary.hpp:26
bool isObject() const
Definition CompiledLibrary.hpp:31
bool IsLoaded
Definition CompiledLibrary.hpp:18