LLVM 22.0.0git
|
Reference to an object in an ObjectStore instance. More...
#include "llvm/CAS/CASReference.h"
Public Member Functions | |
void | print (raw_ostream &OS) const |
Print internal ref and/or CASID. Only suitable for debugging. | |
LLVM_DUMP_METHOD void | dump () const |
![]() | |
uint64_t | getInternalRef (const ObjectStore &ExpectedCAS) const |
Get an internal reference. | |
unsigned | getDenseMapHash () const |
Helper functions for DenseMapInfo. | |
bool | isDenseMapEmpty () const |
bool | isDenseMapTombstone () const |
bool | isDenseMapSentinel () const |
Static Public Member Functions | |
static ObjectRef | getDenseMapEmptyKey () |
static ObjectRef | getDenseMapTombstoneKey () |
Friends | |
class | ObjectStore |
class | ReferenceBase |
bool | operator== (const ObjectRef &LHS, const ObjectRef &RHS) |
bool | operator!= (const ObjectRef &LHS, const ObjectRef &RHS) |
Additional Inherited Members | |
![]() | |
void | print (raw_ostream &OS, const ObjectHandle &This) const |
void | print (raw_ostream &OS, const ObjectRef &This) const |
bool | hasSameInternalRef (const ReferenceBase &RHS) const |
ReferenceBase (const ObjectStore *CAS, uint64_t InternalRef, bool IsHandle) | |
ReferenceBase (DenseMapEmptyTag) | |
ReferenceBase (DenseMapTombstoneTag) | |
![]() | |
static constexpr uint64_t | getDenseMapEmptyRef () |
static constexpr uint64_t | getDenseMapTombstoneRef () |
Reference to an object in an ObjectStore instance.
If you have an ObjectRef, you know the object exists, and you can point at it from new nodes with ObjectStore::store(), but you don't know anything about it. "Loading" the object is a separate step that may not have happened yet, and which can fail (due to filesystem corruption) or introduce latency (if downloading from a remote store).
ObjectStore::store() takes a list of these, and these are returned by ObjectStore::forEachRef() and ObjectStore::readRef(), which are accessors for nodes, and ObjectStore::getReference().
ObjectStore::load() will load the referenced object, and returns ObjectHandle, a variant that knows what kind of entity it is. ObjectStore::getReferenceKind() can expect the type of reference without asking for unloaded objects to be loaded.
Definition at line 108 of file CASReference.h.
LLVM_DUMP_METHOD void ObjectRef::dump | ( | ) | const |
Definition at line 24 of file ObjectStore.cpp.
References llvm::dbgs(), and print().
|
inlinestatic |
Definition at line 119 of file CASReference.h.
Referenced by llvm::DenseMapInfo< cas::ObjectRef >::getEmptyKey().
|
inlinestatic |
Definition at line 122 of file CASReference.h.
Referenced by llvm::DenseMapInfo< cas::ObjectRef >::getTombstoneKey().
|
inline |
Print internal ref and/or CASID. Only suitable for debugging.
Definition at line 127 of file CASReference.h.
References OS, and llvm::cas::ReferenceBase::print().
Referenced by dump().
|
friend |
Definition at line 132 of file CASReference.h.
Definition at line 115 of file CASReference.h.
Definition at line 112 of file CASReference.h.
|
friend |
Definition at line 133 of file CASReference.h.