LLVM API Documentation
00001 //===-- ObjectCache.h - Class definition for the ObjectCache -----C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_EXECUTIONENGINE_OBJECTCACHE_H 00011 #define LLVM_EXECUTIONENGINE_OBJECTCACHE_H 00012 00013 #include "llvm/Support/MemoryBuffer.h" 00014 00015 namespace llvm { 00016 00017 class Module; 00018 00019 /// This is the base ObjectCache type which can be provided to an 00020 /// ExecutionEngine for the purpose of avoiding compilation for Modules that 00021 /// have already been compiled and an object file is available. 00022 class ObjectCache { 00023 virtual void anchor(); 00024 public: 00025 ObjectCache() { } 00026 00027 virtual ~ObjectCache() { } 00028 00029 /// notifyObjectCompiled - Provides a pointer to compiled code for Module M. 00030 virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) = 0; 00031 00032 /// Returns a pointer to a newly allocated MemoryBuffer that contains the 00033 /// object which corresponds with Module M, or 0 if an object is not 00034 /// available. 00035 virtual std::unique_ptr<MemoryBuffer> getObject(const Module* M) = 0; 00036 }; 00037 00038 } 00039 00040 #endif