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;
67 llvm::MemoryBuffer &
addPCM(llvm::StringRef Filename,
68 std::unique_ptr<llvm::MemoryBuffer> Buffer);
75 llvm::MemoryBuffer &
addBuiltPCM(llvm::StringRef Filename,
76 std::unique_ptr<llvm::MemoryBuffer> Buffer);
92 llvm::MemoryBuffer *
lookupPCM(llvm::StringRef Filename)
const;
97 bool isPCMFinal(llvm::StringRef Filename)
const;
107 #endif // LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H bool tryToDropPCM(llvm::StringRef Filename)
Try to remove a buffer from the cache.
State
There are four states for a PCM.
void finalizePCM(llvm::StringRef Filename)
Mark a PCM as final.
bool shouldBuildPCM(llvm::StringRef Filename) const
Check whether the PCM is waiting to be built.
llvm::MemoryBuffer & addPCM(llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)
Store the PCM under the Filename.
In-memory cache for modules.
State getPCMState(llvm::StringRef Filename) const
Get the state of the PCM.
llvm::MemoryBuffer & addBuiltPCM(llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)
Store a just-built PCM under the Filename.
Dataflow Directional Tag Classes.
bool isPCMFinal(llvm::StringRef Filename) const
Check whether the PCM is final and has been shown to work.
llvm::MemoryBuffer * lookupPCM(llvm::StringRef Filename) const
Get a pointer to the pCM if it exists; else nullptr.