LLVM  13.0.0git
ObjectCache.h
Go to the documentation of this file.
1 //===-- ObjectCache.h - Class definition for the ObjectCache ----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_EXECUTIONENGINE_OBJECTCACHE_H
10 #define LLVM_EXECUTIONENGINE_OBJECTCACHE_H
11 
12 #include <memory>
13 
14 namespace llvm {
15 
16 class MemoryBuffer;
17 class MemoryBufferRef;
18 class Module;
19 
20 /// This is the base ObjectCache type which can be provided to an
21 /// ExecutionEngine for the purpose of avoiding compilation for Modules that
22 /// have already been compiled and an object file is available.
23 class ObjectCache {
24  virtual void anchor();
25 
26 public:
27  ObjectCache() = default;
28 
29  virtual ~ObjectCache() = default;
30 
31  /// notifyObjectCompiled - Provides a pointer to compiled code for Module M.
32  virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) = 0;
33 
34  /// Returns a pointer to a newly allocated MemoryBuffer that contains the
35  /// object which corresponds with Module M, or 0 if an object is not
36  /// available.
37  virtual std::unique_ptr<MemoryBuffer> getObject(const Module* M) = 0;
38 };
39 
40 } // end namespace llvm
41 
42 #endif // LLVM_EXECUTIONENGINE_OBJECTCACHE_H
llvm
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::ObjectCache::notifyObjectCompiled
virtual void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj)=0
notifyObjectCompiled - Provides a pointer to compiled code for Module M.
llvm::ObjectCache::~ObjectCache
virtual ~ObjectCache()=default
llvm::ObjectCache
This is the base ObjectCache type which can be provided to an ExecutionEngine for the purpose of avoi...
Definition: ObjectCache.h:23
llvm::MemoryBufferRef
Definition: MemoryBufferRef.h:22
llvm::ObjectCache::getObject
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...
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::ObjectCache::ObjectCache
ObjectCache()=default