summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-03-13 21:46:37 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-03-13 21:46:37 +0000
commit1914c82d6c09e1c0ece9d6b2ca48cefbe097a1a0 (patch)
tree30e7811e86753c83a3b0ea5142733bec57feba03 /llvm/lib/DebugInfo
parent427f426f02cfba136f197cb96a2719a3aff98061 (diff)
downloadbcm5719-llvm-1914c82d6c09e1c0ece9d6b2ca48cefbe097a1a0.tar.gz
bcm5719-llvm-1914c82d6c09e1c0ece9d6b2ca48cefbe097a1a0.zip
Fix llvm-symbolizer to navigate both DW_AT_abstract_origin and DW_AT_specification in a single chain
In a recent refactoring (r291959) this regressed to only following one or the other, not both, in a single chain. llvm-svn: 297676
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDie.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
index fc49fdeaad5..4308cc2e263 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -150,21 +150,6 @@ DWARFDie::find(dwarf::Attribute Attr) const {
}
Optional<DWARFFormValue>
-DWARFDie::findRecursively(dwarf::Attribute Attr) const {
- if (!isValid())
- return None;
- if (auto Value = find(Attr))
- return Value;
- if (auto Die = getAttributeValueAsReferencedDie(DW_AT_abstract_origin))
- if (auto Value = Die.find(Attr))
- return Value;
- if (auto Die = getAttributeValueAsReferencedDie(DW_AT_specification))
- if (auto Value = Die.find(Attr))
- return Value;
- return None;
-}
-
-Optional<DWARFFormValue>
DWARFDie::find(ArrayRef<dwarf::Attribute> Attrs) const {
if (!isValid())
return None;
@@ -182,14 +167,17 @@ Optional<DWARFFormValue>
DWARFDie::findRecursively(ArrayRef<dwarf::Attribute> Attrs) const {
if (!isValid())
return None;
- if (auto Value = find(Attrs))
+ auto Die = *this;
+ if (auto Value = Die.find(Attrs))
+ return Value;
+ if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_abstract_origin))
+ Die = D;
+ if (auto Value = Die.find(Attrs))
+ return Value;
+ if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_specification))
+ Die = D;
+ if (auto Value = Die.find(Attrs))
return Value;
- if (auto Die = getAttributeValueAsReferencedDie(DW_AT_abstract_origin))
- if (auto Value = Die.find(Attrs))
- return Value;
- if (auto Die = getAttributeValueAsReferencedDie(DW_AT_specification))
- if (auto Value = Die.find(Attrs))
- return Value;
return None;
}
OpenPOWER on IntegriCloud