summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2017-06-21 19:37:44 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2017-06-21 19:37:44 +0000
commit258927e3da21c393dda09a6173dbf2912e3f81cd (patch)
tree179767ae0afe50e7523eb1790044c8cfd6c6cc09 /llvm/lib/DebugInfo
parentfd048cc0ec2bb8d12d081258aab79bad495e7ae5 (diff)
downloadbcm5719-llvm-258927e3da21c393dda09a6173dbf2912e3f81cd.tar.gz
bcm5719-llvm-258927e3da21c393dda09a6173dbf2912e3f81cd.zip
[DWARF] Support for DW_FORM_strx3 and complete support for DW_FORM_strx{1,2,4}
(consumer). Reviewer: aprantl Differential Revision: https://reviews.llvm.org/D34418 llvm-svn: 305944
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
index ed1f5f46dcf..39c1f5fd5c5 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -138,6 +138,9 @@ static Optional<uint8_t> getFixedByteSize(dwarf::Form Form, const T *U) {
case DW_FORM_addrx2:
return 2;
+ case DW_FORM_strx3:
+ return 3;
+
case DW_FORM_data4:
case DW_FORM_ref4:
case DW_FORM_ref_sup4:
@@ -302,6 +305,10 @@ bool DWARFFormValue::isFormClass(DWARFFormValue::FormClass FC) const {
case DW_FORM_GNU_str_index:
case DW_FORM_GNU_strp_alt:
case DW_FORM_strx:
+ case DW_FORM_strx1:
+ case DW_FORM_strx2:
+ case DW_FORM_strx3:
+ case DW_FORM_strx4:
return (FC == FC_String);
case DW_FORM_implicit_const:
return (FC == FC_Constant);
@@ -368,6 +375,9 @@ bool DWARFFormValue::extractValue(const DataExtractor &Data,
case DW_FORM_addrx2:
Value.uval = Data.getU16(OffsetPtr);
break;
+ case DW_FORM_strx3:
+ Value.uval = Data.getU24(OffsetPtr);
+ break;
case DW_FORM_data4:
case DW_FORM_ref4:
case DW_FORM_ref_sup4:
@@ -545,6 +555,10 @@ void DWARFFormValue::dump(raw_ostream &OS) const {
dumpString(OS);
break;
case DW_FORM_strx:
+ case DW_FORM_strx1:
+ case DW_FORM_strx2:
+ case DW_FORM_strx3:
+ case DW_FORM_strx4:
case DW_FORM_GNU_str_index:
OS << format(" indexed (%8.8x) string = ", (uint32_t)UValue);
dumpString(OS);
@@ -623,7 +637,9 @@ Optional<const char *> DWARFFormValue::getAsCString() const {
if (Form == DW_FORM_GNU_strp_alt || U == nullptr)
return None;
uint32_t Offset = Value.uval;
- if (Form == DW_FORM_GNU_str_index || Form == DW_FORM_strx) {
+ if (Form == DW_FORM_GNU_str_index || Form == DW_FORM_strx ||
+ Form == DW_FORM_strx1 || Form == DW_FORM_strx2 || Form == DW_FORM_strx3 ||
+ Form == DW_FORM_strx4) {
uint64_t StrOffset;
if (!U->getStringOffsetSectionItem(Offset, StrOffset))
return None;
OpenPOWER on IntegriCloud