9#ifndef LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H
10#define LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H
12#include "llvm/ADT/IntrusiveRefCntPtr.h"
13#include "llvm/ADT/StringMap.h"
14#include "llvm/Support/MemoryBuffer.h"
31 std::unique_ptr<llvm::MemoryBuffer> Buffer;
39 PCM(std::unique_ptr<llvm::MemoryBuffer> Buffer)
40 : Buffer(std::move(Buffer)) {}
44 llvm::StringMap<PCM> PCMs;
67 std::unique_ptr<llvm::MemoryBuffer> Buffer);
75 std::unique_ptr<llvm::MemoryBuffer> Buffer);
In-memory cache for modules.
State getPCMState(llvm::StringRef Filename) const
Get the state of the PCM.
State
There are four states for a PCM.
llvm::MemoryBuffer & addBuiltPCM(llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)
Store a just-built PCM under the Filename.
llvm::MemoryBuffer * lookupPCM(llvm::StringRef Filename) const
Get a pointer to the pCM if it exists; else nullptr.
bool isPCMFinal(llvm::StringRef Filename) const
Check whether the PCM is final and has been shown to work.
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.
bool shouldBuildPCM(llvm::StringRef Filename) const
Check whether the PCM is waiting to be built.
The JSON file list parser is used to communicate input to InstallAPI.