LLVM 22.0.0git
llvm::cas::CASID Class Reference

Unique identifier for a CAS object. More...

#include "llvm/CAS/CASID.h"

Public Member Functions

void dump () const
void print (raw_ostream &OS) const
 Print CASID.
std::string toString () const
 Return a printable string for CASID.
ArrayRef< uint8_tgetHash () const
const CASContextgetContext () const
 CASID ()=delete

Static Public Member Functions

static CASID getDenseMapEmptyKey ()
static CASID getDenseMapTombstoneKey ()
static CASID create (const CASContext *Context, StringRef Hash)
 Create CASID from CASContext and raw hash bytes.

Friends

raw_ostreamoperator<< (raw_ostream &OS, const CASID &ID)
bool operator== (const CASID &LHS, const CASID &RHS)
bool operator!= (const CASID &LHS, const CASID &RHS)
hash_code hash_value (const CASID &ID)

Detailed Description

Unique identifier for a CAS object.

Locally, stores an internal CAS identifier that's specific to a single CAS instance. It's guaranteed not to change across the view of that CAS, but might change between runs.

It also has CASIDContext pointer to allow comparison of these identifiers. If two CASIDs are from the same CASIDContext, they can be compared directly. If they are, then CASIDContext::getHashSchemaIdentifier() is compared to see if they can be compared by hash, in which case the result of getHash() is compared.

Definition at line 58 of file CASID.h.

Constructor & Destructor Documentation

◆ CASID()

llvm::cas::CASID::CASID ( )
delete

Member Function Documentation

◆ create()

CASID llvm::cas::CASID::create ( const CASContext * Context,
StringRef Hash )
inlinestatic

Create CASID from CASContext and raw hash bytes.

Definition at line 117 of file CASID.h.

References CASID().

Referenced by createResultCachePoisonedError(), and llvm::cas::builtin::BuiltinCAS::parseID().

◆ dump()

LLVM_DUMP_METHOD void CASID::dump ( ) const

Definition at line 23 of file ObjectStore.cpp.

References llvm::dbgs(), LLVM_DUMP_METHOD, and print().

◆ getContext()

const CASContext & llvm::cas::CASID::getContext ( ) const
inline

Definition at line 102 of file CASID.h.

References assert().

Referenced by print().

◆ getDenseMapEmptyKey()

CASID llvm::cas::CASID::getDenseMapEmptyKey ( )
inlinestatic

Definition at line 107 of file CASID.h.

References CASID().

Referenced by llvm::DenseMapInfo< cas::CASID >::getEmptyKey().

◆ getDenseMapTombstoneKey()

CASID llvm::cas::CASID::getDenseMapTombstoneKey ( )
inlinestatic

Definition at line 110 of file CASID.h.

References CASID().

Referenced by llvm::DenseMapInfo< cas::CASID >::getTombstoneKey().

◆ getHash()

ArrayRef< uint8_t > llvm::cas::CASID::getHash ( ) const
inline

Definition at line 75 of file CASID.h.

References llvm::arrayRefFromStringRef().

◆ print()

void llvm::cas::CASID::print ( raw_ostream & OS) const
inline

Print CASID.

Definition at line 68 of file CASID.h.

References getContext(), and llvm::cas::CASContext::printIDImpl().

Referenced by dump().

◆ toString()

std::string CASID::toString ( ) const

Return a printable string for CASID.

Definition at line 27 of file ObjectStore.cpp.

Referenced by createResultCachePoisonedError().

◆ hash_value

hash_code hash_value ( const CASID & ID)
friend

Definition at line 97 of file CASID.h.

References CASID(), and llvm::hash_combine_range().

◆ operator!=

bool operator!= ( const CASID & LHS,
const CASID & RHS )
friend

Definition at line 93 of file CASID.h.

References CASID(), LHS, and RHS.

◆ operator<<

raw_ostream & operator<< ( raw_ostream & OS,
const CASID & ID )
friend

Definition at line 62 of file CASID.h.

References CASID().

◆ operator==

bool operator== ( const CASID & LHS,
const CASID & RHS )
friend

Definition at line 79 of file CASID.h.

References CASID(), LHS, and RHS.


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