summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARF/DWARFDie.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/DWARF/DWARFDie.cpp')
-rw-r--r--lib/DebugInfo/DWARF/DWARFDie.cpp45
1 files changed, 4 insertions, 41 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFDie.cpp b/lib/DebugInfo/DWARF/DWARFDie.cpp
index 2aac3474654f6..89b83b11ab684 100644
--- a/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -152,13 +152,6 @@ const char *DWARFDie::getAttributeValueAsString(dwarf::Attribute Attr,
return Result.hasValue() ? Result.getValue() : FailValue;
}
-uint64_t DWARFDie::getAttributeValueAsAddress(dwarf::Attribute Attr,
- uint64_t FailValue) const {
- if (auto Value = getAttributeValueAsAddress(Attr))
- return *Value;
- return FailValue;
-}
-
Optional<uint64_t>
DWARFDie::getAttributeValueAsAddress(dwarf::Attribute Attr) const {
if (auto FormValue = getAttributeValue(Attr))
@@ -166,13 +159,6 @@ DWARFDie::getAttributeValueAsAddress(dwarf::Attribute Attr) const {
return None;
}
-int64_t DWARFDie::getAttributeValueAsSignedConstant(dwarf::Attribute Attr,
- int64_t FailValue) const {
- if (auto Value = getAttributeValueAsSignedConstant(Attr))
- return *Value;
- return FailValue;
-}
-
Optional<int64_t>
DWARFDie::getAttributeValueAsSignedConstant(dwarf::Attribute Attr) const {
if (auto FormValue = getAttributeValue(Attr))
@@ -180,15 +166,6 @@ DWARFDie::getAttributeValueAsSignedConstant(dwarf::Attribute Attr) const {
return None;
}
-uint64_t
-DWARFDie::getAttributeValueAsUnsignedConstant(dwarf::Attribute Attr,
- uint64_t FailValue) const {
- if (auto Value = getAttributeValueAsUnsignedConstant(Attr))
- return *Value;
- return FailValue;
-}
-
-
Optional<uint64_t>
DWARFDie::getAttributeValueAsUnsignedConstant(dwarf::Attribute Attr) const {
if (auto FormValue = getAttributeValue(Attr))
@@ -196,14 +173,6 @@ DWARFDie::getAttributeValueAsUnsignedConstant(dwarf::Attribute Attr) const {
return None;
}
-uint64_t DWARFDie::getAttributeValueAsReference(dwarf::Attribute Attr,
- uint64_t FailValue) const {
- if (auto Value = getAttributeValueAsReference(Attr))
- return *Value;
- return FailValue;
-}
-
-
Optional<uint64_t>
DWARFDie::getAttributeValueAsReference(dwarf::Attribute Attr) const {
if (auto FormValue = getAttributeValue(Attr))
@@ -211,13 +180,6 @@ DWARFDie::getAttributeValueAsReference(dwarf::Attribute Attr) const {
return None;
}
-uint64_t DWARFDie::getAttributeValueAsSectionOffset(dwarf::Attribute Attr,
- uint64_t FailValue) const {
- if (auto Value = getAttributeValueAsSectionOffset(Attr))
- return *Value;
- return FailValue;
-}
-
Optional<uint64_t>
DWARFDie::getAttributeValueAsSectionOffset(dwarf::Attribute Attr) const {
if (auto FormValue = getAttributeValue(Attr))
@@ -345,9 +307,10 @@ DWARFDie::getName(DINameKind Kind) const {
void DWARFDie::getCallerFrame(uint32_t &CallFile, uint32_t &CallLine,
uint32_t &CallColumn) const {
- CallFile = getAttributeValueAsUnsignedConstant(DW_AT_call_file, 0);
- CallLine = getAttributeValueAsUnsignedConstant(DW_AT_call_line, 0);
- CallColumn = getAttributeValueAsUnsignedConstant(DW_AT_call_column, 0);
+ CallFile = getAttributeValueAsUnsignedConstant(DW_AT_call_file).getValueOr(0);
+ CallLine = getAttributeValueAsUnsignedConstant(DW_AT_call_line).getValueOr(0);
+ CallColumn =
+ getAttributeValueAsUnsignedConstant(DW_AT_call_column).getValueOr(0);
}
void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth,