LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::EngineBuilder Class Reference

#include <ExecutionEngine.h>

Public Member Functions

 EngineBuilder (Module *m)
 
EngineBuildersetEngineKind (EngineKind::Kind w)
 
EngineBuildersetMCJITMemoryManager (RTDyldMemoryManager *mcjmm)
 
EngineBuildersetJITMemoryManager (JITMemoryManager *jmm)
 
EngineBuildersetErrorStr (std::string *e)
 
EngineBuildersetOptLevel (CodeGenOpt::Level l)
 
EngineBuildersetTargetOptions (const TargetOptions &Opts)
 
EngineBuildersetRelocationModel (Reloc::Model RM)
 
EngineBuildersetCodeModel (CodeModel::Model M)
 
EngineBuildersetAllocateGVsWithCode (bool a)
 
EngineBuildersetMArch (StringRef march)
 setMArch - Override the architecture set by the Module's triple. More...
 
EngineBuildersetMCPU (StringRef mcpu)
 setMCPU - Target a specific cpu type. More...
 
EngineBuildersetUseMCJIT (bool Value)
 
template<typename StringSequence >
EngineBuildersetMAttrs (const StringSequence &mattrs)
 setMAttrs - Set cpu-specific attributes. More...
 
TargetMachineselectTarget ()
 
TargetMachineselectTarget (const Triple &TargetTriple, StringRef MArch, StringRef MCPU, const SmallVectorImpl< std::string > &MAttrs)
 
ExecutionEnginecreate ()
 
ExecutionEnginecreate (TargetMachine *TM)
 

Detailed Description

EngineBuilder - Builder class for ExecutionEngines. Use this by stack-allocating a builder, chaining the various set* methods, and terminating it with a .create() call.

Definition at line 509 of file ExecutionEngine/ExecutionEngine.h.

Constructor & Destructor Documentation

llvm::EngineBuilder::EngineBuilder ( Module m)
inline

EngineBuilder - Constructor for EngineBuilder. If create() is called and is successful, the created engine takes ownership of the module.

Definition at line 543 of file ExecutionEngine/ExecutionEngine.h.

Member Function Documentation

ExecutionEngine* llvm::EngineBuilder::create ( )
inline
ExecutionEngine * EngineBuilder::create ( TargetMachine TM)
TargetMachine * EngineBuilder::selectTarget ( )
TargetMachine * EngineBuilder::selectTarget ( const Triple TargetTriple,
StringRef  MArch,
StringRef  MCPU,
const SmallVectorImpl< std::string > &  MAttrs 
)
EngineBuilder& llvm::EngineBuilder::setAllocateGVsWithCode ( bool  a)
inline

setAllocateGVsWithCode - Sets whether global values should be allocated into the same buffer as code. For most applications this should be set to false. Allocating globals with code breaks freeMachineCodeForFunction and is probably unsafe and bad for performance. However, we have clients who depend on this behavior, so we must support it. This option defaults to false so that users of the new API can safely use the new memory manager and free machine code.

Definition at line 623 of file ExecutionEngine/ExecutionEngine.h.

Referenced by llvm::ExecutionEngine::createJIT().

EngineBuilder& llvm::EngineBuilder::setCodeModel ( CodeModel::Model  M)
inline

setCodeModel - Set the CodeModel that the ExecutionEngine target data is using. Defaults to target specific default "CodeModel::JITDefault".

Definition at line 611 of file ExecutionEngine/ExecutionEngine.h.

Referenced by llvm::ExecutionEngine::createJIT(), and LLVMCreateMCJITCompilerForModule().

EngineBuilder& llvm::EngineBuilder::setEngineKind ( EngineKind::Kind  w)
inline

setEngineKind - Controls whether the user wants the interpreter, the JIT, or whichever engine works. This option defaults to EngineKind::Either.

Definition at line 549 of file ExecutionEngine/ExecutionEngine.h.

Referenced by llvm::ExecutionEngine::createJIT(), LLVMCreateExecutionEngineForModule(), LLVMCreateInterpreterForModule(), LLVMCreateJITCompilerForModule(), and LLVMCreateMCJITCompilerForModule().

EngineBuilder& llvm::EngineBuilder::setErrorStr ( std::string *  e)
inline

