diff options
author | Pavel Labath <labath@google.com> | 2018-03-14 09:39:54 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-03-14 09:39:54 +0000 |
commit | 322711f5290715b1e6f3da6c215e91760e93b408 (patch) | |
tree | d22f7cc01859a2789548c625f27bbb6d0ccfb3e8 /llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp | |
parent | bc683cced825ac6fc31c73cc7a539021c9c14284 (diff) | |
download | bcm5719-llvm-322711f5290715b1e6f3da6c215e91760e93b408.tar.gz bcm5719-llvm-322711f5290715b1e6f3da6c215e91760e93b408.zip |
DWARF: Unify form size handling code
Summary:
This patch replaces the two switches which are deducing the size of
various forms with a single implementation. I have put the new
implementation into BinaryFormat, to avoid introducing dependencies
between the two independent libraries (DebugInfo and CodeGen) that need
this functionality.
Reviewers: aprantl, JDevlieghere, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D44418
llvm-svn: 327486
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp index f593953c62f..688a85c9da3 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp @@ -96,8 +96,7 @@ DWARFAbbreviationDeclaration::extract(DataExtractor Data, default: // The form has a byte size that doesn't depend on Params. // If it's a fixed size, keep track of it. - if ((ByteSize = - DWARFFormValue::getFixedByteSize(F, DWARFFormParams()))) { + if ((ByteSize = dwarf::getFixedFormByteSize(F, dwarf::FormParams()))) { if (FixedAttributeSize) FixedAttributeSize->NumBytes += *ByteSize; break; @@ -217,8 +216,7 @@ Optional<int64_t> DWARFAbbreviationDeclaration::AttributeSpec::getByteSize( if (ByteSize.HasByteSize) return ByteSize.ByteSize; Optional<int64_t> S; - auto FixedByteSize = - DWARFFormValue::getFixedByteSize(Form, U.getFormParams()); + auto FixedByteSize = dwarf::getFixedFormByteSize(Form, U.getFormParams()); if (FixedByteSize) S = *FixedByteSize; return S; |