diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-10-28 23:41:49 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-10-28 23:41:49 +0000 |
commit | 6faff4886a3059a8cda08f015d29a6c9a0a4de3c (patch) | |
tree | b053da16d95ba9281bcfb868b049df1009f01f41 /lib/DebugInfo/DWARFDebugInfoEntry.cpp | |
parent | 1765daa21c51a3e6bfc7db4adbbcbac0e0dcff3e (diff) | |
download | external_llvm-6faff4886a3059a8cda08f015d29a6c9a0a4de3c.zip external_llvm-6faff4886a3059a8cda08f015d29a6c9a0a4de3c.tar.gz external_llvm-6faff4886a3059a8cda08f015d29a6c9a0a4de3c.tar.bz2 |
DWARF parser: Use ArrayRef to represent form sizes and simplify DWARFDIE::extractFast() interface. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFDebugInfoEntry.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFDebugInfoEntry.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/lib/DebugInfo/DWARFDebugInfoEntry.cpp index 3383cee..39d8e3e 100644 --- a/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -93,7 +93,6 @@ void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS, } bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFUnit *U, - const uint8_t *FixedFormSizes, uint32_t *OffsetPtr) { Offset = *OffsetPtr; DataExtractor DebugInfoData = U->getDebugInfoExtractor(); @@ -105,21 +104,19 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFUnit *U, } AbbrevDecl = U->getAbbreviations()->getAbbreviationDeclaration(AbbrCode); assert(AbbrevDecl); - assert(FixedFormSizes); // For best performance this should be specified! + ArrayRef<uint8_t> FixedFormSizes = DWARFFormValue::getFixedFormSizes( + U->getAddressByteSize(), U->getVersion()); + assert(FixedFormSizes.size() > 0); // Skip all data in the .debug_info for the attributes for (uint32_t i = 0, n = AbbrevDecl->getNumAttributes(); i < n; ++i) { uint16_t Form = AbbrevDecl->getFormByIndex(i); - // FIXME: Currently we're checking if this is less than the last - // entry in the fixed_form_sizes table, but this should be changed - // to use dynamic dispatch. uint8_t FixedFormSize = - (Form < DW_FORM_ref_sig8) ? FixedFormSizes[Form] : 0; + (Form < FixedFormSizes.size()) ? FixedFormSizes[Form] : 0; if (FixedFormSize) *OffsetPtr += FixedFormSize; - else if (!DWARFFormValue::skipValue(Form, DebugInfoData, OffsetPtr, - U)) { + else if (!DWARFFormValue::skipValue(Form, DebugInfoData, OffsetPtr, U)) { // Restore the original offset. *OffsetPtr = Offset; return false; |