summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-09-25 16:04:38 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-09-25 16:04:38 +0000
commit7fa72881d4cbf3b0cbd1fc42f5c8d8e5ea64b9db (patch)
tree26ae728fa9b07e785f90a84686ed1735f53f7c62 /lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
parent2fa270d825deb6daa4f60ba499d72ea9f4159819 (diff)
downloadbcm5719-llvm-7fa72881d4cbf3b0cbd1fc42f5c8d8e5ea64b9db.tar.gz
bcm5719-llvm-7fa72881d4cbf3b0cbd1fc42f5c8d8e5ea64b9db.zip
[Dwarf] Make dw_tag_t a typedef for llvm::dwarf::Tag instead of uint16_t.
Currently dw_tag_t is a typedef for uint16_t. This patch changes makes dw_tag_t a typedef for llvm::dwarf::Tag. This enables us to use the full power of the DWARF utilities in LLVM without having to do the cast every time. With this approach, we only have to do the cast when reading the ULEB value. Differential revision: https://reviews.llvm.org/D68005 llvm-svn: 372891
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
index 6128163a292..741669b0575 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
@@ -18,7 +18,8 @@
using namespace lldb_private;
DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration()
- : m_code(InvalidCode), m_tag(0), m_has_children(0), m_attributes() {}
+ : m_code(InvalidCode), m_tag(llvm::dwarf::DW_TAG_null), m_has_children(0),
+ m_attributes() {}
DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag,
uint8_t has_children)
@@ -33,7 +34,7 @@ DWARFAbbreviationDeclaration::extract(const DWARFDataExtractor &data,
return DWARFEnumState::Complete;
m_attributes.clear();
- m_tag = data.GetULEB128(offset_ptr);
+ m_tag = static_cast<dw_tag_t>(data.GetULEB128(offset_ptr));
if (m_tag == DW_TAG_null)
return llvm::make_error<llvm::object::GenericBinaryError>(
"abbrev decl requires non-null tag.");
@@ -68,7 +69,7 @@ DWARFAbbreviationDeclaration::extract(const DWARFDataExtractor &data,
}
bool DWARFAbbreviationDeclaration::IsValid() {
- return m_code != 0 && m_tag != 0;
+ return m_code != 0 && m_tag != llvm::dwarf::DW_TAG_null;
}
uint32_t
OpenPOWER on IntegriCloud