14 #ifndef LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H 15 #define LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H 48 : TM(TM), ObjCache(ObjCache) {}
72 llvm::make_unique<SmallVectorMemoryBuffer>(std::move(ObjBufferSV));
77 notifyObjectCompiled(M, *ObjBuffer);
78 return std::move(ObjBuffer);
112 : JTMB(
std::move(JTMB)), ObjCache(ObjCache) {}
117 auto TM =
cantFail(JTMB.createTargetMachine());
131 #endif // LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
This class represents lattice values for constants.
virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_pwrite_stream &, bool=true)
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
A Module instance is used to store all the information related to an LLVM module. ...
virtual std::unique_ptr< MemoryBuffer > getObject(const Module *M)=0
Returns a pointer to a newly allocated MemoryBuffer that contains the object which corresponds with M...
void setObjectCache(ObjectCache *ObjCache)
A raw_ostream that writes to an SmallVector or SmallString.
A thread-safe version of SimpleCompiler.
Simple compile functor: Takes a single IR module and returns an ObjectFile.
Context object for machine code objects.
PassManager manages ModulePassManagers.
CompileResult operator()(Module &M)
Compile a Module to an ObjectFile.
void consumeError(Error Err)
Consume a Error without doing anything.
bool run(Module &M)
run - Execute all of the passes scheduled for execution.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj)=0
notifyObjectCompiled - Provides a pointer to compiled code for Module M.
ConcurrentIRCompiler(JITTargetMachineBuilder JTMB, ObjectCache *ObjCache=nullptr)
MemoryBufferRef getMemBufferRef() const
This interface provides simple read-only access to a block of memory, and provides simple methods for...
void setObjectCache(ObjectCache *NewCache)
Set an ObjectCache to query before compiling.
std::unique_ptr< MemoryBuffer > operator()(Module &M)
This is the base ObjectCache type which can be provided to an ExecutionEngine for the purpose of avoi...
std::unique_ptr< MemoryBuffer > CompileResult
Primary interface to the complete machine description for the target machine.
SimpleCompiler(TargetMachine &TM, ObjectCache *ObjCache=nullptr)
Construct a simple compile functor with the given target.
A utility class for building TargetMachines for JITs.