14 #ifndef LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H
15 #define LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H
47 : TM(TM), ObjCache(ObjCache) {}
66 std::unique_ptr<MemoryBuffer> ObjBuffer(
71 notifyObjectCompiled(M, *ObjBuffer);
85 std::unique_ptr<MemoryBuffer> ObjBuffer = ObjCache->
getObject(&M);
100 void notifyObjectCompiled(
const Module &M,
const MemoryBuffer &ObjBuffer) {
106 ObjectCache *ObjCache =
nullptr;
113 #endif // LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Create ObjectFile from path.
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...
A raw_ostream that writes to an SmallVector or SmallString.
Error takeError()
Take ownership of the stored error.
Tagged union holding either a T or a Error.
Simple compile functor: Takes a single IR module and returns an ObjectFile.
Context object for machine code objects.
object::OwningBinary< object::ObjectFile > CompileResult
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.
virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj)=0
notifyObjectCompiled - Provides a pointer to compiled code for Module M.
llvm_unreachable("Unknown RegBank!")
void setObjectCache(ObjectCache *NewCache)
Set an ObjectCache to query before compiling.
SmallVector-backed MemoryBuffer instance.
This is the base ObjectCache type which can be provided to an ExecutionEngine for the purpose of avoi...
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.