struct GloballyHashedType

Declaration

struct GloballyHashedType { /* full declaration omitted */ };

Description

A globally hashed type represents a hash value that is sufficient to uniquely identify a record across multiple type streams or type sequences. This works by, for any given record A which references B, replacing the TypeIndex that refers to B with a previously-computed global hash for B. As this is a recursive algorithm (e.g. the global hash of B also depends on the global hashes of the types that B refers to), a global hash can uniquely identify identify that A occurs in another stream that has a completely different graph structure. Although the hash itself is slower to compute, probing is much faster with a globally hashed type, because the hash itself is considered "as good as" the original type. Since type records can be quite large, this makes the equality comparison of the hash much faster than equality comparison of a full record.

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:77

Member Variables

public std::array<uint8_t, 8> Hash

Method Overview

  • public GloballyHashedType()
  • public GloballyHashedType(llvm::StringRef H)
  • public GloballyHashedType(ArrayRef<uint8_t> H)
  • public bool empty() const
  • public template <typename Range>static std::vector<GloballyHashedType> hashIds(Range && Records, ArrayRef<llvm::codeview::GloballyHashedType> TypeHashes)
  • public static llvm::codeview::GloballyHashedType hashType(ArrayRef<uint8_t> RecordData, ArrayRef<llvm::codeview::GloballyHashedType> PreviousTypes, ArrayRef<llvm::codeview::GloballyHashedType> PreviousIds)
  • public static llvm::codeview::GloballyHashedType hashType(llvm::codeview::CVType Type, ArrayRef<llvm::codeview::GloballyHashedType> PreviousTypes, ArrayRef<llvm::codeview::GloballyHashedType> PreviousIds)
  • public static std::vector<GloballyHashedType> hashTypeCollection(llvm::codeview::TypeCollection & Types)
  • public template <typename Range>static std::vector<GloballyHashedType> hashTypes(Range && Records)

Methods

GloballyHashedType()

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:78

GloballyHashedType(llvm::StringRef H)

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:79

Parameters

llvm::StringRef H

GloballyHashedType(ArrayRef<uint8_t> H)

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:81

Parameters

ArrayRef<uint8_t> H

bool empty() const

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:87

template <typename Range>
static std::vector<GloballyHashedType> hashIds(
    Range&& Records,
    ArrayRef<llvm::codeview::GloballyHashedType>
        TypeHashes)

Description

Given a sequence of combined type and ID records, compute global hashes for each of them, returning the results in a vector of hashed types.

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:147

Templates

Range

Parameters

Range&& Records
ArrayRef<llvm::codeview::GloballyHashedType> TypeHashes

static llvm::codeview::GloballyHashedType
hashType(
    ArrayRef<uint8_t> RecordData,
    ArrayRef<llvm::codeview::GloballyHashedType>
        PreviousTypes,
    ArrayRef<llvm::codeview::GloballyHashedType>
        PreviousIds)

Description

Given a sequence of bytes representing a record, compute a global hash for this record. Due to the nature of global hashes incorporating the hashes of referenced records, this function requires a list of types and ids that RecordData might reference, indexable by TypeIndex.

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:93

Parameters

ArrayRef<uint8_t> RecordData
ArrayRef<llvm::codeview::GloballyHashedType> PreviousTypes
ArrayRef<llvm::codeview::GloballyHashedType> PreviousIds

static llvm::codeview::GloballyHashedType
hashType(
    llvm::codeview::CVType Type,
    ArrayRef<llvm::codeview::GloballyHashedType>
        PreviousTypes,
    ArrayRef<llvm::codeview::GloballyHashedType>
        PreviousIds)

Description

Given a sequence of bytes representing a record, compute a global hash for this record. Due to the nature of global hashes incorporating the hashes of referenced records, this function requires a list of types and ids that RecordData might reference, indexable by TypeIndex.

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:101

Parameters

llvm::codeview::CVType Type
ArrayRef<llvm::codeview::GloballyHashedType> PreviousTypes
ArrayRef<llvm::codeview::GloballyHashedType> PreviousIds

static std::vector<GloballyHashedType>
hashTypeCollection(
    llvm::codeview::TypeCollection& Types)

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:156

Parameters

llvm::codeview::TypeCollection& Types

template <typename Range>
static std::vector<GloballyHashedType> hashTypes(
    Range&& Records)

Description

Given a sequence of combined type and ID records, compute global hashes for each of them, returning the results in a vector of hashed types.

Declared at: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:110

Templates

Range

Parameters

Range&& Records