LLVM 20.0.0git
Classes | Public Member Functions | List of all members
llvm::DIEHash Class Reference

An object containing the capability of hashing and adding hash attributes onto a DIE. More...

#include "CodeGen/AsmPrinter/DIEHash.h"

Public Member Functions

 DIEHash (AsmPrinter *A=nullptr, DwarfCompileUnit *CU=nullptr)
 
uint64_t computeCUSignature (StringRef DWOName, const DIE &Die)
 Computes the CU signature.
 
uint64_t computeTypeSignature (const DIE &Die)
 Computes the type signature.
 
void update (uint8_t Value)
 Adds.
 
void addULEB128 (uint64_t Value)
 Encodes and adds.
 
void addSLEB128 (int64_t Value)
 Encodes and adds.
 
void hashRawTypeReference (const DIE &Entry)
 

Detailed Description

An object containing the capability of hashing and adding hash attributes onto a DIE.

Definition at line 26 of file DIEHash.h.

Constructor & Destructor Documentation

◆ DIEHash()

llvm::DIEHash::DIEHash ( AsmPrinter A = nullptr,
DwarfCompileUnit CU = nullptr 
)
inline

Definition at line 34 of file DIEHash.h.

Member Function Documentation

◆ addSLEB128()

void DIEHash::addSLEB128 ( int64_t  Value)

Encodes and adds.

Parameters
Valueto the hash as a SLEB128.

Definition at line 63 of file DIEHash.cpp.

References llvm::dbgs(), LLVM_DEBUG, and llvm::MD5::update().

Referenced by llvm::HashingByteStreamer::emitSLEB128().

◆ addULEB128()

void DIEHash::addULEB128 ( uint64_t  Value)

Encodes and adds.

Adds the unsigned in Value to the hash encoded as a ULEB128.

Parameters
Valueto the hash as a ULEB128.

Definition at line 52 of file DIEHash.cpp.

References llvm::dbgs(), LLVM_DEBUG, and llvm::MD5::update().

Referenced by llvm::HashingByteStreamer::emitULEB128(), and hashRawTypeReference().

◆ computeCUSignature()

uint64_t DIEHash::computeCUSignature ( StringRef  DWOName,
const DIE Die 
)

Computes the CU signature.

This is based on the type signature computation given in section 7.27 of the DWARF4 standard.

It is an md5 hash of the flattened description of the DIE with the inclusion of the full CU and all top level CU entities.

Definition at line 399 of file DIEHash.cpp.

References llvm::StringRef::empty(), llvm::MD5::final(), and llvm::MD5::update().

◆ computeTypeSignature()

uint64_t DIEHash::computeTypeSignature ( const DIE Die)

Computes the type signature.

This is based on the type signature computation given in section 7.27 of the DWARF4 standard.

It is an md5 hash of the flattened description of the DIE with the inclusion of additional forms not specifically called out in the standard.

Definition at line 422 of file DIEHash.cpp.

References llvm::MD5::final(), and llvm::DIE::getParent().

◆ hashRawTypeReference()

void DIEHash::hashRawTypeReference ( const DIE Entry)

Definition at line 209 of file DIEHash.cpp.

References addULEB128().

Referenced by llvm::HashingByteStreamer::emitDIERef().

◆ update()

void llvm::DIEHash::update ( uint8_t  Value)
inline

Adds.

Parameters
Valueto the hash.

Definition at line 57 of file DIEHash.h.

References llvm::MD5::update().

Referenced by llvm::HashingByteStreamer::emitInt8().


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