LLVM  14.0.0git
Public Member Functions | List of all members
llvm::EngineBuilder Class Reference

Builder class for ExecutionEngines. More...

#include "llvm/ExecutionEngine/ExecutionEngine.h"

Public Member Functions

 EngineBuilder ()
 Default constructor for EngineBuilder. More...
 
 EngineBuilder (std::unique_ptr< Module > M)
 Constructor for EngineBuilder. More...
 
 ~EngineBuilder ()
 
EngineBuildersetEngineKind (EngineKind::Kind w)
 setEngineKind - Controls whether the user wants the interpreter, the JIT, or whichever engine works. More...
 
EngineBuildersetMCJITMemoryManager (std::unique_ptr< RTDyldMemoryManager > mcjmm)
 setMCJITMemoryManager - Sets the MCJIT memory manager to use. More...
 
EngineBuildersetMemoryManager (std::unique_ptr< MCJITMemoryManager > MM)
 
EngineBuildersetSymbolResolver (std::unique_ptr< LegacyJITSymbolResolver > SR)
 
EngineBuildersetErrorStr (std::string *e)
 setErrorStr - Set the error string to write to on error. More...
 
EngineBuildersetOptLevel (CodeGenOpt::Level l)
 setOptLevel - Set the optimization level for the JIT. More...
 
EngineBuildersetTargetOptions (const TargetOptions &Opts)
 setTargetOptions - Set the target options that the ExecutionEngine target is using. More...
 
EngineBuildersetRelocationModel (Reloc::Model RM)
 setRelocationModel - Set the relocation model that the ExecutionEngine target is using. More...
 
EngineBuildersetCodeModel (CodeModel::Model M)
 setCodeModel - Set the CodeModel that the ExecutionEngine target data is using. More...
 
EngineBuildersetMArch (StringRef march)
 setMArch - Override the architecture set by the Module's triple. More...
 
EngineBuildersetMCPU (StringRef mcpu)
 setMCPU - Target a specific cpu type. More...
 
EngineBuildersetVerifyModules (bool Verify)
 setVerifyModules - Set whether the JIT implementation should verify IR modules during compilation. More...
 
template<typename StringSequence >
EngineBuildersetMAttrs (const StringSequence &mattrs)
 setMAttrs - Set cpu-specific attributes. More...
 
void setEmulatedTLS (bool EmulatedTLS)
 
TargetMachineselectTarget ()
 
TargetMachineselectTarget (const Triple &TargetTriple, StringRef MArch, StringRef MCPU, const SmallVectorImpl< std::string > &MAttrs)
 selectTarget - Pick a target either via -march or by guessing the native arch. More...
 
ExecutionEnginecreate ()
 
ExecutionEnginecreate (TargetMachine *TM)
 

Detailed Description

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 535 of file ExecutionEngine.h.

Constructor & Destructor Documentation

◆ EngineBuilder() [1/2]

EngineBuilder::EngineBuilder ( )

Default constructor for EngineBuilder.

Definition at line 470 of file ExecutionEngine.cpp.

◆ EngineBuilder() [2/2]

EngineBuilder::EngineBuilder ( std::unique_ptr< Module M)

Constructor for EngineBuilder.

Definition at line 472 of file ExecutionEngine.cpp.

References M.

◆ ~EngineBuilder()

EngineBuilder::~EngineBuilder ( )
default

Member Function Documentation

◆ create() [1/2]

ExecutionEngine* llvm::EngineBuilder::create ( )
inline

Definition at line 658 of file ExecutionEngine.h.

References selectTarget().

◆ create() [2/2]

ExecutionEngine * EngineBuilder::create ( TargetMachine TM)

◆ selectTarget() [1/2]

TargetMachine * EngineBuilder::selectTarget ( )

Definition at line 26 of file TargetSelect.cpp.

References llvm::EngineKind::Interpreter.

Referenced by create().

◆ selectTarget() [2/2]

TargetMachine * EngineBuilder::selectTarget ( const Triple TargetTriple,
StringRef  MArch,
StringRef  MCPU,
const SmallVectorImpl< std::string > &  MAttrs 
)

◆ setCodeModel()

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 613 of file ExecutionEngine.h.

References M.

◆ setEmulatedTLS()

void llvm::EngineBuilder::setEmulatedTLS ( bool  EmulatedTLS)
inline

Definition at line 645 of file ExecutionEngine.h.

◆ setEngineKind()

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 564 of file ExecutionEngine.h.

◆ setErrorStr()

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 584 of file ExecutionEngine.h.

References llvm::numbers::e.

◆ setMArch()

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

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

Definition at line 619 of file ExecutionEngine.h.

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

◆ setMAttrs()

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

setMAttrs - Set cpu-specific attributes.

Definition at line 639 of file ExecutionEngine.h.

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

◆ setMCJITMemoryManager()

EngineBuilder & EngineBuilder::setMCJITMemoryManager ( std::unique_ptr< RTDyldMemoryManager mcjmm)

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.

Definition at line 486 of file ExecutionEngine.cpp.

References move.

◆ setMCPU()

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

setMCPU - Target a specific cpu type.

Definition at line 625 of file ExecutionEngine.h.

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

◆ setMemoryManager()

EngineBuilder & EngineBuilder::setMemoryManager ( std::unique_ptr< MCJITMemoryManager MM)

Definition at line 495 of file ExecutionEngine.cpp.

References move.

◆ setOptLevel()

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 591 of file ExecutionEngine.h.

References l.

◆ setRelocationModel()

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 605 of file ExecutionEngine.h.

References llvm::AArch64::RM.

◆ setSymbolResolver()

EngineBuilder & EngineBuilder::setSymbolResolver ( std::unique_ptr< LegacyJITSymbolResolver SR)

Definition at line 501 of file ExecutionEngine.cpp.

References move.

◆ setTargetOptions()

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 598 of file ExecutionEngine.h.

References Options.

◆ setVerifyModules()

EngineBuilder& llvm::EngineBuilder::setVerifyModules ( bool  Verify)
inline

setVerifyModules - Set whether the JIT implementation should verify IR modules during compilation.

Definition at line 632 of file ExecutionEngine.h.

References Verify.


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