diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-09-23 22:44:40 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-09-23 22:44:40 +0000 |
commit | cd7c4980d4ee2d22d92a4907f2d029e67b52d732 (patch) | |
tree | 424cf437838c0b79260958a152a738e5e519fe74 /lib/DebugInfo/DWARFFormValue.cpp | |
parent | f2058addc2aa221d0fd744180a2c04a38ebddcd0 (diff) | |
download | llvm-cd7c4980d4ee2d22d92a4907f2d029e67b52d732.tar.gz llvm-cd7c4980d4ee2d22d92a4907f2d029e67b52d732.tar.bz2 llvm-cd7c4980d4ee2d22d92a4907f2d029e67b52d732.tar.xz |
Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the coming DWARFTypeUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFFormValue.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFFormValue.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/DebugInfo/DWARFFormValue.cpp b/lib/DebugInfo/DWARFFormValue.cpp index 4ae92fc898..8ea30c612d 100644 --- a/lib/DebugInfo/DWARFFormValue.cpp +++ b/lib/DebugInfo/DWARFFormValue.cpp @@ -74,9 +74,8 @@ DWARFFormValue::getFixedFormSizes(uint8_t AddrSize, uint16_t Version) { return 0; } -bool -DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr, - const DWARFCompileUnit *cu) { +bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr, + const DWARFUnit *cu) { bool indirect = false; bool is_block = false; Value.data = NULL; @@ -206,13 +205,13 @@ DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr, bool DWARFFormValue::skipValue(DataExtractor debug_info_data, uint32_t* offset_ptr, - const DWARFCompileUnit *cu) const { + const DWARFUnit *cu) const { return DWARFFormValue::skipValue(Form, debug_info_data, offset_ptr, cu); } bool DWARFFormValue::skipValue(uint16_t form, DataExtractor debug_info_data, - uint32_t *offset_ptr, const DWARFCompileUnit *cu) { + uint32_t *offset_ptr, const DWARFUnit *cu) { bool indirect = false; do { switch (form) { @@ -312,7 +311,7 @@ DWARFFormValue::skipValue(uint16_t form, DataExtractor debug_info_data, } void -DWARFFormValue::dump(raw_ostream &OS, const DWARFCompileUnit *cu) const { +DWARFFormValue::dump(raw_ostream &OS, const DWARFUnit *cu) const { DataExtractor debug_str_data(cu->getStringSection(), true, 0); DataExtractor debug_str_offset_data(cu->getStringOffsetSection(), true, 0); uint64_t uvalue = getUnsigned(); @@ -436,8 +435,7 @@ DWARFFormValue::dump(raw_ostream &OS, const DWARFCompileUnit *cu) const { OS << format(" => {0x%8.8" PRIx64 "}", uvalue + (cu ? cu->getOffset() : 0)); } -const char* -DWARFFormValue::getAsCString(const DWARFCompileUnit *CU) const { +const char *DWARFFormValue::getAsCString(const DWARFUnit *CU) const { if (isInlinedCStr()) return Value.cstr; if (!CU) @@ -452,8 +450,7 @@ DWARFFormValue::getAsCString(const DWARFCompileUnit *CU) const { return CU->getStringExtractor().getCStr(&Offset); } -uint64_t -DWARFFormValue::getAsAddress(const DWARFCompileUnit *CU) const { +uint64_t DWARFFormValue::getAsAddress(const DWARFUnit *CU) const { if (!CU) return 0; if (Value.IsDWOIndex) { @@ -466,7 +463,7 @@ DWARFFormValue::getAsAddress(const DWARFCompileUnit *CU) const { return Value.uval; } -uint64_t DWARFFormValue::getReference(const DWARFCompileUnit *cu) const { +uint64_t DWARFFormValue::getReference(const DWARFUnit *cu) const { uint64_t die_offset = Value.uval; switch (Form) { case DW_FORM_ref1: |