summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DIEHash.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-14 22:45:02 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-14 22:45:02 +0000
commit40352669ba5a42c22395abf03e289c4f2ee9ec47 (patch)
tree83ebabbbfa5cd80018f0e3fcb2a34dfe1e0fdd84 /lib/CodeGen/AsmPrinter/DIEHash.cpp
parentfdf3f439ebd999c6f7084fde89ccad503ea7b3f9 (diff)
downloadllvm-40352669ba5a42c22395abf03e289c4f2ee9ec47.tar.gz
llvm-40352669ba5a42c22395abf03e289c4f2ee9ec47.tar.bz2
llvm-40352669ba5a42c22395abf03e289c4f2ee9ec47.tar.xz
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIEHash.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DIEHash.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIEHash.cpp b/lib/CodeGen/AsmPrinter/DIEHash.cpp
index 74beec1c95..4cf57040e6 100644
--- a/lib/CodeGen/AsmPrinter/DIEHash.cpp
+++ b/lib/CodeGen/AsmPrinter/DIEHash.cpp
@@ -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.