Go to the documentation of this file.
9 #ifndef LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H
10 #define LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H
12 #include "llvm/ADT/IntrusiveRefCntPtr.h"
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/ADT/StringMap.h"
15 #include "llvm/Support/MemoryBuffer.h"
32 std::unique_ptr<llvm::MemoryBuffer> Buffer;
40 PCM(std::unique_ptr<llvm::MemoryBuffer> Buffer)
41 : Buffer(std::move(Buffer)) {}
45 llvm::StringMap<PCM> PCMs;
68 std::unique_ptr<llvm::MemoryBuffer> Buffer);
76 std::unique_ptr<llvm::MemoryBuffer> Buffer);
107 #endif // LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H
bool shouldBuildPCM(llvm::StringRef Filename) const
Check whether the PCM is waiting to be built.
llvm::MemoryBuffer * lookupPCM(llvm::StringRef Filename) const
Get a pointer to the pCM if it exists; else nullptr.
State
There are four states for a PCM.
llvm::MemoryBuffer & addPCM(llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)
Store the PCM under the Filename.
void finalizePCM(llvm::StringRef Filename)
Mark a PCM as final.
bool tryToDropPCM(llvm::StringRef Filename)
Try to remove a buffer from the cache.
In-memory cache for modules.
State getPCMState(llvm::StringRef Filename) const
Get the state of the PCM.
bool isPCMFinal(llvm::StringRef Filename) const
Check whether the PCM is final and has been shown to work.
llvm::MemoryBuffer & addBuiltPCM(llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)
Store a just-built PCM under the Filename.