diff options
| author | Chris Bieneman <beanz@apple.com> | 2016-12-20 21:35:31 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2016-12-20 21:35:31 +0000 |
| commit | ffc4aef54295132446403c3c1633b29b8507d7ea (patch) | |
| tree | ad900fb4663b859deac6a8febf5d04e0f5f0e00c /llvm/lib/DebugInfo/DWARF | |
| parent | 151c4568581f1d6aea266aceb99f7cc683bfc10c (diff) | |
| download | bcm5719-llvm-ffc4aef54295132446403c3c1633b29b8507d7ea.tar.gz bcm5719-llvm-ffc4aef54295132446403c3c1633b29b8507d7ea.zip | |
[ObjectYAML] Support for DWARF debug_info section
This patch adds support for YAML<->DWARF for debug_info sections.
This re-lands r290147, after fixing the issue that caused bots to fail (thank you UBSan!).
llvm-svn: 290204
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp index b3f1a52e6b7..e48a6f0981b 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp @@ -661,3 +661,15 @@ Optional<ArrayRef<uint8_t>> DWARFFormValue::getAsBlock() const { return makeArrayRef(Value.data, Value.uval); } +Optional<uint64_t> DWARFFormValue::getAsCStringOffset() const { + if (!isFormClass(FC_String) && Form == DW_FORM_string) + return None; + return Value.uval; +} + +Optional<uint64_t> DWARFFormValue::getAsReferenceUVal() const { + if (!isFormClass(FC_Reference)) + return None; + return Value.uval; +} + |

