ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Attributes | List of all members
etiss::LLVMJIT Class Reference

#include <LLVMJIT.h>

Inheritance diagram for etiss::LLVMJIT:
Inheritance graph
[legend]
Collaboration diagram for etiss::LLVMJIT:
Collaboration graph
[legend]

Public Member Functions

 LLVMJIT ()
 
virtual ~LLVMJIT ()
 
virtual void * translate (std::string code, std::set< std::string > headerpaths, std::set< std::string > librarypaths, std::set< std::string > libraries, std::string &error, bool debug=false)
 translate C code to executable code and return a handle/pointer that identifies the compilation result More...
 
virtual void * getFunction (void *handle, std::string name, std::string &error)
 returns a function pointer to a compiled function from the handle returned by etiss::JIT::translate More...
 
virtual void free (void *handle)
 clean up handled returned by etiss::JIT::translate More...
 
- Public Member Functions inherited from etiss::JIT
 JIT (std::string name)
 
virtual ~JIT ()
 
std::string getName ()
 returns the JIT instance name previously passed to the constructor More...
 

Private Attributes

llvm::LLVMContext context_
 
OrcJitorcJit_ = nullptr
 
std::unordered_set< std::string > loadedLibs_
 

Detailed Description

Definition at line 103 of file LLVMJIT.h.

Constructor & Destructor Documentation

◆ LLVMJIT()

LLVMJIT::LLVMJIT ( )

Definition at line 174 of file LLVMJIT.cpp.

References OrcJit::Create(), etiss_jit_llvm_init_done_, etiss_jit_llvm_init_mu_, and orcJit_.

Here is the call graph for this function:

◆ ~LLVMJIT()

LLVMJIT::~LLVMJIT ( )
virtual

Definition at line 195 of file LLVMJIT.cpp.

References orcJit_.

Member Function Documentation

◆ free()

void LLVMJIT::free ( void *  handle)
virtual

clean up handled returned by etiss::JIT::translate

Implements etiss::JIT.

Definition at line 294 of file LLVMJIT.cpp.

◆ getFunction()

void * LLVMJIT::getFunction ( void *  handle,
std::string  name,
std::string &  error 
)
virtual

returns a function pointer to a compiled function from the handle returned by etiss::JIT::translate

Implements etiss::JIT.

Definition at line 286 of file LLVMJIT.cpp.

References OrcJit::lookup(), and orcJit_.

Here is the call graph for this function:

◆ translate()

void * LLVMJIT::translate ( std::string  code,
std::set< std::string >  headerpaths,
std::set< std::string >  librarypaths,
std::set< std::string >  libraries,
std::string &  error,
bool  debug = false 
)
virtual

translate C code to executable code and return a handle/pointer that identifies the compilation result

Parameters
codegenerated code
headerpathspaths where required header files are located
librarypathspaths where required libraries are located (usually not needed since libraries don't require full linking)
librariesfile names of required libraries (usually not needed since libraries don't require full linking)
errorstring to return additional error information
debugif true then compilation should try to enable gdb to jump into compiled functions

Implements etiss::JIT.

Definition at line 200 of file LLVMJIT.cpp.

References OrcJit::addModule(), get_metrics::args, OrcJit::getContext(), etiss::jitFiles(), loadedLibs_, OrcJit::loadLib(), and orcJit_.

Here is the call graph for this function:

Member Data Documentation

◆ context_

llvm::LLVMContext etiss::LLVMJIT::context_
private

Definition at line 114 of file LLVMJIT.h.

◆ loadedLibs_

std::unordered_set<std::string> etiss::LLVMJIT::loadedLibs_
private

Definition at line 116 of file LLVMJIT.h.

Referenced by translate().

◆ orcJit_

OrcJit* etiss::LLVMJIT::orcJit_ = nullptr
private

Definition at line 115 of file LLVMJIT.h.

Referenced by getFunction(), LLVMJIT(), translate(), and ~LLVMJIT().


The documentation for this class was generated from the following files: