Spicy
Classes | Public Member Functions | List of all members
hilti::JIT Class Reference

#include <jit.h>

Public Member Functions

 JIT (std::shared_ptr< Context > context, bool dump_code=false)
 
 JIT (const JIT &)=delete
 
 JIT (JIT &&) noexcept=delete
 
JIToperator= (const JIT &)=delete
 
JIToperator= (JIT &&) noexcept=delete
 
void add (CxxCode d)
 
void add (const hilti::rt::filesystem::path &p)
 
bool hasInputs ()
 
Result< std::shared_ptr< const Library > > build ()
 
auto context () const
 
auto options () const
 

Detailed Description

Just-in-time compiler.

The class provides the entry point for compiling and executing C++ code just in time.

Constructor & Destructor Documentation

◆ JIT()

JIT::JIT ( std::shared_ptr< Context context,
bool  dump_code = false 
)
explicit
Parameters
contextcompiler context to use
dump_codeif true, save all C++ code into files dbg.* for debugging

Member Function Documentation

◆ add() [1/2]

void hilti::JIT::add ( CxxCode  d)
inline

Schedules C++ for just-in-time compilation. This must be called only before jit().

Parameters
dC++ code

◆ add() [2/2]

void hilti::JIT::add ( const hilti::rt::filesystem::path &  p)
inline

Schedules C++ for just-in-time compilation. This must be called only before compile().

Parameters
dfile to read C++ code from

◆ build()

hilti::Result< std::shared_ptr< const Library > > JIT::build ( )

Compiles and links all scheduled C++ code into a shared library.

Returns
the compiled library, which will be ready for loading.

◆ context()

auto hilti::JIT::context ( ) const
inline

Returns the compiler context in use.

◆ hasInputs()

bool hilti::JIT::hasInputs ( )
inline

Returns true if any source files have been added that need to be compiled.

◆ options()

auto hilti::JIT::options ( ) const
inline

Returns the compiler options in use.


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