1 //===-- ObjectCache.h - Class definition for the ObjectCache -----C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_EXECUTIONENGINE_OBJECTCACHE_H
11 #define LLVM_EXECUTIONENGINE_OBJECTCACHE_H
13 #include "llvm/Support/MemoryBuffer.h"
19 /// This is the base ObjectCache type which can be provided to an
20 /// ExecutionEngine for the purpose of avoiding compilation for Modules that
21 /// have already been compiled and an object file is available.
23 virtual void anchor();
27 virtual ~ObjectCache() { }
29 /// notifyObjectCompiled - Provides a pointer to compiled code for Module M.
30 virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) = 0;
32 /// Returns a pointer to a newly allocated MemoryBuffer that contains the
33 /// object which corresponds with Module M, or 0 if an object is not
35 virtual std::unique_ptr<MemoryBuffer> getObject(const Module* M) = 0;