A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://clang.llvm.org/doxygen/classclang_1_1InMemoryModuleCache.html below:

clang: clang::InMemoryModuleCache Class Reference

In-memory cache for modules. More...

#include "clang/Serialization/InMemoryModuleCache.h"

State  getPCMState (llvm::StringRef Filename) const   Get the state of the PCM.
  llvm::MemoryBuffer &  addPCM (llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)   Store the PCM under the Filename.
  llvm::MemoryBuffer &  addBuiltPCM (llvm::StringRef Filename, std::unique_ptr< llvm::MemoryBuffer > Buffer)   Store a just-built PCM under the Filename.
  bool  tryToDropPCM (llvm::StringRef Filename)   Try to remove a buffer from the cache.
  void  finalizePCM (llvm::StringRef Filename)   Mark a PCM as final.
  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.
  bool  shouldBuildPCM (llvm::StringRef Filename) const   Check whether the PCM is waiting to be built.
 

In-memory cache for modules.

This is a cache for modules for use across a compilation, sharing state between the CompilerInstances in an implicit modules build. It must be shared by each CompilerInstance, ASTReader, ASTWriter, and ModuleManager that are coordinating.

Critically, it ensures that a single process has a consistent view of each PCM. This is used by CompilerInstance when building PCMs to ensure that each ModuleManager sees the same files.

Definition at line 29 of file InMemoryModuleCache.h.

◆ State

There are four states for a PCM.

It must monotonically increase.

  1. Unknown: the PCM has neither been read from disk nor built.
  2. Tentative: the PCM has been read from disk but not yet imported or built. It might work.
  3. ToBuild: the PCM read from disk did not work but a new one has not been built yet.
  4. Final: indicating that the current PCM was either built in this process or has been successfully imported.
Enumerator Unknown  Tentative  ToBuild  Final 

Definition at line 56 of file InMemoryModuleCache.h.

◆ addBuiltPCM() llvm::MemoryBuffer & InMemoryModuleCache::addBuiltPCM ( llvm::StringRef  Filename, std::unique_ptr< llvm::MemoryBuffer >  Buffer  ) ◆ addPCM() llvm::MemoryBuffer & InMemoryModuleCache::addPCM ( llvm::StringRef  Filename, std::unique_ptr< llvm::MemoryBuffer >  Buffer  ) ◆ finalizePCM() void InMemoryModuleCache::finalizePCM ( llvm::StringRef  Filename )

Mark a PCM as final.

Precondition
state is Tentative or Final.
Postcondition
state is Final.

Definition at line 73 of file InMemoryModuleCache.cpp.

References Filename.

◆ getPCMState() ◆ isPCMFinal() bool InMemoryModuleCache::isPCMFinal ( llvm::StringRef  Filename ) const ◆ lookupPCM() llvm::MemoryBuffer * InMemoryModuleCache::lookupPCM ( llvm::StringRef  Filename ) const ◆ shouldBuildPCM() bool InMemoryModuleCache::shouldBuildPCM ( llvm::StringRef  Filename ) const ◆ tryToDropPCM() bool InMemoryModuleCache::tryToDropPCM ( llvm::StringRef  Filename )

Try to remove a buffer from the cache.

No effect if state is Final.

Precondition
state is Tentative/Final.
Postcondition
Tentative => ToBuild or Final => Final.
Returns
false on success, i.e. if Tentative => ToBuild.

Definition at line 59 of file InMemoryModuleCache.cpp.

References Filename.

The documentation for this class was generated from the following files:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4