source: icGREP/icgrep-devel/icgrep/object_cache.h @ 5260

Last change on this file since 5260 was 5260, checked in by nmedfort, 2 years ago

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

File size: 748 bytes
Line 
1#ifndef OBJECT_CACHE_H
2#define OBJECT_CACHE_H
3
4#include <llvm/ADT/SmallString.h>
5#include <llvm/ExecutionEngine/ObjectCache.h>
6#include <llvm/IR/Module.h>
7#include <llvm/Support/MemoryBuffer.h>
8#include <string>
9
10class ICGrepObjectCache : public llvm::ObjectCache {
11    public:
12        ICGrepObjectCache(const std::string &dir);
13        ICGrepObjectCache();
14        virtual ~ICGrepObjectCache();
15
16        void notifyObjectCompiled(const llvm::Module *M, llvm::MemoryBufferRef Obj) override;
17        std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module* M) override;
18
19    private:
20        using Path = llvm::SmallString<256>;
21        Path CacheDir;
22
23        bool getCacheFilename(const std::string & ModID, Path & CacheName);
24};
25
26#endif
Note: See TracBrowser for help on using the repository browser.