mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Use std::unique_ptr for DIE children
Got bored, removed some manual memory management. Pushed references (rather than pointers) through a few APIs rather than replacing *x with x.get(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -463,20 +463,18 @@ void DIEHash::computeHash(const DIE &Die) {
|
||||
addAttributes(Die);
|
||||
|
||||
// Then hash each of the children of the DIE.
|
||||
for (std::vector<DIE *>::const_iterator I = Die.getChildren().begin(),
|
||||
E = Die.getChildren().end();
|
||||
I != E; ++I) {
|
||||
for (auto &C : Die.getChildren()) {
|
||||
// 7.27 Step 7
|
||||
// If C is a nested type entry or a member function entry, ...
|
||||
if (isType((*I)->getTag()) || (*I)->getTag() == dwarf::DW_TAG_subprogram) {
|
||||
StringRef Name = getDIEStringAttr(**I, dwarf::DW_AT_name);
|
||||
if (isType(C->getTag()) || C->getTag() == dwarf::DW_TAG_subprogram) {
|
||||
StringRef Name = getDIEStringAttr(*C, dwarf::DW_AT_name);
|
||||
// ... and has a DW_AT_name attribute
|
||||
if (!Name.empty()) {
|
||||
hashNestedType(**I, Name);
|
||||
hashNestedType(*C, Name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
computeHash(**I);
|
||||
computeHash(*C);
|
||||
}
|
||||
|
||||
// Following the last (or if there are no children), append a zero byte.
|
||||
|
Reference in New Issue
Block a user