CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base > Class Template Reference
Inheritance diagram for CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >:
Collaboration graph

Public Member Functions

 LlvmBaseModelLibraryProcessorImpl (ModelLibraryCSourceGen< Base > &librarySourceGen, std::string version)
 
const std::string & getVersion () const
 
void setIncludePaths (const std::vector< std::string > &includePaths)
 
const std::vector< std::string > & getIncludePaths () const
 
std::unique_ptr< LlvmModelLibrary< Base > > create ()
 
std::unique_ptr< LlvmModelLibrary< Base > > create (ClangCompiler< Base > &clang)
 

Protected Member Functions

virtual void createLlvmModules (const std::map< std::string, std::string > &sources)
 
virtual void createLlvmModule (const std::string &filename, const std::string &source)
 
const std::set< std::string > & createBitCode (ClangCompiler< Base > &clang, const std::string &version)
 
const std::map< std::string, std::string > & getLibrarySources ()
 
const std::map< std::string, std::string > & getSources (ModelCSourceGen< Base > &model)
 

Static Protected Member Functions

static std::string findInternalClangCHeaders (const std::string &version, const std::string &resourceDir)
 

Protected Attributes

const std::string _version
 
std::vector< std::string > _includePaths
 
std::shared_ptr< llvm::LLVMContext > _context
 
std::unique_ptr< llvm::Linker > _linker
 
std::unique_ptr< llvm::Module > _module
 
ModelLibraryCSourceGen< Base > * modelLibraryHelper_
 

Detailed Description

template<class Base>
class CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >

Useful class for generating a JIT evaluated model library (LLVM 5.0, 6.0, 7.0, 8.0).

Author
Joao Leal

Definition at line 30 of file llvm_base_model_library_processor_impl.hpp.

Constructor & Destructor Documentation

◆ LlvmBaseModelLibraryProcessorImpl()

template<class Base >
CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >::LlvmBaseModelLibraryProcessorImpl ( ModelLibraryCSourceGen< Base > &  librarySourceGen,
std::string  version 
)
inline

Creates a LLVM model library processor.

Parameters
librarySourceGen

Definition at line 44 of file llvm_base_model_library_processor_impl.hpp.

Member Function Documentation

◆ create() [1/2]

template<class Base >
std::unique_ptr<LlvmModelLibrary<Base> > CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >::create ( )
inline
Returns
a model library

Definition at line 77 of file llvm_base_model_library_processor_impl.hpp.

◆ create() [2/2]

template<class Base >
std::unique_ptr<LlvmModelLibrary<Base> > CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >::create ( ClangCompiler< Base > &  clang)
inline

Creates a LLVM model library using an external Clang compiler to generate the bitcode.

Parameters
clangthe external compiler
Returns
a model library

generate bit code

Load bit code and create a single module

Definition at line 119 of file llvm_base_model_library_processor_impl.hpp.

◆ createBitCode()

template<class Base >
const std::set<std::string>& CppAD::cg::LlvmBaseModelLibraryProcessor< Base >::createBitCode ( ClangCompiler< Base > &  clang,
const std::string &  version 
)
inlineprotectedinherited

◆ getIncludePaths()

template<class Base >
const std::vector<std::string>& CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >::getIncludePaths ( ) const
inline

User defined header paths.

Definition at line 69 of file llvm_base_model_library_processor_impl.hpp.

◆ getVersion()

template<class Base >
const std::string& CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >::getVersion ( ) const
inline
Returns
The version of LLVM (and Clang).

Definition at line 55 of file llvm_base_model_library_processor_impl.hpp.

◆ setIncludePaths()

template<class Base >
void CppAD::cg::LlvmBaseModelLibraryProcessorImpl< Base >::setIncludePaths ( const std::vector< std::string > &  includePaths)
inline

Define additional header paths.

Definition at line 62 of file llvm_base_model_library_processor_impl.hpp.


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