You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
942 B
39 lines
942 B
10 years ago
|
#pragma once
|
||
10 years ago
|
|
||
10 years ago
|
#include <memory>
|
||
10 years ago
|
|
||
10 years ago
|
#include <llvm/ExecutionEngine/ObjectCache.h>
|
||
|
|
||
10 years ago
|
namespace dev
|
||
|
{
|
||
|
namespace eth
|
||
|
{
|
||
|
namespace jit
|
||
|
{
|
||
10 years ago
|
class ExecutionEngineListener;
|
||
10 years ago
|
|
||
10 years ago
|
class ObjectCache : public llvm::ObjectCache
|
||
|
{
|
||
|
public:
|
||
|
/// notifyObjectCompiled - Provides a pointer to compiled code for Module M.
|
||
|
virtual void notifyObjectCompiled(llvm::Module const* _module, llvm::MemoryBuffer const* _object) final override;
|
||
|
|
||
|
/// getObjectCopy - Returns a pointer to a newly allocated MemoryBuffer that
|
||
|
/// contains the object which corresponds with Module M, or 0 if an object is
|
||
|
/// not available. The caller owns both the MemoryBuffer returned by this
|
||
|
/// and the memory it references.
|
||
|
virtual llvm::MemoryBuffer* getObject(llvm::Module const* _module) final override;
|
||
|
};
|
||
|
|
||
|
|
||
10 years ago
|
class Cache
|
||
|
{
|
||
|
public:
|
||
10 years ago
|
static ObjectCache* getObjectCache(ExecutionEngineListener* _listener);
|
||
10 years ago
|
static std::unique_ptr<llvm::Module> getObject(std::string const& id);
|
||
10 years ago
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|