DebugInfo: Introduce the notion of "form classes"

Summary:
Use DWARF4 table of form classes to fetch attributes from DIE
in a more consistent way. This shouldn't change the functionality and
serves as a refactoring for upcoming change: DW_AT_high_pc has different
semantics depending on its form class.

Reviewers: dblaikie, echristo

Reviewed By: echristo

CC: echristo, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2013-10-28 23:01:48 +00:00
parent 730e3c6995
commit c5253237f8
7 changed files with 202 additions and 75 deletions

View File

@@ -129,12 +129,17 @@ public:
uint64_t getAttributeValueAsAddress(const DWARFUnit *U, const uint16_t Attr,
uint64_t FailValue) const;
uint64_t getAttributeValueAsUnsigned(const DWARFUnit *U, const uint16_t Attr,
uint64_t FailValue) const;
uint64_t getAttributeValueAsUnsignedConstant(const DWARFUnit *U,
const uint16_t Attr,
uint64_t FailValue) const;
uint64_t getAttributeValueAsReference(const DWARFUnit *U, const uint16_t Attr,
uint64_t FailValue) const;
uint64_t getAttributeValueAsSectionOffset(const DWARFUnit *U,
const uint16_t Attr,
uint64_t FailValue) const;
/// Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
/// Returns true if both attributes are present.
bool getLowAndHighPC(const DWARFUnit *U, uint64_t &LowPC,