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

Last change on this file since 5250 was 4964, checked in by hongpum, 4 years ago

Refine path representation and default CacheDir?

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