setErrorStr - Set the error string to write to on error. This option defaults to NULL.

Definition at line 582 of file ExecutionEngine/ExecutionEngine.h.

Referenced by llvm::ExecutionEngine::createJIT(), LLVMCreateExecutionEngineForModule(), LLVMCreateInterpreterForModule(), LLVMCreateJITCompilerForModule(), and LLVMCreateMCJITCompilerForModule().

EngineBuilder& llvm::EngineBuilder::setJITMemoryManager ( JITMemoryManager jmm)
inline

setJITMemoryManager - Sets the JIT memory manager to use. This allows clients to customize their memory allocation policies. This is only appropriate for either JIT or MCJIT; setting this and configuring the builder to create an interpreter will cause a runtime error. If create() is called and is successful, the created engine takes ownership of the memory manager. This option defaults to NULL. This option overrides setMCJITMemoryManager() as well.

Definition at line 574 of file ExecutionEngine/ExecutionEngine.h.

Referenced by llvm::ExecutionEngine::createJIT().

EngineBuilder& llvm::EngineBuilder::setMArch ( StringRef  march)
inline

setMArch - Override the architecture set by the Module's triple.

Definition at line 629 of file ExecutionEngine/ExecutionEngine.h.

References llvm::StringRef::begin(), and llvm::StringRef::end().

template<typename StringSequence >
EngineBuilder& llvm::EngineBuilder::setMAttrs ( const StringSequence &  mattrs)
inline

setMAttrs - Set cpu-specific attributes.

Definition at line 649 of file ExecutionEngine/ExecutionEngine.h.

References llvm::SmallVectorImpl< T >::append(), and llvm::SmallVectorImpl< T >::clear().

EngineBuilder& llvm::EngineBuilder::setMCJITMemoryManager ( RTDyldMemoryManager mcjmm)
inline

setMCJITMemoryManager - Sets the MCJIT memory manager to use. This allows clients to customize their memory allocation policies for the MCJIT. This is only appropriate for the MCJIT; setting this and configuring the builder to create anything other than MCJIT will cause a runtime error. If create() is called and is successful, the created engine takes ownership of the memory manager. This option defaults to NULL. Using this option nullifies the setJITMemoryManager() option.

Definition at line 561 of file ExecutionEngine/ExecutionEngine.h.

Referenced by LLVMCreateMCJITCompilerForModule().

EngineBuilder& llvm::EngineBuilder::setMCPU ( StringRef  mcpu)
inline

setMCPU - Target a specific cpu type.

Definition at line 635 of file ExecutionEngine/ExecutionEngine.h.

References llvm::StringRef::begin(), and llvm::StringRef::end().

EngineBuilder& llvm::EngineBuilder::setOptLevel ( CodeGenOpt::Level  l)
inline

setOptLevel - Set the optimization level for the JIT. This option defaults to CodeGenOpt::Default.

Definition at line 589 of file ExecutionEngine/ExecutionEngine.h.

Referenced by llvm::ExecutionEngine::createJIT(), LLVMCreateJITCompilerForModule(), and LLVMCreateMCJITCompilerForModule().

EngineBuilder& llvm::EngineBuilder::setRelocationModel ( Reloc::Model  RM)
inline

setRelocationModel - Set the relocation model that the ExecutionEngine target is using. Defaults to target specific default "Reloc::Default".

Definition at line 603 of file ExecutionEngine/ExecutionEngine.h.

References llvm::NVPTX::PTXCvtMode::RM.

Referenced by llvm::ExecutionEngine::createJIT().

EngineBuilder& llvm::EngineBuilder::setTargetOptions ( const TargetOptions Opts)
inline

setTargetOptions - Set the target options that the ExecutionEngine target is using. Defaults to TargetOptions().

Definition at line 596 of file ExecutionEngine/ExecutionEngine.h.

Referenced by LLVMCreateMCJITCompilerForModule().

EngineBuilder& llvm::EngineBuilder::setUseMCJIT ( bool  Value)
inline

setUseMCJIT - Set whether the MC-JIT implementation should be used (experimental).

Definition at line 642 of file ExecutionEngine/ExecutionEngine.h.

Referenced by LLVMCreateMCJITCompilerForModule().


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