Lines Matching +full:on +full:- +full:die
1 //===-- llvm/CodeGen/DIEHash.cpp - Dwarf Hashing Framework ----------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
30 static StringRef getDIEStringAttr(const DIE &Die, uint16_t Attr) { in getDIEStringAttr() argument
33 for (const auto &V : Die.values()) in getDIEStringAttr()
70 ((Value == -1) && ((Byte & 0x40) != 0)))); in addSLEB128()
78 void DIEHash::addParentContext(const DIE &Parent) { in addParentContext()
84 SmallVector<const DIE *, 1> Parents; in addParentContext()
85 const DIE *Cur = &Parent; in addParentContext()
86 while (Cur->getParent()) { in addParentContext()
88 Cur = Cur->getParent(); in addParentContext()
90 assert(Cur->getTag() == dwarf::DW_TAG_compile_unit || in addParentContext()
91 Cur->getTag() == dwarf::DW_TAG_type_unit); in addParentContext()
95 for (const DIE *Die : llvm::reverse(Parents)) { in addParentContext() local
100 addULEB128(Die->getTag()); in addParentContext()
103 StringRef Name = getDIEStringAttr(*Die, dwarf::DW_AT_name); in addParentContext()
110 // Collect all of the attributes for a particular DIE in single structure.
111 void DIEHash::collectAttributes(const DIE &Die, DIEAttrs &Attrs) { in collectAttributes() argument
113 for (const auto &V : Die.values()) { in collectAttributes()
130 const DIE &Entry, StringRef Name) { in hashShallowTypeReference()
138 if (const DIE *Parent = Entry.getParent()) in hashShallowTypeReference()
151 // the context is omitted and the name to be used is the ABI-specific name in hashShallowTypeReference()
169 const DIE &Entry) { in hashDIEEntry()
209 void DIEHash::hashRawTypeReference(const DIE &Entry) { in hashRawTypeReference()
223 void DIEHash::hashBlockData(const DIE::const_value_range &Values) { in hashBlockData()
226 const DIE &C = in hashBlockData()
227 *CU->ExprRefedBaseTypes[V.getDIEBaseTypeRef().getIndex()].Die; in hashBlockData()
239 DwarfDebug &DD = *AP->getDwarfDebug(); in hashLocList()
246 // Hash an individual attribute \param Attr based on the type of attribute and
312 addULEB128(Value.getDIEBlock().computeSize(AP->getDwarfFormParams())); in hashAttribute()
315 addULEB128(Value.getDIELoc().computeSize(AP->getDwarfFormParams())); in hashAttribute()
346 // Add all of the attributes for \param Die to the hash.
347 void DIEHash::addAttributes(const DIE &Die) { in addAttributes() argument
349 collectAttributes(Die, Attrs); in addAttributes()
350 hashAttributes(Attrs, Die.getTag()); in addAttributes()
353 void DIEHash::hashNestedType(const DIE &Die, StringRef Name) { in hashNestedType() argument
359 addULEB128(Die.getTag()); in hashNestedType()
365 // Compute the hash of a DIE. This is based on the type signature computation
367 // flattened description of the DIE.
368 void DIEHash::computeHash(const DIE &Die) { in computeHash() argument
369 // Append the letter 'D', followed by the DWARF tag of the DIE. in computeHash()
371 addULEB128(Die.getTag()); in computeHash()
373 // Add each of the attributes of the DIE. in computeHash()
374 addAttributes(Die); in computeHash()
376 // Then hash each of the children of the DIE. in computeHash()
377 for (const auto &C : Die.children()) { in computeHash()
380 …if (isType(C.getTag()) || (C.getTag() == dwarf::DW_TAG_subprogram && isType(C.getParent()->getTag(… in computeHash()
395 /// This is based on the type signature computation given in section 7.27 of the
396 /// DWARF4 standard. It is an md5 hash of the flattened description of the DIE
399 uint64_t DIEHash::computeCUSignature(StringRef DWOName, const DIE &Die) { in computeCUSignature() argument
401 Numbering[&Die] = 1; in computeCUSignature()
405 // Hash the DIE. in computeCUSignature()
406 computeHash(Die); in computeCUSignature()
418 /// This is based on the type signature computation given in section 7.27 of the
419 /// DWARF4 standard. It is an md5 hash of the flattened description of the DIE
422 uint64_t DIEHash::computeTypeSignature(const DIE &Die) { in computeTypeSignature() argument
424 Numbering[&Die] = 1; in computeTypeSignature()
426 if (const DIE *Parent = Die.getParent()) in computeTypeSignature()
429 // Hash the DIE. in computeTypeSignature()
430 computeHash(Die); in computeTypeSignature()