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

Last change on this file since 5305 was 5267, checked in by nmedfort, 3 years ago

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

File size: 753 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/Support/MemoryBuffer.h>
7#include <string>
8namespace llvm { class Module; }
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.